PDA

View Full Version : Help me out plz


kochtebene
29/07/2017, 06:27 PM
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?
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);
}
}
}

kochtebene
30/07/2017, 06:25 PM
No One ?

Shinja
30/07/2017, 06:33 PM
Or he is from your faction/gang (debug it to know), or you are sending the string somewhere else in the script
Try to debug you vars PlayerInfo[playerid][pFaction] and PlayerInfo[i][pFaction]