18.10.2015, 22:57
pawn Код:
CMD:stats(playerid, params[])
{
if(GetPVarInt(playerid, "spawned") == 0) return SCM(playerid, COLOR_LIGHTBLUE, "Please spawn before doing any action.");
if(GetPVarInt(playerid,"CmdTime") > GetTickCount()) return SCM(playerid,0xFF0000FF,"Please wait before using this command again.");
new giveplayerid;
if(sscanf(params,"u",giveplayerid)) return SCM(playerid,0xFF0000FF,"/stats [id / part of name]");
if(giveplayerid == INVALID_PLAYER_ID) return SCM(playerid,0xFF0000FF,"Invalid player");
new yourid = playerid;
playerid = giveplayerid;
new Float:gihp, Float:giar;
GetPlayerHealth(playerid, gihp);
GetPlayerArmour(playerid, giar);
new temp[1500];
new info[1500];
// code
// ...
// ...
// ...
// ...
ShowPlayerDialog(yourid, DIALOG_STATS, DIALOG_STYLE_MSGBOX,"{FFFFFF}Your Current Stats",info,"Close","");
SetPVarInt(yourid,"CmdTime",GetTickCount()+5000);
return 1;
}