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
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