Jump to content

Ayuda | Customblips crear y eliminar setTimer


Narutimmy

Recommended Posts

Hola e_e vengo de nuez... quiero hacer un script que cuando muer se cree un customblip ahi todo bien....

pero quiero que al pasar nose 30segs se elimine mi blip.... la idea es que cada jugador al morir se cree uno.. y asi

addEventHandler( "onClientPlayerWasted", root, 
function ()     
local x,y,z = getElementPosition (localPlayer) 
Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath.png" ) 
  
setTimer ( exports.customblips:destroyCustomBlip(Death), 30000, 1) 
  
  
end) 

EDIT:

addEventHandler( "onClientPlayerWasted", root, 
function ()     
local x,y,z = getElementPosition (localPlayer) 
Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath.png" ) 
  
setTimer ( function (Death) exports.customblips:destroyCustomBlip(Death) end, 30000, 1) 
  
  
  
  
  
  
  
  
end) 

qjSWQjW.png

lo tengo asi pero me da error :/

Link to comment
  
addEventHandler( "onClientPlayerWasted", root, 
function ()     
local x,y,z = getElementPosition (localPlayer) 
Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) 
  
setTimer ( function () 
 exports.customblips:destroyCustomBlip(Death) 
 end, 30000, 1) 
end) 
  

Link to comment
  
addEventHandler( "onClientPlayerWasted", root, 
function ()     
local x,y,z = getElementPosition (localPlayer) 
Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) 
  
setTimer ( function () 
 exports.customblips:destroyCustomBlip(Death) 
 end, 30000, 1) 
end) 
  

Ya se elimina pero solo el primero :S

local counterddd = 0 
local Death = {} 
local TiempoPr1 = 0 
addEventHandler( "onClientPlayerWasted", root, 
function ()    
if ( getTickCount ( ) - TiempoPr1 >= 5000 ) then  
counterddd = counterddd + 1 
local x,y,z = getElementPosition (localPlayer) 
Death[counterddd] = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath2.png" ) 
 TiempoPr1 = getTickCount ( ) 
setTimer ( function () 
 if Death[counterddd] then 
 exports.customblips:destroyCustomBlip(Death[counterddd]) 
 end end, 60000*5, 1) 
end 
end) 

La idea es que alse cree uno y a los 30 seg que se creo ese se elimine ese mismo.. pero si se crea otro pase lo mismo mas no se borren los 2 a la vez.

Edited by Guest
Link to comment
  
addEventHandler( "onClientPlayerWasted", root, 
function ()     
local x,y,z = getElementPosition (localPlayer) 
Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) 
  
setTimer ( function () 
 exports.customblips:destroyCustomBlip(Death) 
 end, 30000, 0) 
end) 
  

Link to comment
  
addEventHandler( "onClientPlayerWasted", root, 
function ()     
local x,y,z = getElementPosition (localPlayer) 
Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) 
  
setTimer ( function () 
 exports.customblips:destroyCustomBlip(Death) 
 end, 30000, 0) 
end) 
  

En timer seria 1 y no 0 por que puede que el blip se destruya pero el tiempo se repetira y regresara false.

Link to comment

y como ago funvcionar esto e_e?

local counterddd = 0 
local Death = {} 
local TiempoPr1 = 0 
addEventHandler( "onClientPlayerWasted", root, 
function ()   
if ( getTickCount ( ) - TiempoPr1 >= 5000 ) then 
counterddd = counterddd + 1 
local x,y,z = getElementPosition (localPlayer) 
Death[counterddd] = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath2.png" ) 
 TiempoPr1 = getTickCount ( ) 
setTimer ( function () 
 if Death[counterddd] then 
 exports.customblips:destroyCustomBlip(Death[counterddd]) 
 end end, 60000*5, 1) 
end 
end) 

solo se elimina 1...

Link to comment

No tested.

  
dataBlip = {} 
blips = {} 
tick = {} 
  
addEventHandler("onClientPlayerWasted", root, 
function() 
       local x,y,z = getElementPosition(localPlayer) 
       table.insert( dataBlip, {x,y} ) 
       for index, value in pairs(dataBlip) do 
             blips[index] = exports.customblips:createCustomBlip ( value[1], value[2], 10, 10, "suddenDeath2.png" ) 
              tick[index] = setTimer( function() 
                     exports.customblips:destroyCustomBlip(blips[index]) 
                     table.remove( dataBlip, 1 ) 
              end, 30000, 1 ) 
       end 
end) 
  

Link to comment
  • Recently Browsing   0 members

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