SA-MP Forums Archive
Small help - 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: Small help (/showthread.php?tid=333935)



Small help - Face9000 - 13.04.2012

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
        new pip[16];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            new nameee[MAX_PLAYER_NAME];
            GetPlayerName(i, nameee, 16);
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            {
                printf("Failed RCON Login attempt by %s. ID: %i IP: %s - Password: %s", nameee,ip, password);
                RconLog(printf);
            }
        }
    }
    else
    {
        new str[170];
        new nameee[MAX_PLAYER_NAME];
        GetPlayerName(playerid, nameee, 16);
        format(str,sizeof str,"2%s is logged in RCON with Password: %s - IP %s logged into rcon.",nameee,password,ip);
        RconLog(str);
    }
    return 1;
}
error 076: syntax error in the expression, or invalid function call
error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Line 1732
pawn Код:
RconLog(printf);
Line 1740
pawn Код:
GetPlayerName(playerid, nameee, 16);



Re: Small help - [HiC]TheKiller - 13.04.2012

First Error: printf is a function, it will just give errors if you try use it as a variable.
Second Error: There is no playerid in OnRconLoginAttempt. Loop through all the players using GetPlayerIP to find the player.


Re: Small help - rVar - 13.04.2012

[EDIT]
Ohh..to late..


Re: Small help - Face9000 - 13.04.2012

Ah nvm,fixed.