Dobry,
Jak napisa? skrypt na kolczatk?? Tak aby tylko np. frakcja z elementdat? SAPD j? mia?a nie pod komende, tylko pod np X a pod Z aby usuwa?o kolczatk?? Pys 3.0
witam, mam problem z kolczatk?, w takim sensie ?e jestem zalogowany na frakcj? sapd ale nie mog? stawia? kolczatki.
[lua]local kolczatki = {}
local cuboidy = {}
local pojazdy = {[598]=true,[411]=true,[597]=true,[451]=true, [560]=true,}
local odporny = {}
addEventHandler("onPlayerLogin",root,function(prevAcc,currAcc,auto)
local accName = getAccountName(currAcc)
if getElementData(source,'player:duty') and getElementData(source,'player:duty')=='SAPD' then
bindKey(getAccountPlayer(currAcc),"x","down",postawkolczatke)
bindKey(getAccountPlayer(currAcc),"c","down",usunkolczatke)
end
end)
function postawkolczatke(plr,key,keyState)
local veh = getPedOccupiedVehicle(plr)
if pojazdy[getElementModel(veh)] then
setElementData(plr,"odporny",true)
triggerClientEvent(plr,"znajdzmiejsce",plr)
if odporny[plr] then
killTimer(odporny[plr])
end
odporny[plr] = setTimer(function()
setElementData(plr,"odporny",false)
odporny[plr] = nil
end,1000,1)
end
end
addEvent("postaw",true)
addEventHandler("postaw",root,function(x,y,z,rx,ry,rz)
if kolczatki[source] then
destroyElement(kolczatki[source])
kolczatki[source] = nil
destroyElement(cuboidy[source])
cuboidy[source] = nil
end
local kolczatka = createO...
addEvent("znajdzmiejsce",true)
addEventHandler("znajdzmiejsce",root,function()
local veh = getPedOccupiedVehicle(localPlayer)
local x,y,z = getVehicleComponentPosition(veh,"bump_rear_dummy","world")
local rx,ry,rz = getVehicleComponentRotation(veh,"bump_rear_dummy","world")
triggerServerEvent("postaw",localPlayer,x,y,z,rx,ry,rz)
end)
function sprawdzaj()
local veh = getPedOccupiedVehicle(localPlayer)
if veh then
local x1,y1,_ = getVehicleComponentPosition(veh,"wheel_lf_dummy","world")
local x2,y2,_ = getVehicleComponentPosition(veh,"wheel_lb_dummy","world")
local x3,y3,_ = getVehicleComponentPosition(veh,"wheel_rf_dummy","world")
local x4,y4,_ = getVehicleComponentPosition(veh,"wheel_rb_dummy","world")
local s1,s2,s3,s4 = getVehicleWheelStates(veh)
local distance1 = getDistanceBetweenPoints2D(x1,y1,ox,oy)
local distance2 = getDistanceBetweenPoints2D(x2,y2,ox,oy)
local distance3 = getDistanceBetweenPoints2D(x3,y3,ox,oy)
local distance4 = getDistanceBetweenPoints2D(x4,y4,ox,oy)
if distance1 < 2 then
if s1 ~= 1 then
triggerServerEvent("przebijopon...
Witam mam tu taki skrypt na kolczatki i czy mo?e kto? mi pom?c ?eby tylko gracz w acl Policja m?g? je rozk?ada? i usuwa?
s:
[lua]function onCreateStinger(x, y, z, rx, ry, rz)
stinger = createObject(2899, x, y, z+0.1, rx, ry, rz)
setElementData(stinger, "isStinger", true)
triggerClientEvent( "onCreateStinger", getRootElement(), x, y, z)
stingerPlant(source)
end
addEvent( "onCreateStinger", true )
addEventHandler( "onCreateStinger", getRootElement(), onCreateStinger)
function stingerPlant(player)
setPedAnimation(player, "BOMBER", "BOM_plant", 3000, false, false, false)
setTimer(setPedAnimation, 2000, 1, player)
end[/lua]
c:
[lua]function getPointFrontOfElement(element,distance)
local x, y, z = getElementPosition ( element )
local rx, ry, rz = getElementRotation ( element )
x = x + (distance * (math.sin(math.rad(-rz))) )
y = y + (distance * (math.cos(math.rad(-rz))) )
return x,y,z
end
function getPositionFromElementAtOffset(element,x,y,z)
if not x or not y or not z then
return x, y, z
end
local matrix = getElementMatrix ( element )
local offX = x * matrix[1][1] + y * matrix[2][1] + z * matrix[3][1] + matrix[4][1]
local offY = x * matrix[1][2] + y * matrix[2][2] + z * matrix[3][2] + matrix[4][2]
local offZ = x * matrix[1][3] + y * matrix[2][3] + z * matrix[3][3] + matrix[4][3]
return offX, of...
Przedstawiam kolejny skrypt, kt?ry wam udost?pniam.
Jest to skrypt na kolczatk? dla policji. Zasada dzia?ania jest prosta.
Jednym klawiszem k?adziemy kolczatk?, a drugim usuwamy.
K?a?? kolczatki mo?na b?d?c w ACL Policja oraz siedz?c w radiowozie policyjnym.
Mo?na po?o?y? tylko jedn? kolczatk?, wi?c je?eli ponownie postawimy kolczatk? i b?dzie jaka? poprzednia to zniknie.
Bind'y:
X - Postaw kolczatk?
Z - Usu? kolczatk?
SS:
Link do pobrania:
Ukryta wiadomość / Hidden message(aby ją zobaczyć musisz postawić użytkownikowi)
Wiadomość została ukryta, aby ją przeczytać należy się zalogować.
Witam mam taki problem posiadam kolczatke wszystko cacy postawia si? lecz nie usuwa chcia?em zrobi? to sam lecz nie dzia?a Wi?c daje wam linijki na postawianie
Jak mo?ecie to wy?lijcie linijki na usuwanie
Witam mam pewien problem z kolczatk?,poniewa? gdy wystawiam kolczatk? wszystko ?adnie pi?knie stawia si? lecz gdy auto na ni? wjedzie ko?a nie przebijaj? si?
W czym mo?e by? problem?
Tutaj macie kod stawiania i chowania kolczatki je?eli b?dziecie chcieli co? innego piszcie. za pomoc leci Piwko i respekt.
Hej, od pewnego czasu szukam kolczatek i nie mog? znale?? a moja mi nie dzia?a, znalaz?em na owym forum jak??, ale te? zbugowana. Wzi??em wi?c z community i wygl?da ona tak:
[lua]local thePlayer = getLocalPlayer()
local theKolczatka = {}
local kolec = {}
function kladz()
if( isPlayerInVehicle( thePlayer ) ) then -- is the player in a car?
if( isElement( theKolczatka[ thePlayer ] ) ) then
destroyElement( theKolczatka[ thePlayer ] )
destroyElement( kolec[ thePlayer ] )
end
local theVehicle = getPlayerOccupiedVehicle( thePlayer )
local rx, ry, rz = getVehicleRotation( theVehicle )
local x, y, z = getElementPosition( theVehicle )
local a = getPlayerRotation( thePlayer )
x = x + math.sin( math.rad(a) ) * 4
y = y - math.cos( math.rad(a) ) * 4
rz = rz + 90
local ziemiaZ = getGroundPosition( x, y, z )
if( ziemiaZ ~= z ) then z = ziemiaZ + 0.2 end
theKolczatka[ thePlayer ] = createObject( 2899, x, y, z, 0, 0, rz )
kolec[ thePlayer ] = createColRectangle( (x - 2.0), (y - 2.0), 4.0, 4.0 )
setElementData( kolec[ thePlayer ], "kolce", "abc" )
outputChatBox( "Roz?o?y?e? kolczatk?!", thePlayer, 255, 0, 0, true )
else
outputChatBox( "Musisz by? w aucie ?eby po?o?yc kolczatk?!", thePlayer, 255, 0, 0, true )
end
end
function kolabum( theElement, matchingDimension )
if( getElementType( theElement ) == "vehicle" and getElementData( source, "kolce" ) == "...
Witam. Dzisiaj robilem kolczatke i mam oto takie bledy w komendzie:
[code]D:pawnodiamond.pwn(6315) : warning 219: local variable "x" shadows a variable at a preceding level
D:pawnodiamond.pwn(6315) : warning 219: local variable "y" shadows a variable at a preceding level
D:pawnodiamond.pwn(6315) : warning 219: local variable "z" shadows a variable at a preceding level
D:pawnodiamond.pwn(6316) : error 035: argument type mismatch (argument 2)
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6318) : warning 213: tag mismatch
D:pawnodiamond.pwn(6315) : warning 203: symbol is never used: "z"
D:pawnodiamond.pwn(6315) : warning 203: symbol is never used: "y"
D:pawnodiamond.pwn(6315) : warning 203: symbol is never used: "x"
D:pawnodiamond.pwn(6315 -- 6323) : warning 225: unreachable code
D:pawnodiamond.pwn(6323) : error 029: invalid expression, assumed zero
D:pawnodiamond.pwn(6323) : error 017: undefined symbol "cmd_usunkolcz"
D:pawnodiamond.pwn(6323) : error 029: invalid expression, assumed zero
D:pawnodiamond.pwn(6323) : fatal error 107: too many error messages on one line
Witam mam ma?y problem z kolczatk? , nie wiem co z tym zrobi? a dok?adnie jak za definiowa? to
B??d
Jak to naprawi? prosz? o pomoc, i dok?adne podpowiedzi co z tym zrobi?.
Tak przy okazji mo?e wie kto? jak zrobi? cmd kt?ra wywo?uje t? sam? czynno??
u mnie i u kogo? np. cmd na animke kt?ra akceptuje kto? i wykonuje j? w tym samym czasie.[/code]
Witam dzi? chce si? zapyta? jak zrobi? ma?a blokad? np. na team lub acl do tego skryptu
serwer
[lua]function onCreateStinger(x, y, z, rx, ry, rz)
stinger = createObject(2899, x, y, z+0.1, rx, ry, rz)
setElementData(stinger, "isStinger", true)
triggerClientEvent( "onCreateStinger", getRootElement(), x, y, z)
stingerPlant(source)
end
addEvent( "onCreateStinger", true )
addEventHandler( "onCreateStinger", getRootElement(), onCreateStinger)
function stingerPlant(player)
setPedAnimation(player, "BOMBER", "BOM_plant", 3000, false, false, false)
setTimer(setPedAnimation, 2000, 1, player)
end
[/lua]
klient
[lua]function getPointFrontOfElement(element,distance)
local x, y, z = getElementPosition ( element )
local rx, ry, rz = getElementRotation ( element )
x = x + (distance * (math.sin(math.rad(-rz))) )
y = y + (distance * (math.cos(math.rad(-rz))) )
return x,y,z
end
function getPositionFromElementAtOffset(element,x,y,z)
if not x or not y or not z then
return x, y, z
end
local matrix = getElementMatrix ( element )
local offX = x * matrix[1][1] + y * matrix[2][1] + z * matrix[3][1] + matrix[4][1]
local offY = x * matrix[1][2] + y * matrix[2][2] + z * matrix[3][2] + matrix[4][2]
local offZ = x * matrix[1][3] + y * matrix[2][3] + z * matrix[3][3] + matrix[4][3]
return offX, offY, offZ
end
Witajcie. Mam pytanie odnosz?ce si? do kolczatek w samp. Chcia?bym zrobi? tak? komend? kt?ra po wpisaniu /kolczatka (je?li gracz jest w Team) Pokazuje si? kolczatka i przebija opony. Wiecie jak to zrobic za pomoc daje Piifkoo