CHECKPOINT
#1

i want to make a checkpont which show to all players
i have no idea
please tell me something
to help me !
Reply
#2

pawn Код:
for(new i=0; i<GetMaxPlayers(); i++)
{
  if(IsPlayerConnected(i))
  {
    SetPlayerCheckpoint(i, yourcoords and range);
  }
}
Reply
#3

well basically this function makes it possible to dislpay actual cp's also to players that have connected after the specific cp has been set.
(so u dont need everything from this function but u can also use it)

pawn Код:
stock SetCheckpointForAll(id, Float:cx, Float:cy, Float:cz, Float:csize)
{
    if(id > -1)
    {
        if(CP_ID != -1)
            DisableCheckpointForAll();
        for(new i; i != MAX_PLAYERS; i++)
            if(SetPlayerCheckpoint(i, cx, cy, cz, csize))
               CheckPoint[i] = id;
        CP_Data[3] = csize;
        CP_Data[0] = cx;
        CP_Data[1] = cy;
        CP_Data[2] = cz;
        CP_ID = id;
        return true;
    }
    return false;
}
To show a cp to all players just use a loop.
Put it into a stock function like in this example.
Then u can simply use only this single line to show a cp to all players connected:
pawn Код:
SetCheckpointForAll(id, Float:cx, Float:cy, Float:cz, Float:csize);
to make the previous stock easier u can simply:

pawn Код:
stock SetCheckpointForAll(id, Float:cx, Float:cy, Float:cz, Float:csize)
{
    for(new i; i != MAX_PLAYERS; i++)SetPlayerCheckpoint(i, cx, cy, cz, csize))//foreach loop recommended!
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)