HELP!
#6

Quote:
Originally Posted by Eoussama
Посмотреть сообщение
playerid isn't defined in OnRconLoginAttempt
This is the standard way for getting the player's name:
PHP код:
public OnRconLoginAttempt(ip[], password[], success

       if(
success
    {
        new 
IP[32], name[MAX_PLAYER_NAME], string[128];
        for(new 
ij=GetPlayerPoolSize(); i<ji++)
        {
            
GetPlayerIp(iIPsizeof(IP));
            if(!
strcmp(ipIPfalse))
            {
                
GetPlayerName(inamesizeof(name));
                
format(stringsizeof(string), "{FF6600}%s {FFFFFF} has logged in as RCON Administrator"name); 
                break;
            }
        }       
    } 

If you're using foreach, it can be done like so:
PHP код:
public OnRconLoginAttempt(ip[], password[], success

       if(
success
    {
        new 
IP[32], name[MAX_PLAYER_NAME], string[128];
        foreach(new 
Player)
        {
            
GetPlayerIp(iIPsizeof(IP));
            if(!
strcmp(ipIPfalse))
            {
                
GetPlayerName(inamesizeof(name));
                
format(stringsizeof(string), "{FF6600}%s {FFFFFF} has logged in as RCON Administrator"name); 
                break;
            }
        }       
    } 

it got compiled but not working ig
Reply


Messages In This Thread
HELP! - by DeStRoY232 - 19.09.2017, 13:37
Re: HELP! - by StrikerZ - 19.09.2017, 13:37
Re: HELP! - by DeStRoY232 - 19.09.2017, 13:39
Re: HELP! - by Eoussama - 19.09.2017, 13:41
Re: HELP! - by StrikerZ - 19.09.2017, 13:41
Re: HELP! - by DeStRoY232 - 19.09.2017, 13:44
Re: HELP! - by StrikerZ - 19.09.2017, 13:45
Re: HELP! - by DeStRoY232 - 19.09.2017, 13:46

Forum Jump:


Users browsing this thread: 2 Guest(s)