Plate Posted June 9, 2013 Share 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 Link to comment
Bc# Posted June 9, 2013 Share 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 Link to comment
Alexs Posted June 9, 2013 Share 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'. Link to comment
Plate Posted June 9, 2013 Author Share 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 Link to comment
Alexs Posted June 9, 2013 Share 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. Link to comment
Plate Posted June 9, 2013 Author Share Posted June 9, 2013 Uh lol no sabia gracias PD:Que evento uso Link to comment
Alexs Posted June 9, 2013 Share Posted June 9, 2013 Uh lol no sabia graciasPD:Que evento uso Hazlo en client-side con 'onClientPedDamage' Link to comment
Plate Posted June 9, 2013 Author Share 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) Link to comment
Recommended Posts