29.07.2017, 18:27
Hello Every one i have problem here in this code when new player join and he is not from my gang or faction i got the login msg does any one can fix this?
PHP код:
if(PlayerInfo[playerid][pFaction] != 0)
{
format(string, sizeof(string), "*** %s from your faction has logged in.", GetPlayerNameEx(playerid));
for (new i = 0; i<MAX_PLAYERS;i++) //edited
{
if(i == playerid) continue;
if(PlayerInfo[playerid][pFaction] == PlayerInfo[i][pFaction])
{
SendClientMessage(i, COLOR_YELLOW, string);
}
}
}
if(PlayerInfo[playerid][pGang] != 225)
{
format(string, sizeof(string), "*** %s from your gang has logged in.", GetPlayerNameEx(playerid));
for (new j = 0; j<MAX_PLAYERS;j++) //edited
{
if(j == playerid) continue;
if(PlayerInfo[playerid][pGang] == PlayerInfo[j][pGang])
{
SendClientMessage(j, COLOR_YELLOW, string);
}
}
}