Plate Posted June 9, 2013 Posted June 9, 2013 Hola tengo un problema con este script es que no funciona y ni idea por que tampoco da error function checkAttacker(attacker, weapon, bodypart) if isElement(attacker) then if (getElementType("attacker") == "player") then setTimer(triggerClientEvent, 9000, 0, root, "onBossFire", root, boss, attacker) outputChatBox("estas asdasd", attacker, 0, 255, 255) end end end
Bc# Posted June 9, 2013 Posted June 9, 2013 esta mal la sintaxis del setTimer, intenta con: function checkAttacker(attacker, weapon, bodypart) if isElement(attacker) then if (getElementType("attacker") == "player") then setTimer(function() triggerClientEvent(root, "onBossFire", root, boss, attacker) end, 9000, 0) outputChatBox("estas asdasd", attacker, 0, 255, 255) end end end
Alexs Posted June 9, 2013 Posted June 9, 2013 Hola tengo un problema con este script es que no funciona y ni idea por que tampoco da error function checkAttacker(attacker, weapon, bodypart) if isElement(attacker) then if (getElementType("attacker") == "player") then setTimer(triggerClientEvent, 9000, 0, root, "onBossFire", root, boss, attacker) outputChatBox("estas asdasd", attacker, 0, 255, 255) end end end Muestra ejecutas la función 'checkAttacker'.
Plate Posted June 9, 2013 Author Posted June 9, 2013 Hola tengo un problema con este script es que no funciona y ni idea por que tampoco da error function checkAttacker(attacker, weapon, bodypart) if isElement(attacker) then if (getElementType("attacker") == "player") then setTimer(triggerClientEvent, 9000, 0, root, "onBossFire", root, boss, attacker) outputChatBox("estas asdasd", attacker, 0, 255, 255) end end end Muestra ejecutas la función 'checkAttacker'. la ejecuto con onPedDamage pero no funciona tampoco PD:El triggerClientEvent esta bien
Alexs Posted June 9, 2013 Posted June 9, 2013 Hola tengo un problema con este script es que no funciona y ni idea por que tampoco da error function checkAttacker(attacker, weapon, bodypart) if isElement(attacker) then if (getElementType("attacker") == "player") then setTimer(triggerClientEvent, 9000, 0, root, "onBossFire", root, boss, attacker) outputChatBox("estas asdasd", attacker, 0, 255, 255) end end end Muestra ejecutas la función 'checkAttacker'. la ejecuto con onPedDamage pero no funciona tampoco PD:El triggerClientEvent esta bien 'onPedDamage' no existe.
Alexs Posted June 9, 2013 Posted June 9, 2013 Uh lol no sabia graciasPD:Que evento uso Hazlo en client-side con 'onClientPedDamage'
Plate Posted June 9, 2013 Author Posted June 9, 2013 Client: function checkAttacker(attacker, weapon, bodypart) if isElement(attacker) then if (getElementType("attacker") == "player") then triggerServerEvent("attackerChecked", localPlayer, attacker) end end end addEventHandler("onClientPedDamage", root, checkAttacker) server: function attacked(attacker) setTimer(triggerClientEvent, 9000, 0, root, "onBossFire", root, boss, attacker) end addEvent("attackerChecked", true) addEventHandler("attackerChecked", root, attacked)
Recommended Posts