SA-MP Forums Archive
geo ip - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: geo ip (/showthread.php?tid=209386)



geo ip - xir - 10.01.2011

i get some errors after i tried to modify the geo ip filterscript, as i didnt want the ping..

but i need help, this is my on player connect

pawn Код:
public OnPlayerConnect(playerid)
{
    AdminColor1[playerid] = 0;
    PLVL[playerid] = 0;
    AdminLogTries[playerid] = 0;
    g_GotInvitedToDuel[playerid] = 0;
    g_HasInvitedToDuel[playerid] = 0;
    g_IsPlayerDueling[playerid]  = 0;
    gPlayerLogged[playerid] = 0;
    Muted[playerid] = 0;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    new string1[64];
    GetPlayerName(playerid, name, sizeof(name));
    new Country[256];
    GetPlayerCountry(playerid,Country);
    new mess[256],IP[256];
    GetPlayerIp(playerid,IP,sizeof(IP));
    format(mess,sizeof(mess),"%s [ IP: %s. Country: %s] has joined the server",GetPName(playerid), IP,Country(playerid));
    MessageToAdmin(Grey, string1);
    if (!dini_Exists(file))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register your account", "Enter a password", "Register", "Quit");
    }
    if(fexist(file))
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login to your account", "Enter your password", "Login", "Quit");
    }
    return 1;
}
errors ;

pawn Код:
E:\GTA San Andreas\Server\gamemodes\DMWorld.pwn(212) : error 012: invalid function call, not a valid address
E:\GTA San Andreas\Server\gamemodes\DMWorld.pwn(212) : warning 215: expression has no effect
E:\GTA San Andreas\Server\gamemodes\DMWorld.pwn(212) : error 001: expected token: ";", but found ")"
E:\GTA San Andreas\Server\gamemodes\DMWorld.pwn(212) : error 029: invalid expression, assumed zero
E:\GTA San Andreas\Server\gamemodes\DMWorld.pwn(212) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
this line
pawn Код:
format(mess,sizeof(mess),"%s [ IP: %s. Country: %s] has joined the server",GetPName(playerid), IP,Country(playerid));



Re: geo ip - xir - 10.01.2011

anyone ?


Re: geo ip - Mr.Stranger - 10.01.2011

try this

pawn Код:
format(mess,sizeof(mess),"%s has joined the CRIME LIFE ROLEPLAY.  [ Country: %s | IP Address: %s | Ping: %i ]",GetPName(playerid),Country,IP,GetPlayerPing(playerid));



Re: geo ip - xir - 10.01.2011

im sorry, maybe i wasnt clear enough, i mean i dont want ping, only country , ip


Re: geo ip - Jochemd - 10.01.2011

Country(playerid) -> GetPlayerCountryName(playerid)


Re: geo ip - xir - 10.01.2011

error 017: undefined symbol "GetPlayerCountryName" ?


Re: geo ip - Jochemd - 10.01.2011

Corrected:

pawn Код:
new Country[50],IP[20];
GetPlayerCountry(playerid,Country);
GetPlayerIp(playerid,IP,sizeof(IP));
new mess[128];
format(mess,sizeof(mess),"%s has joined the CRIME LIFE ROLEPLAY.  [ Country: %s | IP Address:%s]",GetPName(playerid),Country,IP);
Dont use these high string values btw.