Jump to content

setTimer prob


Baseplate

Recommended Posts

Posted
  
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

Posted
addCommandHandler('lol', 
    function(p) 
        setTimer(killPed, 5000, 1, p) 
        outputChatBox('You\'ll die in 5 seconds!', p, 255, 255, 255, false) 
    end 
) 

Posted

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 ) 

Posted
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 " \' ".

Posted
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 :S kills u right away and when I move i get killed, no debug errors

Posted
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 :S kills u right away and when I move i get killed, no debug errors

use

setElementFrozen 

Posted
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 :lol:

Posted

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) 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...