20.05.2012, 23:17
Can you give me an example?
This is the whole /info command.
This is the whole /info command.
pawn Код:
CMD:info(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
new giveplayerid;
new Float:gihp, Float:giar;
new name[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, name, sizeof(name));
GetPlayerHealth(giveplayerid, gihp);
GetPlayerArmour(giveplayerid, giar);
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /info [ID/PartOfName]");
if(IsPlayerConnected(giveplayerid))
{
new info[2056];
strcat(info,"{0FA0D1}Name: %s\n",name);
strcat(info,"{0FA0D1}Cash: %i$\n",GetPlayerMoney(playerid));
strcat(info,"{0FA0D1}Wanted Level: %d\n",PlayerInfo[playerid][pWantedLevel]);
strcat(info,"{0FA0D1}Admin Level: %s\n",PlayerInfo[playerid][pAdmin]);
strcat(info,"{0FA0D1}Kills: %i\n",PlayerInfo[playerid][pKills]);
strcat(info,"{0FA0D1}Deaths: %i\n",PlayerInfo[playerid][pDeaths]);
strcat(info,"{0FA0D1}Health: %0.1f\n", gihp);
strcat(info,"{0FA0D1}Armour: %0.1f\n", giar);
strcat(info,"{0FA0D1}VIP: %d (1 = YES - 0 = NO)\n",PlayerInfo[playerid][pVip]);
strcat(info,"{0FA0D1}Score: %i\n",GetPlayerScore(playerid));
strcat(info,"{0FA0D1}Condoms %d\n",PlayerInfo[playerid][pCondoms]);
strcat(info,"{0FA0D1}Life Insurance %d\n",PlayerInfo[playerid][pLifeIns]);
ShowPlayerDialog(playerid, 17, DIALOG_STYLE_MSGBOX,"{53C506}Player Info",info,"Close","");
}
else
{
SendClientMessage(playerid, red, "Invalid player specified.");
}
return true;
}
else return 0;
}