Jump to content

Ayuda - Timer


Matty

Recommended Posts

Posted

Buenas gente.... Como hago para que la funcion 'DownA' se ejecute pasado los 5 segundos de haber tocado el marker?:

Code:

function DownA (hitPlayer) 
 if (hitPlayer) then 
moveObject (sense, 6000, posX, posY, posZ) 
end 
end 
-- setTimer (DownA, 5000, 1) ¿? 
addEventHandler("onMarkerHit",sensem , DownA) 

mattybanner.jpg

...Learning Scripting...

State: Rookie, Noob

[AP3]=Matty!=

My Skype: mattias.netz

Posted
function DownA ( hitPlayer ) 
    if ( hitPlayer ) then 
        setTimer ( moveObject, 5000, 1, sense, 6000, posX, posY, posZ ) 
    end 
end 
addEventHandler ( "onMarkerHit", sensem, DownA ) 

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

Porque no me funca el attach :??

attachElements (sense, tower, Xoffset, Yoffset, Zoffset) 
  
function DownA (hitPlayer) 
 if (hitPlayer) then 
setTimer (moveObject, 5000, 1, sense, 6000, posX, posY, posZ) 
end 
end 
addEventHandler("onMarkerHit",sensem , DownA) 

mattybanner.jpg

...Learning Scripting...

State: Rookie, Noob

[AP3]=Matty!=

My Skype: mattias.netz

Posted
attachElements (sense, tower) 
  
function DownA (hitPlayer) 
 if (hitPlayer) then 
setTimer (moveObject, 5000, 1, sense, 6000, posX, posY, posZ) 
end 
end 
addEventHandler("onMarkerHit",sensem , DownA) 

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted
attachElements (sense, tower) 
  
function DownA (hitPlayer) 
 if (hitPlayer) then 
setTimer (moveObject, 5000, 1, sense, 6000, posX, posY, posZ) 
end 
end 
addEventHandler("onMarkerHit",sensem , DownA) 

Hay me sacas la posicion del objeto a attachar....

mattybanner.jpg

...Learning Scripting...

State: Rookie, Noob

[AP3]=Matty!=

My Skype: mattias.netz

Posted

donde esta definido Xoffset, Yoffset, Zoffset?

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
donde esta definido Xoffset, Yoffset, Zoffset?

no esta definido, lo puse para no poner las cordenadas. Pero son 0, 0, -20

mattybanner.jpg

...Learning Scripting...

State: Rookie, Noob

[AP3]=Matty!=

My Skype: mattias.netz

Posted

no puedes poner esas variables porq si man. debes asignarles algo

o bien haces algo como esto

Xoffset, Yoffset, Zoffset = 0, 0, -20 

o bien

attachElements (sense, tower, 0, 0, -20) 

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
no puedes poner esas variables porq si man. debes asignarles algo

o bien haces algo como esto

Xoffset, Yoffset, Zoffset = 0, 0, -20 

o bien

attachElements (sense, tower, 0, 0, -20) 

no me entendiste... las cordenadas las tiene como dijiste abajo... yo no las puse por pereza... pero las tiene.

Lo que sucede con este script es que el objeto 'sense' desaparece cuando lo attacheo al 'tower', lo que intento hacer es tipo un ascensor con un soporte debajo, aca el script entero...

Code:

sense = createObject (3095, 1230.75390625, -1371.4833984375, 12.358417510986, 0, 179.99450683594, 0) 
sensem = createMarker ( 1231, -1372, 12,'cylinder', 5, 255, 0, 0, 50) 
tower = createObject (1383, 1231.1182861328, -1371.6260986328, -20.317403793335) 
attachElements (sense, tower, 0, 0, -20) 
  
function DownA (hitPlayer) 
 if (hitPlayer) then 
setTimer (moveObject, 5000, 1, sense, 6000, 1230.75390625, -1371.4833984375, -31.61595916748) 
end 
end 
addEventHandler("onMarkerHit",sensem , DownA) 

mattybanner.jpg

...Learning Scripting...

State: Rookie, Noob

[AP3]=Matty!=

My Skype: mattias.netz

Posted

No podes usar moveObject con un objeto pegado a otro.

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

tendrias ke aser otro moveObject para tower, asi se mueve al mismo tiempo que sense

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

Okey... y se puede mover un objeto pegado a un marker??

mattybanner.jpg

...Learning Scripting...

State: Rookie, Noob

[AP3]=Matty!=

My Skype: mattias.netz

Posted

No se puede mover un objeto cuando esta pegado a otro elemento.

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.

  • Recently Browsing   0 members

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