Getstats problem
#2

PHP код:
COMMAND:getstats(playeridparams[])
{
    if(
PlayerInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid0xD8D8D8FF"You are not allowed to use this command.");
    new 
tmp[256], idx;
    
tmp strtok(paramsidx);
    new 
id strval(tmp);
    if(
isnull(tmp)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /getstats <ID>");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playeridCOLOR_WHITE"Invalid ID");
    new 
string[128], pName[MAX_PLAYER_NAME], pip[16];
    
GetPlayerName(idpNameMAX_PLAYER_NAME);
    
format(filesizeof(file), "/Accounts/%s.ini"pName);
    
GetPlayerIp(idpipsizeof(pip));
    
format(string128"Name : %s"pName);
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"PlayerIP: %s"pip);
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"Score: %d"GetPlayerScore(id));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"Kills: %i"dini_Int(file"Kills"));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"Deaths: %i"dini_Int(file"Deaths"));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"Ratio: %f"floatdiv(PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths]));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"Warns: %i"dini_Int(file"Warns"));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"AdminLevel: %i"dini_Int(file"AdminLevel"));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"Credits: %i"dini_Int(file"Credit"));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(string128"VIP: %i"dini_Int(file"VIP"));
    
SendClientMessage(playeridCOLOR_WHITEstring);
    return 
1;

Reply


Messages In This Thread
Getstats problem - by Sreadon - 17.07.2011, 23:18
Re: Getstats problem - by Shadoww5 - 18.07.2011, 00:45
Re : Getstats problem - by Sreadon - 18.07.2011, 08:20

Forum Jump:


Users browsing this thread: 2 Guest(s)