I need a little Information
#1

I want to know if this creates something for each player, like if i want only players in a race to see the checkpoints.

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
Reply
#2

Then save players in a race to PVar.

pawn Код:
//When player joins race
SetPVarInt(playerid, "InRace", 1);

//When player leaves race
SetPVarInt(playerid, "InRace", 0);

//In-race players loop
for(new i, mp = GetMaxPlayers(); i < mp; i++)
{
    if(IsPlayerConnected(i) && GetPVarInt(i, "InRace") == 1)
    {
        //some code
    }
}
Reply
#3

So if the player is in the race, only they will see the checkpoint.
Reply
#4

Yes zack, that will only show the checkpoint to the players having the PVarInt "InRace" set to 1
Reply
#5

Using a PVar would work, but I don't recommend using a PVar for races - they're slower and inefficient. Just use a variable..
Reply
#6

Well i am using the streamer by Ingocnito, and it creates the checkpoints on a dialog. How to use the variable there?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)