SA-MP Forums Archive
SetTimerEx Possible to send checkpoint id - 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 Possible to send checkpoint id (/showthread.php?tid=548776)



SetTimerEx Possible to send checkpoint id - Steve Habbz - 02.12.2014

Hello friends !
Does the SetTimerEx function let me to send a variables ? Such as a checkpoint id ?
I Hope you can help me with this question


Re: SetTimerEx Possible to send checkpoint id - UltraScripter - 02.12.2014

you mean
pawn Код:
SetTimerEx("Test", 1000, false, "i", playerid);
pawn Код:
forward Test(playerid);

public forward(playerid)
{
     SetPlayerCheckpoint(playerid, x, y, z, size);
     return 1;
}
something like that?


Re: SetTimerEx Possible to send checkpoint id - UltraScripter - 02.12.2014

oops i meant
pawn Код:
public Test(playerid)



Re: SetTimerEx Possible to send checkpoint id - Steve Habbz - 02.12.2014

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
you mean
pawn Код:
SetTimerEx("Test", 1000, false, "i", playerid);
pawn Код:
forward Test(playerid);

public forward(playerid)
{
     SetPlayerCheckpoint(playerid, x, y, z, size);
     return 1;
}
something like that?
Nope,
pawn Код:
SetTimerEx("Test", 1000, false, "i", CP_TEST);
pawn Код:
forward Test(cpid);

public forward(cpid)
{
     if(cpid == CP_TEST)
     // let me do other stuff here.
     return 1;
}



Re: SetTimerEx Possible to send checkpoint id - UltraScripter - 02.12.2014

hmm i dont know never tried
u should try and see if it works


Re: SetTimerEx Possible to send checkpoint id - Steve Habbz - 02.12.2014

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
hmm i dont know never tried
u should try and see if it works
Can you tell me the correct Format Syntax for Checkpoint variables? ?


Re: SetTimerEx Possible to send checkpoint id - UltraScripter - 02.12.2014

pawn Код:
new CP_TEST[MAX_PLAYERS]; //so you cant add more
and

pawn Код:
if(CP_TEST[playerid] == 1)
{

}
if(CP_TEST[playerid] == 2)
{

}
//and more if you want to add more



Re: SetTimerEx Possible to send checkpoint id - UltraScripter - 02.12.2014

pawn Код:
public Test(playerid) // if you want to add more so do this public Test(playerid, more, more, more)



Re: SetTimerEx Possible to send checkpoint id - Lordzy - 02.12.2014

It is possible to send multiple parameters using SetTimerEx. Checkpoint ID can be specified as a parameter while setting a timer, also it's data type should be filled on specifier.

pawn Код:
SetTimerEx("cptimer", 1000, false, "ii", playerid, cpid);

forward cptimer(playerid, cpid);
public cptimer(playerid, cpid)
{
    //cpid can be used as the checkpoint ID
    return 1;
}
You can also pass other data types, you can have a look at : https://sampwiki.blast.hk/wiki/SetTimerEx