Jump to content

Timer?


AJXB

Recommended Posts

Main function and a sub function works on timer, what's the problem?

  
  
function test () 
    local curAcc = getPlayerAccount(source) 
    setAccountData(curAcc,"Test",true) 
    setTimer ( 
    function () 
    spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) 
    setElementHealth (source,100) 
    end,7500,1) 
end 
  

Bad argument for spawnPlayer and setElementHealth, expected element

Link to comment
function test () 
    local curAcc = getPlayerAccount(source) 
    setAccountData(curAcc,"Test",true) 
    setTimer ( 
    function (player) 
    spawnPlayer(player,1186, -1323, 14 + 0.5,0,skin) 
    setElementHealth (player,100) 
    end,7500,1, source) 
end 

Link to comment
Main function and a sub function works on timer, what's the problem?
  
  
function test () 
    local curAcc = getPlayerAccount(source) 
    setAccountData(curAcc,"Test",true) 
    setTimer ( 
    function () 
    spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) 
    setElementHealth (source,100) 
    end,7500,1) 
end 
  

Bad argument for spawnPlayer and setElementHealth, expected element

You're calling this function via what? 'Event - Command - Handler?'

Link to comment
Main function and a sub function works on timer, what's the problem?
  
  
function test () 
    local curAcc = getPlayerAccount(source) 
    setAccountData(curAcc,"Test",true) 
    setTimer ( 
    function () 
    spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) 
    setElementHealth (source,100) 
    end,7500,1) 
end 
  

Bad argument for spawnPlayer and setElementHealth, expected element

You're calling this function via what? 'Event - Command - Handler?'

addEventHandler("onPlayerWasted",root,test)

Link to comment
function test (     ) 
    local curAcc = getPlayerAccount(source) 
    if isGuestAccount ( curAcc ) then return false end 
    setAccountData(curAcc,"Test",true) 
    setTimer ( 
        function (  source  ) 
            spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) 
            setElementHealth (source,100) 
    end,7500,1,source) 
end 
  

P.S : Is skin defined in the spawnPlayer func?

Link to comment
function test (     ) 
    local curAcc = getPlayerAccount(source) 
    if isGuestAccount ( curAcc ) then return false end 
    setAccountData(curAcc,"Test",true) 
    setTimer ( 
        function (  source  ) 
            spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) 
            setElementHealth (source,100) 
    end,7500,1,source) 
end 
  

P.S : Is skin defined in the spawnPlayer func?

Yeah it its, thanks!

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