How it's made ?!
#4

Quote:
Originally Posted by Kindred
Посмотреть сообщение
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success) //If the password was correct
    {
        new originalname[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME]; //Creates the new variables
        GetPlayerName(playerid, originalname, sizeof(originalname)); //Gets current name
        format(string, sizeof(string), "(Admin)%s", originalname); //Adds (Admin) to the front of the name
        SetPlayerName(playerid, string); //Sets the name to the new name
    }
    return 1;
}
Untested, just an example.

Simply states that if the player attempts to log into rcon, and succeeds, it gets his current name and set's his name to (Admin), along with his originalname following it afterwards.
It don't works ...
Use GetPlayerIp
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success)
    {
        new VBIP[16];
        for(new v , b = GetMaxPlayers(); v != b; v++)
        {
            GetPlayerIp(v, VBIP, 16);
            if(!strcmp(VBIP, ip))
            {
                new VBName[MAX_PLAYER_NAME], VBNewname[MAX_PLAYER_NAME+7];
                GetPlayerName(v, VBName, MAX_PLAYER_NAME);
                format(VBNewname, sizeof(VBNewname), "(Admin)%s", VBName);
                SetPlayerName(v, VBNewname);
                break;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
How it's made ?! - by x96664 - 16.06.2012, 20:12
Re: How it's made ?! - by Kindred - 16.06.2012, 20:20
Re: How it's made ?! - by x96664 - 16.06.2012, 20:30
Re: How it's made ?! - by ViniBorn - 16.06.2012, 20:35
Re: How it's made ?! - by x96664 - 16.06.2012, 21:01
Re: How it's made ?! - by x96664 - 21.06.2012, 20:42
Re: How it's made ?! - by tyler12 - 21.06.2012, 20:52

Forum Jump:


Users browsing this thread: 2 Guest(s)