Baseplate Posted September 23, 2012 Share Posted September 23, 2012 function lol ( source ) killPed (source) setTimer (lol, 5000) outputChatBox ("You will die in 5 seconds.", 255, 0, 0, source) end addCommandHandler("kill",lol) It's not working ;S when I do /kill it kills me right away, problem with the setTimer Link to comment
Anderl Posted September 23, 2012 Share Posted September 23, 2012 addCommandHandler('lol', function(p) setTimer(killPed, 5000, 1, p) outputChatBox('You\'ll die in 5 seconds!', p, 255, 255, 255, false) end ) Link to comment
Baseplate Posted September 23, 2012 Author Share Posted September 23, 2012 Dosen't work Move and u die, and it kills u right away Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 His code works as it's supposed, the only problem is in here: outputChatBox ( 'You'll die in 5 seconds!', p, 255, 255, 255, false ) With the ' he's finishing the string. Should be: outputChatBox ( "You'll die in 5 seconds!", p, 255, 255, 255, false ) Link to comment
Anderl Posted September 23, 2012 Share Posted September 23, 2012 His code works as it's supposed, the only problem is in here: outputChatBox ( 'You'll die in 5 seconds!', p, 255, 255, 255, false ) With the ' he's finishing the string. Should be: outputChatBox ( "You'll die in 5 seconds!", p, 255, 255, 255, false ) Nop, it's right. I wrote " \' " but the Lua tags changed to a single " ' " ( it even has a different color ). It's just that if you copy the code it will appear as a single ' and not " \' ". Link to comment
Baseplate Posted September 24, 2012 Author Share Posted September 24, 2012 His code works as it's supposed, the only problem is in here: outputChatBox ( 'You'll die in 5 seconds!', p, 255, 255, 255, false ) With the ' he's finishing the string. Should be: outputChatBox ( "You'll die in 5 seconds!", p, 255, 255, 255, false ) Still bugged mate kills u right away and when I move i get killed, no debug errors Link to comment
Perfect Posted September 24, 2012 Share Posted September 24, 2012 His code works as it's supposed, the only problem is in here: outputChatBox ( 'You'll die in 5 seconds!', p, 255, 255, 255, false ) With the ' he's finishing the string. Should be: outputChatBox ( "You'll die in 5 seconds!", p, 255, 255, 255, false ) Still bugged mate kills u right away and when I move i get killed, no debug errors use setElementFrozen Link to comment
Baseplate Posted September 24, 2012 Author Share Posted September 24, 2012 That's to set an element frozen, I wanna make it kills u after 5 seconds. that's all lol Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 That's to set an element frozen, I wanna make it kills u after 5 seconds. that's all lol Actually, what is this code do? addCommandHandler('lol', function(p) setTimer(killPed, 5000, 1, p) outputChatBox("You'll die in 5 seconds!", p, 255, 255, 255, false) end ) Edit: if "freeroam" is running, this will cause for you problem because "freeroam" has command "kill" while this will cause to you die right away, and after 5 sec again you will die Link to comment
Baseplate Posted September 24, 2012 Author Share Posted September 24, 2012 Howdy crap! Freeroam was running lololol thanks mate Okay, now I want the player to be frozen when he do /kill and when he respawns he gets unfreezed but I have probs with the event handler, code addCommandHandler('kill', function(p) setTimer(killPed, 5000, 1, p) setElementFrozen (p, true) outputChatBox ( "You'll die in 5 seconds!", p, 255, 255, 255, false ) end ) function unfreeze (p) setElementFrozen (p, false) end addEventHandler ("onPlayerRespawn", p, unfreeze) Link to comment
Vision Posted September 24, 2012 Share Posted September 24, 2012 Change this addEventHandler ("onPlayerRespawn", p, unfreeze) to this addEventHandler ("onPlayerSpawn", root, unfreeze) Link to comment
Baseplate Posted September 24, 2012 Author Share Posted September 24, 2012 Okay thanks, but a question about root, does it freeze everyone or just the player? Link to comment
DiSaMe Posted September 24, 2012 Share Posted September 24, 2012 Usage of root makes the script unfreeze everyone who respawns. Link to comment
Baseplate Posted September 24, 2012 Author Share Posted September 24, 2012 Oh okay, thanks! EDIT: but when you use /kill does it freeze everyone Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 Change this (line 10) setElementFrozen (p, false) to setElementFrozen(source, false) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now