22.03.2011, 00:18
Once again, I have run into a problem.. and as I have no experience using this function what-so-ever, I can't even attempt to solve this by myself. Although it doesn't provide me with an error, it doesn't work as I want it to.
Here's the code:
Screenshot of the problem:
Here's the code:
pawn Код:
COMMAND:stats(playerid, params[])
{
new string[256], holder[256], FactionName[50], FactionRankName[50], VIPName[50], JobName[50];
if(PVar[playerid][pFaction] == 0)
{
FactionName = "Civilian";
}
else if(PVar[playerid][pFaction] == 1)
{
FactionName = "Los Santos Police Department";
}
else if(PVar[playerid][pFaction] == 2)
{
FactionName = "The Agency";
}
if(PVar[playerid][pFRank] == 0 && PVar[playerid][pFaction] == 0)
{
FactionRankName = "N/A";
}
else if(PVar[playerid][pFRank] == 1 && PVar[playerid][pFaction] == 1)
{
FactionRankName = "Trainee";
}
else if(PVar[playerid][pFRank] == 2 && PVar[playerid][pFaction] == 1)
{
FactionRankName = "Officer";
}
else if(PVar[playerid][pFRank] == 3 && PVar[playerid][pFaction] == 1)
{
FactionRankName = "Sergeant";
}
else if(PVar[playerid][pFRank] == 4 && PVar[playerid][pFaction] == 1)
{
FactionRankName = "Major";
}
else if(PVar[playerid][pFRank] == 5 && PVar[playerid][pFaction] == 1)
{
FactionRankName = "Chief";
}
else if(PVar[playerid][pFRank] == 1 && PVar[playerid][pFaction] == 2)
{
FactionRankName = "Agent";
}
else if(PVar[playerid][pFRank] == 2 && PVar[playerid][pFaction] == 2)
{
FactionRankName = "C.E.O";
}
if(PVar[playerid][VIPLevel] == 0)
{
VIPName = "None";
}
else if(PVar[playerid][VIPLevel] == 1)
{
VIPName = "Bronze";
}
else if(PVar[playerid][VIPLevel] == 2)
{
VIPName = "Bronze";
}
else if(PVar[playerid][VIPLevel] == 3)
{
VIPName = "Steel";
}
else if(PVar[playerid][VIPLevel] == 4)
{
VIPName = "Platinum";
}
else if(PVar[playerid][VIPLevel] == 5)
{
VIPName = "Gold";
}
if(PVar[playerid][pJob] == 0)
{
JobName = "Unemployed";
}
else if(PVar[playerid][pJob] == 1)
{
JobName = "Arms Dealer";
}
format(string, sizeof(string), "{0FA0D1}Name: {FFFFFF}%s (ID: %d)\n{0FA0D1}VIP Rank: {FFFFFF}%s (%d)\n{0FA0D1}Skin ID: {FFFFFF}%d\n{0FA0D1}Job:{FFFFFF} %s\n{0FA0D1}Money: {FFFFFF}$%d\n{0FA0D1}Faction: {FFFFFF}%s |", pName(playerid), playerid, VIPName, PVar[playerid][VIPLevel], PVar[playerid][pSkin], JobName, PVar[playerid][pMoney], FactionName);
strcat(holder, string, sizeof(holder));
format(string, sizeof(string), "{0FA0D1}Rank: {FFFFFF}%s (Rank: %d)\n{0FA0D1}Materials: {FFFFFF}%d | {0FA0D1}Drugs: {FFFFFF}%d", FactionRankName, PVar[playerid][pFRank], PVar[playerid][pMaterials], PVar[playerid][pDrugs]);
strcat(holder, string, sizeof(holder)); // You need a new variable called 'holder' to hold all the data concenated with strcat
ShowPlayerDialog(playerid, STATS, DIALOG_STYLE_MSGBOX, "{0FA0D1}Godfather Reborn: Statistics", holder, "Hide", "");
return 1;
}