SetTimerEx Possible to send checkpoint id
#1

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
Reply
#2

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?
Reply
#3

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

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;
}
Reply
#5

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

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? ?
Reply
#7

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
Reply
#8

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)