SA-MP Forums Archive
Help Me out - 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 (/showthread.php?tid=640476)



Help Me out - kochtebene - 03.09.2017

This dialog is bugged when i login i see the message but i wont see it just the other players on the family
PHP код:
            foreach(Playeri)
            {
                if(
PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0)
                {
                    
format(stringsizeof(string), "*** %s from your faction has loggedin"GetPlayerNameEx(playerid));
                    
SendClientMessage(iCOLOR_JUNIORADMINstring);
                }
                if(
PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != 255)
                {
                    
format(stringsizeof(string), "*** %s from your gang has loggedin"GetPlayerNameEx(playerid));
                    
SendClientMessage(iCOLOR_JUNIORADMINstring);
                }
                
            } 



Re: Help Me out - Arbico - 03.09.2017

Man, Told you, don't edit anything leave the code as i gave you
PHP код:
for(new 0GetPlayerPoolSize(); i++)

                if(
PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0
                { 
                    new 
Name[MAX_PLAYER_NAME], string[100];
                    
GetPlayerName(playeridNamesizeof(Name));
                    
format(stringsizeof(string), "*** %s from your faction has logged in"Name); 
                    
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                } 
                if(
PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != 0
                { 
                    new 
Name[MAX_PLAYER_NAME], string[100];
                    
GetPlayerName(playeridNamesizeof(Name));
                    
format(stringsizeof(string), "*** %s from your gang has loggedin"Name); 
                    
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                } 
                 




Re: Help Me out - Kane - 03.09.2017

Your code isn't an improvement, Arbico.

OP:

Debug it. print() what needs to be called and check the server_logs after to see if it works.


Re: Help Me out - Arbico - 03.09.2017

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Your code isn't an improvement, Arbico.

OP:

Debug it. print() what needs to be called and check the server_logs after to see if it works.
Check the if statement, Changed a number, that could be the problem
Plus some foreach includes are different. there are different versions that the way we use it is changed, So that could be the problem too.


Re: Help Me out - kAn3 - 03.09.2017

Free suggestion, in the PlayerInfo enum put this "PlayerName[24]".
Under OnPlayerConnect do:
Код:
GetPlayerName(playerid, PlayerInfo[playerid][PlayerName], 24);
So no need to get a player name 2000 times, until in your server a player can change his name of course.
Код:
            foreach(Player, i)
            {
                if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0)
                {
                    format(string, sizeof(string), "*** %s from your faction has loggedin", PlayerInfo[playerid][PlayerName]);
                    SendClientMessage(i, COLOR_JUNIORADMIN, string);
                }
                if(PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != 255)
                {
                    format(string, sizeof(string), "*** %s from your gang has loggedin", PlayerInfo[playerid][PlayerName]);
                    SendClientMessage(i, COLOR_JUNIORADMIN, string);
                }
                
            }