I had A problem
#1

This Message is Bugged i tryed many times to fix but cannot when a player login i see the message even im not on his gang faction
This IS the edited code
PHP код:
            for(new 0GetPlayerPoolSize(); i++)
            {
                            if(
PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0)
                            {
                                new 
string[100];
                                
format(stringsizeof(string), "*** %s from your faction has logged in"GetPlayerNameEx(playerid));
                                
printf("%s from your faction has logged in",GetPlayerNameEx(playerid));
                                
SendClientMessage(iCOLOR_JUNIORADMINstring);
                            }
                            if(
PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != 0)
                            {
                                new 
string[100];
                                
format(stringsizeof(string), "*** %s from your gang has loggedin"GetPlayerNameEx(playerid));
                                
printf("%s from your gang has logged in",GetPlayerNameEx(playerid));
                                
SendClientMessage(iCOLOR_JUNIORADMINstring);
                            }
            } 
And This is the real one
PHP код:
            GetIPCountry(PlayerInfo[playerid][pIP], countrysizeof(country));
            foreach(
Playeri)
            {
                if(
PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != 0)
                {
                    
format(stringsizeof(string), "*** %s from your faction has logged in."GetPlayerNameEx(playerid));
                    
SendClientMessageEx(iCOLOR_JUNIORADMINstring);
                }
                if(
PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != 255)
                {
                    
format(stringsizeof(string), "*** %s from your gang has logged in."GetPlayerNameEx(playerid));
                    
SendClientMessageEx(iCOLOR_JUNIORADMINstring);
                }
                 if(
ipmessages[i])
                {
                    
gettime(hour,minute,second);
                    
format(stringsizeof(string), "[CONNECTIONS]{FFFF00} (%d:%d:%d) %s (IP:%s) from %s has logged in."hourminutesecondGetPlayerNameEx(playerid), PlayerInfo[playerid][pIP], country);
                    
SendClientMessageEx(iCOLOR_JUNIORADMINstring);
                }
            } 
Reply
#2

Not sure if this is gonna work, but try it.

PHP код:
for(new 0GetPlayerPoolSize(); i++) 
            { 
                            if(
PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != && PlayerInfo[playerid][pFaction] != 0
                            { 
                                new 
string[100]; 
                                
format(stringsizeof(string), "*** %s from your faction has logged in"GetPlayerNameEx(playerid)); 
                                
printf("%s from your faction has logged in",GetPlayerNameEx(playerid)); 
                                
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                            } 
                            if(
PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != && PlayerInfo[playerid][pGang] != 0
                            { 
                                new 
string[100]; 
                                
format(stringsizeof(string), "*** %s from your gang has loggedin"GetPlayerNameEx(playerid)); 
                                
printf("%s from your gang has logged in",GetPlayerNameEx(playerid)); 
                                
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                            } 

            } 
Reply
#3

Quote:
Originally Posted by Arbico
Посмотреть сообщение
Not sure if this is gonna work, but try it.

PHP код:
for(new 0GetPlayerPoolSize(); i++) 
            { 
                            if(
PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != && PlayerInfo[playerid][pFaction] != 0
                            { 
                                new 
string[100]; 
                                
format(stringsizeof(string), "*** %s from your faction has logged in"GetPlayerNameEx(playerid)); 
                                
printf("%s from your faction has logged in",GetPlayerNameEx(playerid)); 
                                
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                            } 
                            if(
PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != && PlayerInfo[playerid][pGang] != 0
                            { 
                                new 
string[100]; 
                                
format(stringsizeof(string), "*** %s from your gang has loggedin"GetPlayerNameEx(playerid)); 
                                
printf("%s from your gang has logged in",GetPlayerNameEx(playerid)); 
                                
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                            } 
            } 
I will Try It up
Reply
#4

Quote:
Originally Posted by Arbico
Посмотреть сообщение
Not sure if this is gonna work, but try it.

PHP код:
for(new 0GetPlayerPoolSize(); i++) 
            { 
                            if(
PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pFaction] != && PlayerInfo[playerid][pFaction] != 0
                            { 
                                new 
string[100]; 
                                
format(stringsizeof(string), "*** %s from your faction has logged in"GetPlayerNameEx(playerid)); 
                                
printf("%s from your faction has logged in",GetPlayerNameEx(playerid)); 
                                
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                            } 
                            if(
PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pGang] != && PlayerInfo[playerid][pGang] != 0
                            { 
                                new 
string[100]; 
                                
format(stringsizeof(string), "*** %s from your gang has loggedin"GetPlayerNameEx(playerid)); 
                                
printf("%s from your gang has logged in",GetPlayerNameEx(playerid)); 
                                
SendClientMessage(iCOLOR_JUNIORADMINstring); 
                            } 
            } 
Its Not working
Reply
#5

Mhm? Please .
Reply
#6

Try replacing
Код:
for(new i = 0; i < GetPlayerPoolSize(); i++)
with this
Код:
foreach(new i : Player)
update ur foreach if it doesnt work
Reply
#7

for(new i = 0; i < GetPlayerPoolSize(); i++) // wrong
for(new i = 0; i <= GetPlayerPoolSize(); i++) // correct (slower)
for(new i = GetPlayerPoolSize(); i != -1; i--) // correct (faster)

https://sampwiki.blast.hk/wiki/GetPlayerPoolSize
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)