Adding a new stock
#4

As Vince said, you need to use definitions:

pawn Код:
#define LoopThroughParticipants() for(new i; i < MaxPariticipants; i++) if(PlayersAtMinigame[i] != -1)
The pre-processor will look for "LoopThroughParticipants()" and replace it with "for(new i; i < MaxPariticipants; i++) if(PlayersAtMinigame[i] != -1)"

So, you can do something like this:

pawn Код:
public OnPlayerConnect(playerid)
{
    LoopThroughParticipants()
    {
        //Do something
    }
}
And it will be interpreted as:

pawn Код:
public OnPlayerConnect(playerid)
{
    for(new i; i < MaxPariticipants; i++) if(PlayersAtMinigame[i] != -1)
    {
        //Do something
    }
}
https://sampforum.blast.hk/showthread.php?tid=166680
Reply


Messages In This Thread
Adding a new stock - by Libra_PL - 16.01.2012, 17:27
Re: Adding a new stock - by Vince - 16.01.2012, 18:37
Re: Adding a new stock - by MP2 - 16.01.2012, 18:38
Respuesta: Adding a new stock - by OPremium - 16.01.2012, 19:16

Forum Jump:


Users browsing this thread: 2 Guest(s)