SA-MP Forums Archive
SetTimerEx Calling functions! [Rep+] - 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: SetTimerEx Calling functions! [Rep+] (/showthread.php?tid=322620)



SetTimerEx Calling functions! [Rep+] - Ballu Miaa - 03.03.2012

Hello everyone,

I made this callback to be used when the player uses the cmd /nb [PlayerID]. This works properly.

pawn Код:
forward Nb(playerid,giveplayerid);
public Nb(playerid,giveplayerid)
{
    new Float:Pos[3];
    GetPlayerPos(giveplayerid,Pos[0],Pos[1],Pos[2]);
    DestroyObject(Plane);

    Plane = CreateObject(1683,Pos[0],Pos[1],Pos[2]+50,0.000,270.000,270.0000); //Jumbo plane
    MoveObject(Plane, Pos[0],Pos[1],Pos[2]-50, 100.0);
    //SetObjectRot(Plane, 0.0,270.0,270.0);
}
I want to set SetTimerEx to call back this function in a time delay of 10 seconds. But how can i pass the values of the argument's/parameters used in the callback? Like it is playerid & giveplayerid over here!

Any suggestions how can i do it? Will rep everyone who will help


Re: SetTimerEx Calling functions! [Rep+] - 2KY - 03.03.2012

pawn Код:
SetTimerEx("Nb", 1000*10, false, "ii", playerid, giveplayerid);
Something like this, I figure.


Re: SetTimerEx Calling functions! [Rep+] - Ballu Miaa - 03.03.2012

Quote:
Originally Posted by 2KY
Посмотреть сообщение
pawn Код:
SetTimerEx("Nb", 1000*10, false, "ii", playerid, giveplayerid);
Something like this, I figure.
OMFG 2KY you're fucking awesome bro. Thanks. I never though that last parameters of SetTimerEx works like this. (Repped)

Problem Solved!