SetPlayerAttachedObject with Timer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetPlayerAttachedObject with Timer (
/showthread.php?tid=310245)
SetPlayerAttachedObject with Timer -
Black Axe - 11.01.2012
is there anyway to make a Timer for SetPlayerAttachedObject then it Destroys ?
I Did this :
PHP код:
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 ?
Re: SetPlayerAttachedObject with Timer -
Sascha - 11.01.2012
for the object problem:
this below your current code:
pawn Код:
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
pawn Код:
forward MyRemoveFunc(playerid);
public MyRemoveFunc(playerid)
{
RemovePlayerAttachedObject(playerid, 0);
return 1;
}
Re: SetPlayerAttachedObject with Timer -
-CaRRoT - 11.01.2012
Delete
Re: SetPlayerAttachedObject with Timer -
Black Axe - 11.01.2012
Mhmm , How to use it ? And thanks Sacha - i will try it