01.12.2010, 00:04
pawn Код:
CMD:stats(playerid,params[])
{
new targetid = playerid;
new coordsstring[128];
new mula = GetPlayerCash(playerid);
new social = PlayerInfo[playerid][pSocial];
new age = PlayerInfo[playerid][pAge];
new gtext[20];
if(PlayerInfo[targetid][pType] == 1) { gtext = "Male"; }
else if(PlayerInfo[targetid][pType] == 2) { gtext = "Female"; }
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
//Let The Factions Begin!
new ftext[21];
if(PlayerInfo[targetid][pFaction] == 1 || PlayerInfo[targetid][pLeader] == 1) { ftext = "Los Santos PD"; }
new rtext[64];
if(PlayerInfo[targetid][pFaction] == 1 || PlayerInfo[targetid][pLeader] == 1) // LSPD Ranks
{
if(PlayerInfo[targetid][pRank] == 1) { rtext = "Officer"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Sergeant"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Captain"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Deputy Chief"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Chief"; }
}
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_RED, " You are not logged in");
{
format(coordsstring, sizeof(coordsstring)," [%s](%d) Character Stats\n Money:[$%d] | Social Secruity:[%d] | Age:[%d] | Gender:[%s]\n Faction:[%s] | Rank:[%s]",name, playerid, mula, social, age, gtext, ftext, rtext);
ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"New Life Gaming",coordsstring,"Ok","Cancel");
}
return true;
}