PDA

View Full Version : SetPlayerAttachedObject with Timer


Black Axe
11/01/2012, 12:43 PM
is there anyway to make a Timer for SetPlayerAttachedObject then it Destroys ?

I Did this :

GameTextForPlayer(playerid, "~w~You have Bought a Pizza", 5000, 3);
SetPlayerAttachedObject( playerid, 0, 1582, 1, -0.064613, 0.520760, 0.000000, 0.000000, 84.217391, 0.000000, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,6000,1);


But the Attached Object don't get remove cause there is no timer for it - anyway...How to make a Timer for it ?

And also - How to make the Animation doesn't stop BUT in the same time the player can control his moves ?

Sascha
11/01/2012, 01:07 PM
for the object problem:
this below your current code:

SetTimerEx("MyRemoveFunc", X * 1000, false, "i", playerid); //replace X with the amount of seconds before the object should be removed


and this somewhere out of any callback

forward MyRemoveFunc(playerid);
public MyRemoveFunc(playerid)
{
RemovePlayerAttachedObject(playerid, 0);
return 1;
}

-CaRRoT
11/01/2012, 04:34 PM
Delete

Black Axe
11/01/2012, 04:36 PM
Mhmm , How to use it ? And thanks Sacha - i will try it