Jump to content

setTimer prob


Baseplate

Recommended Posts

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
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

Link to comment
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 

Link to comment
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:

Link to comment

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

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...