Checkpoint for all players
#1

How can I set a checkpoint for everyone instead of just one player?
Reply
#2

pawn Код:
SetCheckpointForAll(...)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) SetPlayerCheckpoint(...);
    }
}
put the parameters instead of ...
Reply
#3

pawn Код:
SetCheckpointForAll(Float:x, Float:y, Float:z, Float:size)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
         {
              SetPlayerCheckpoint(i , Float:x,  Float:y, Float:z, Float:size);
         }
    }
}
edited [GF]Sasino97 pawn ^^

edit: use streamer to use Dynamic Checkpoint
Reply
#4

SetCheckpointForAll not defined.

Please help.
Reply
#5

In fact that was the definition....

The code we gave has to be put outside any function because it is one.
Then use it when you need
Reply
#6

You put that in your Gm and than you use in your code where you need to create checkpoint forall

pawn Код:
SetCheckpointForAll(Float:x, Float:y, Float:z, Float:size)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
         {
              SetPlayerCheckpoint(i , Float:x,  Float:y, Float:z, Float:size);
         }
    }
}
In your code you put SetCheckpointForAll(pos x, pos y, pos z, size of checkpoint)

Example:
CMD:race(playerid, params[])
{
SetCheckpointForAll(284.34, 1322.32, 472.90, 3.0);
return 1;
}
Reply
#7

Thanks!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)