addEventHandler("onClientPlayerTarget", getRootElement(), function()
local weapon = getPedWeapon ( source )
if ( target ) then
if weapon == 23 then
if getElementType(target) == "player" then
triggerClientEvent("paraliz2", target)
end
end
end
end)
addEventHandler("onClientResourceStart", getRootElement(), function()
engineImportTXD (engineLoadTXD("taser.txd"), 347)
engineReplaceModel(engineLoadDFF("taser.dff", 347), 347)
end)
S:
--FUNCKJE
local time = 10
function paraliz (thePlayer)
setElementFrozen ( thePlayer, true )
setPedAnimation( thePlayer, "ped", "KO_shot_stom")
setTimer(setElementFrozen, time*3000, 1, thePlayer, false)
setTimer(setPedAnimation, time*3000, 1, thePlayer)
outputChatBox("Zostajesz sparalizowany",thePlayer,255,0,0)
end
addEvent( "paraliz2", true )
addEventHandler( "paraliz2", getRootElement(), paraliz)
Podpis
Użytkownik - 10-05-2016
Support Team - 17.06.2017 Moderator - 25.11.2017 Mod-Team - 02.07.2018
Rookspack, podaj db3, w?asnie wbi?em na wiki zobaczy? jak ten event trzeba opisa? i u ciebie nie ma w funkcji "target" wi?c wklej to co ten pan na dole napisa?.
Ostatnio zmieniony przez amited 2016-11-24, 18:29, w całości zmieniany 1 raz
addEventHandler("onClientPlayerTarget", getRootElement(), function(target)
local weapon = getPedWeapon ( source )
if ( target ) then
if weapon == 23 then
if getElementType(target) == "player" then
triggerServerEvent("paraliz2", target)
end
end
end
end)
addEventHandler("onClientResourceStart", getRootElement(), function()
engineImportTXD (engineLoadTXD("taser.txd"), 347)
engineReplaceModel(engineLoadDFF("taser.dff", 347), 347)
end)
s-side:
--FUNCKJE
local time = 10
function paraliz ()
setElementFrozen ( source, true )
setPedAnimation( source, "ped", "KO_shot_stom")
setTimer(setElementFrozen, time*3000, 1, source, false)
setTimer(setPedAnimation, time*3000, 1, source)
outputChatBox("Zostajesz sparalizowany",source,255,0,0)
end
addEvent( "paraliz2", true )
addEventHandler( "paraliz2", getRootElement(), paraliz)
addEventHandler( "onClientPlayerDamage", getRootElement(),
function ( target, weapon )
if weapon == 23 then
triggerServerEvent("paraliz2", source)
end
end
)
Daj tak? funkcje po stronie client
[ Dodano: 2016-11-24, 19:15 ] Rookspack, amited, event onClientPlayerTarget dzia?a jak gracz kogo? namierzy a nie jak kogo? postrzeli taka ma?a uwaga
amited, nie wiem sk?d ty wioz?e? ?e source ni jest elementem tigeruj?cym.
source: the element that triggered the event
this: the element that the event handler is attached to
client: the client that triggered the event using triggerServerEvent. Not set if the event was not triggered from a client.
eventName: the name of the event which triggered the handler function.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach