08.04.2011, 14:24
I want to know how to create a command /stats
COMMAND:stats(playerid, params[])
{
new pID;
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "Usage: /stats <playerid>");
if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "This player is not connected");
new string[128], Float:armour, Float:health;
GetPlayerHealth(pID,health);
GetPlayerArmour(pID, armour);
format(string, sizeof(string), "Health: %0.f - Armour: %.2f", health,armour);
SendClientMessage(playerid, -1, string);
return 1;
}
if (strcmp("/Title", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF,"=================={990000}*San Andreas Racers ID*{FFFFFF}==================");
new PName[MAX_PLAYER_NAME], string[128 + MAX_PLAYER_NAME];
GetPlayerName(playerid,PName,sizeof(PName));
format(string,sizeof(string),"[NAME] : {990000}%s",PName);
SendClientMessage(playerid,0xFFFFFFFF,string);
SendClientMessage(playerid, 0xFFFFFFFF,"[TITLE] : {990000}Newcomer");
SendClientMessage(playerid, 0xFFFFFFFF,"[SIGN] : {990000}Authorized by the San Andreas Driving Government");
SendClientMessage(playerid, 0xFFFFFFFF,"===========================================================");
}