Quote:
Originally Posted by mamoru
Quote:
Originally Posted by Norn [BINMAN
]
Quote:
Originally Posted by Uniqueee
Quote:
Originally Posted by KDlivest954
wat is and how do i make a loop?
|
I don't know how your system works but I will show you how to make a loop.
Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerTeam[playerid] == Police)
{
SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
}
}
|
This code means that it will go through every player, MAX_PLAYERS being 500 the loop will run 500 times and as the loop increases so does the i integer.
The correct code would be.
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerTeam[i] == Police) // User is a cop. { SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA"); } } }
Don't mind the indentation it was done in notepad.
|
Good that you took most errors out, but SCM still has 'playerid' instead of 'i' 
|
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerTeam[i] == Police) // User is a cop.
{
SendClientMessage(i,0xFFFFFFAA,"BLA BLA BLA");
}
}
}
XD