16.01.2012, 19:16
As Vince said, you need to use definitions:
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:
And it will be interpreted as:
https://sampforum.blast.hk/showthread.php?tid=166680
pawn Код:
#define LoopThroughParticipants() for(new i; i < MaxPariticipants; i++) if(PlayersAtMinigame[i] != -1)
So, you can do something like this:
pawn Код:
public OnPlayerConnect(playerid)
{
LoopThroughParticipants()
{
//Do something
}
}
pawn Код:
public OnPlayerConnect(playerid)
{
for(new i; i < MaxPariticipants; i++) if(PlayersAtMinigame[i] != -1)
{
//Do something
}
}