Jump to content

/kill script fail


toptional

Recommended Posts

Posted

Hey! This is a script, so when you do /kill it freezes you for 10 seconds and then u die in 10 seconds.

It's not working though :(

script

addCommandHandler('kill', 
    function(p) 
        setTimer(killPed, 20000, 1, p) 
        setElementFrozen (p, true) 
        toggleControl ( p, "fire", false ) 
    end 
end) 
  
addEventHandler ("onPlayerRespawn", root, unfreeze 
function unfreeze (p) 
    setElementFrozen (p, false) 
    toggleControl ( p, "fire", true ) 
end 
) 

Meta incase i failed on that :D

  "Robbster" type="script" version="0.1"/> 
  

Thanks , I get no Debug errors btw

Posted
addCommandHandler ( 'kill', 
    function ( p ) 
        setTimer ( killPed, 20000, 1, p ) 
        setElementFrozen ( p, true ) 
        toggleControl ( p, "fire", false ) 
    end 
) 
  
function unfreeze ( ) 
    setElementFrozen ( source, false ) 
    toggleControl ( source, "fire", true ) 
end 
addEventHandler ( "onPlayerSpawn", root, unfreeze ) 

Errors:

1: You have an extra 'end' in the command handler function.

2: The addEventHandler of 'unfreeze' is wrong positioned and has a missing parentheses.

3: You have a extra parentheses at the end of 'unfreeze' function.

4: There's no such event: 'onPlayerRespawn', you should use 'onPlayerSpawn'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
addCommandHandler( 'kill', 
    function( player ) 
        setTimer( killPed, 20000, 1, player ) 
        setElementFrozen( player, true ) 
        toggleControl ( player, "fire", false ) 
    end 
end) 
  
addEventHandler ( "onPlayerSpawn", root, 
    function( player ) 
        setElementFrozen ( player, false ) 
        toggleControl ( player, "fire", true ) 
    end 
) 

Posted
addCommandHandler( 'kill', 
    function( player ) 
        setTimer( killPed, 20000, 1, player ) 
        setElementFrozen( player, true ) 
        toggleControl ( player, "fire", false ) 
    end 
end) 
  
addEventHandler ( "onPlayerSpawn", root, 
    function( player ) 
        setElementFrozen ( player, false ) 
        toggleControl ( player, "fire", true ) 
    end 
) 

Parameters first in onPlayerSpawn is 'PosX' not 'player'

Your script is the already in post Solidsnake14.

╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗

║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║

║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║

║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║

╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝

«سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك»

M7mdAl7arthy : لتواصل سكايب

Posted
addCommandHandler( 'kill', 
    function( player ) 
        setTimer( killPed, 20000, 1, player ) 
        setElementFrozen( player, true ) 
        toggleControl ( player, "fire", false ) 
    end 
end) 
  
addEventHandler ( "onPlayerSpawn", root, 
    function( player ) 
        setElementFrozen ( player, false ) 
        toggleControl ( player, "fire", true ) 
    end 
) 

Parameters first in onPlayerSpawn is 'PosX' not 'player'

Your script is the already in post Solidsnake14.

Source

The source of this event is the player that just spawned.

And You Right :mrgreen:

Posted

For some reason it kills u in 2 seconds not 10 take a look

addCommandHandler ( 'kill', 
    function ( p ) 
        setTimer ( killPed, 100000, 1, p ) 
        setElementFrozen ( p, true ) 
        toggleControl ( p, "fire", false ) 
        outputChatBox ( "#FF0000You have been frozen will be killed in 10 seconds", getRootElement(), 255, 255, 255, true ) 
    end 
) 
  
function unfreeze ( ) 
    setElementFrozen ( source, false ) 
    toggleControl ( source, "fire", true ) 
end 
addEventHandler ( "onPlayerSpawn", root, unfreeze ) 

Posted

Do you have freeroam running? because that also has a "/kill" command.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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