SA-MP Forums Archive
cmd /info - 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: cmd /info (/showthread.php?tid=471475)



cmd /info - Another1 - 23.10.2013

Hello guys i want cmd like /info playerid if im was admin and see some info about the player like hes health hes ping hes ip etc


Re: cmd /info - HardRock - 23.10.2013

You use ZCMD?


Re: cmd /info - Another1 - 23.10.2013

yes......


Re: cmd /info - HardRock - 23.10.2013

PHP код:
CMD:info(playeridparams[])
{
    new 
string[256], playerbPing,  pIP[16], FloatArmourFloatHealthName[MAX_PLAYER_NAME+1];
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLORHERE"You are not an authorized to use this command.");
    if(
sscanf(params"i"playerb)) return SendClientMessage(playeridCOLORHERE"[Usage]: /info [PlayerID]");
    
GetPlayerHealth(playerbHealth);
    
GetPlayerArmour(playeridArmour);
    
GetPlayerName(playeridNamesizeof(Name));
    
GetPlayerIp(playeridpIPsizeof(pIP));
    
Ping GetPlayerPing(playerid);
    
format(stringsizeof(string), "Name: %s | Ping: %d | IP: %s | Health: %f | Armour: %f"NamePingpIPHealthArmour);
    
SendMessageAdmin(COLORHEREstring);
    return 
1;

Something like that.

Edit: IsPlayerAdmin(playerid), SendMessageAdmin , COLORHERE