SA-MP Forums Archive
Command 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: Command Help (/showthread.php?tid=531192)



Command Help - XGreen - 11.08.2014

Hi, im using zcmd and i want to make this even on offline players:
PHP код:
CMD:ip(playeridparams[])
{
    if(
pInfo[playerid][pAdminLevel] >= 3)
    {
        new 
targetid,playerip[16],string[128];
        if(
sscanf(params"u"targetidplayerip)) return SendClientMessage(playerid,-1,""chat" /ip [playerid]");
        if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
        
GetPlayerIp(targetidplayeripsizeof(playerip));
        
format(stringsizeof(string), ""chat" IP of %s %s"PlayerName(targetid), playerip);
        
SendClientMessage(playerid, -1string);
    }
    else {
        
SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
    }
    return 
1;




Re: Command Help - SKAzini - 11.08.2014

You'll need to use MySQL or Y_INI to do that. If you're using MySQL, I can help you.


Re: Command Help - XGreen - 11.08.2014

Quote:
Originally Posted by SKAzini
Посмотреть сообщение
You'll need to use MySQL or Y_INI to do that. If you're using MySQL, I can help you.
i already got it


Re: Command Help - SKAzini - 11.08.2014

Save the player's IP on disconnect, then load it on /ip:

Код:
SELECT IP FROM accounts WHERE Name = '%s'
Get the result and put it in a 16 cell big string and you'll have the player's IP.