Offline Command
#5

Quote:
Originally Posted by colonel-top
Посмотреть сообщение
Why get IP ? its worse
Player IP can change everytime they leave or connect I prefer to load User Data Better its more worth
try this ( this is example idea )
PHP код:
#define MAX_PLAYERS_FILE 9000
new offlineplayerstr[64];
new 
tmpstr[64];
CMD:offlineinfo(playerid,params[])
{
    if(
PlayerInfo[playerid][Level] >= 1)
    {
        
        if(
sscanf(params"s[25]"offlineplayerstr)) return SendClientMessage(playeridCOLOR_RED1"[SYSTEM][EXPLAIN] :/offlineinfo (playername)")
        else
        {
            
LoadPlayerInfoOffline();
            
SCM(playerid,COLOR_HAHAHA,tmpstr);
        }
    } else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
forward LoadPlayerInfoOffline();
public 
LoadPlayerInfoOffline()
{
        for (new 
i=MAX_PLAYERS_FILE i++)
        {
             new 
file[100];
             new 
tmploadname[64],tmpip[28];
            
format(file,sizeof(file),FACTION_FILE,i);
            if(!
dini_Exists(file)) continue;
            
strcpy(tmploadname,dini_Get(file,"Player Name:"),25);
            if(!
strcmp(offlineplayerstr,tmploadname))
            {
                
/*get player info blahg blah your condition
                like example of this*/
                
strcpy(tmploadname,dini_Get(file,"Player Name:"),25);
                
strcpy(tmpip,dini_Get(file,"Player IP:"),28);
                
                
format(tmpstr,sizeof(tmpstr),"Player Name %s , Player IP %s",tmploadname,tmpip);
                
            }
        }
        return 
tmpstr;

Why is it public function?
Reply


Messages In This Thread
Offline Command - by Miller007 - 01.05.2016, 19:43
Re: Offline Command - by MarikAshtar - 01.05.2016, 23:43
Re: Offline Command - by colonel-top - 02.05.2016, 04:17
Re: Offline Command - by colonel-top - 02.05.2016, 04:22
Re: Offline Command - by SyS - 02.05.2016, 05:57
Re: Offline Command - by Sew_Sumi - 02.05.2016, 06:32
Re: Offline Command - by jlalt - 02.05.2016, 06:49
Re: Offline Command - by MarikAshtar - 02.05.2016, 07:28
Re: Offline Command - by Stinged - 02.05.2016, 07:49
Re: Offline Command - by MarikAshtar - 02.05.2016, 08:16

Forum Jump:


Users browsing this thread: 1 Guest(s)