Jump to content

Problem with getTimerDetails


Destroyer.-

Recommended Posts

Hi, first sorry for my bad English in those days was making a Police system, but I found a problem, I want the prisoners to keep them switched off time, but I did not work for me, where could be the error ?

  
function player_Wasted ( ammo, attacker, weapon, bodypart ) 
 if attacker and getElementType(attacker) == "player" then 
local arrestado = getElementData(source, "arrestado") or 0 
local level = getPlayerWantedLevel(source) 
local acc = getPlayerAccount(source) 
  
      if skins[getElementModel(attacker)] and level > 0  then 
    setElementData(source,"arrestado", arrestado+1) 
  
                setTimer (fadeCamera, 2000, 1, source, false) 
                setTimer (setCameraTarget, 4000, 1, source, source) 
                setTimer (fadeCamera, 6000, 1, source, true) 
                setTimer (spawnPlayer, 6000, 1,  source, 4076.3999023438, -1788.5, 3.511967, 0, getElementModel (source), 0, 0, getPlayerTeam(source)) 
  
                outputChatBox ( "Fuiste Arrestado Por "..getPlayerName ( attacker ).." por 20 segundos.", source,255,0,0 ) 
                givePlayerMoney (attacker, 4000)  
                outputChatBox ( "Arrestaste a "..getPlayerName(source), attacker,255,255,0 ) 
             theTimer = setTimer ( function(player) 
  
             setElementPosition(player,1544.4332275391, -1674.7698974609, 13.688399200439) 
        
        end, 20000, 1 ) 
         
                end 
            end 
        end 
addEventHandler ("onPlayerWasted", getRootElement(), player_Wasted) 
  
function quitPlayer (  ) 
local acc = getPlayerAccount(source) 
  if ( acc ) and not isGuestAccount ( acc ) then -- if the player is logged in 
if isTimer(theTimer) then 
local tiemporegistro = getTimersDetails(theTimer) 
setAccountData(acc,"timejailxD",tiemporegistro) 
setAccountData(acc,"arresto",1) 
killTimer(theTimer) 
end 
end 
end 
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer ) 
  
function loginPlayer (_,acc ) 
local acc = getPlayerAccount(source) 
 if ( acc ) then 
local tiempo = getAccountData(acc,"timejailxD") 
local arresto = getAccountData(acc,"arresto") 
  
if arresto == 1 then 
 setTimer ( setElementPosition, tiempo, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439)      
end 
end 
end 
addEventHandler ( "onPlayerLogin", getRootElement(), loginPlayer ) 
  
  
  

Thanks :roll:

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