Help me out plz - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me out plz (
/showthread.php?tid=638297)
Help me out plz -
kochtebene - 29.07.2017
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);
}
}
}
Re: Help me out plz -
kochtebene - 30.07.2017
No One ?
Re: Help me out plz -
Shinja - 30.07.2017
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]