Jump to content

Ayuda | Customblips crear y eliminar setTimer


Recommended Posts

Posted

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

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

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

33lypu1.png

Posted (edited)
  
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

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

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

9pJCpYX.png
Posted
  
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.

Inactivo.

Posted

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

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

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) 
  

Inactivo.

  • Recently Browsing   0 members

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