SA-MP Forums Archive
I need a little Information - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need a little Information (/showthread.php?tid=189936)



I need a little Information - zack3021 - 13.11.2010

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



Re: I need a little Information - rs.pect - 13.11.2010

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



Re: I need a little Information - zack3021 - 13.11.2010

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


Re: I need a little Information - pater - 13.11.2010

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


Re: I need a little Information - Scenario - 13.11.2010

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


Re: I need a little Information - zack3021 - 13.11.2010

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