13.05.2012, 06:35
Hey guys i want to create /stats in MSGBOX Dialog style but everytime i fail so please do help me here is the original code
I will be grateful to the one who helps me please i need it
pawn Код:
public ShowStats(playerid,targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new cash = PlayerInfo[targetid][pCash];
new atext[20];
if(PlayerInfo[targetid][pSex] == 1) { atext = "Male"; }
else if(PlayerInfo[targetid][pSex] == 2) { atext = "Female"; }
new dtext[20];
if(STDPlayer[targetid] == 1) { dtext = "Chlamydia"; }
else if(STDPlayer[targetid] == 2) { dtext = "Gonorrhea"; }
else if(STDPlayer[targetid] == 3) { dtext = "Syphilis"; }
else { dtext = "None"; }
// get player's faction
new ftext[32];
format(ftext,sizeof(ftext),"%s",GetPlayerFactionName(targetid));
// get player's rank
new rtext[64];
format(rtext,sizeof(rtext),"%s",GetPlayerRank(targetid));
new jtext[20];
new jlevel;
if(PlayerInfo[targetid][pJob] == 1)
{
jtext = "Detective";
new level = PlayerInfo[targetid][pDetSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 2)
{
jtext = "Lawyer";
new level = PlayerInfo[targetid][pLawSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 3)
{
jtext = "Whore";
new level = PlayerInfo[targetid][pSexSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 4)
{
jtext = "Drug Dealer";
new level = PlayerInfo[targetid][pDrugsSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 5)
{
jtext = "Car Jacker";
new level = PlayerInfo[targetid][pJackSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 6)
{
jtext = "News Reporter";
new level = PlayerInfo[targetid][pNewsSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 7)
{
jtext = "Mechanic";
new level = PlayerInfo[targetid][pJackSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 8)
{
jtext = "Bodyguard";
new level = PlayerInfo[targetid][pNewsSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 9)
{
jtext = "Gun Dealer";
new level = PlayerInfo[targetid][pArmsSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 10)
{
jtext = "None"; jlevel = 0;
}
else if(PlayerInfo[targetid][pJob] == 11) // Trashman
{
jtext = "Trashman";
new level = PlayerInfo[targetid][pTrashSkill];
if(level >= 0 && level <= 49) { jlevel = 1; }
else if(level >= 50 && level <= 99) { jlevel = 2; }
else if(level >= 100 && level <= 199) { jlevel = 3; }
else if(level >= 200 && level <= 399) { jlevel = 4; }
else if(level >= 400) { jlevel = 5; }
}
else if(PlayerInfo[targetid][pJob] == 12)
{
jtext = "Boxer"; jlevel = 0;
}
else if(PlayerInfo[targetid][pJob] == 14)
{
jtext = "Taxi Driver"; jlevel = 0;
}
else if(PlayerInfo[targetid][pJob] == 17)
{
jtext = "Drug Smuggler";
new level = PlayerInfo[targetid][pSmugglerSkill];
if(level >= 0 && level <= 19) { jlevel = 1; }
else if(level >= 20 && level <= 39) { jlevel = 2; }
else if(level >= 40 && level <= 59) { jlevel = 3; }
else if(level >= 60 && level <= 79) { jlevel = 4; }
else if(level >= 80) { jlevel = 5; }
}
else
{
jtext = "None"; jlevel = 0;
}
new married[20];
strmid(married, PlayerInfo[targetid][pMarriedTo], 0, strlen(PlayerInfo[targetid][pMarriedTo]), 255);
new age = PlayerInfo[targetid][pAge];
new ptime = PlayerInfo[targetid][pConnectTime];
new deaths = PlayerInfo[targetid][pDeaths];
new bigfish = PlayerInfo[targetid][pBiggestFish];
new crimes = PlayerInfo[targetid][pCrimes];
new arrests = PlayerInfo[targetid][pArrested];
new pot = PlayerInfo[targetid][pPot];
new crack = PlayerInfo[targetid][pCrack];
new seeds = PlayerInfo[targetid][pSeeds];
new packages = Packages[playerid];
new crates = Crates[playerid];
new mats = PlayerInfo[targetid][pMats];
new rope = PlayerInfo[targetid][pRope];
new cigars = PlayerInfo[targetid][pCigars];
new sprunk = PlayerInfo[targetid][pSprunk];
new blindfolds = PlayerInfo[targetid][pBlindfolds];
new wanted = PlayerInfo[targetid][pWantedLevel];
new level = PlayerInfo[targetid][pLevel];
new exp = PlayerInfo[targetid][pExp];
new kills = PlayerInfo[targetid][pKills];
new pnumber = PlayerInfo[targetid][pPnumber];
new account = PlayerInfo[targetid][pAccount];
new nxtlevel = PlayerInfo[targetid][pLevel]+1;
new expamount = nxtlevel*levelexp;
new points = PlayerInfo[targetid][gPupgrade];
new scope = PlayerInfo[targetid][pScope];
new wtc = PlayerInfo[targetid][pWTc];
new hkey = PlayerInfo[targetid][pPhousekey];
new bkey = PlayerInfo[targetid][pPbiskey];
new screw;
new viprank[256];
if(PlayerInfo[targetid][pDonateRank] == 1)
{
viprank = "Bronze";
}
if(PlayerInfo[targetid][pDonateRank] == 2)
{
viprank = "Silver";
}
if(PlayerInfo[targetid][pDonateRank] == 3)
{
viprank = "Gold";
}
if(PlayerInfo[targetid][pDonateRank] == 0)
{
viprank = "None";
}
if(PlayerInfo[targetid][pDonateRank] >= 4)
{
viprank = "Platinum";
}
if(PlayerInfo[targetid][pDonateRank] >= 5)
{
viprank = "Moderator";
}
if(PlayerInfo[targetid][pScrew] > 0)
{
screw = 1;
}
new Float:health;
new Float:armor;
GetPlayerHealth(targetid,health);
GetPlayerArmour(targetid,armor);
new shealth = PlayerInfo[targetid][pSHealth];
new name[MAX_PLAYER_NAME];
GetPlayerName(targetid, name, sizeof(name));
new coordsstring[128];
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
format(coordsstring, sizeof(coordsstring),"*** %s ***",name);
SendClientMessage(playerid, COLOR_WHITE,coordsstring);
format(coordsstring, sizeof(coordsstring), "Level:[%d] - Sex:[%s] - Age:[%d] - Cash:[$%d] - Bank:[$%d] - Ph:[%d] - Health:[%.1f] - Armor:[%.1f]",level,atext,age,cash,account,pnumber,health,armor);
SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
format(coordsstring, sizeof(coordsstring), "UpgradePoints:[%d] - ArmorUpgrade:[%d] - Respect:[%d/%d] - PlayingHours:[%d]",points,shealth,exp,expamount,ptime);
SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
format(coordsstring, sizeof(coordsstring), "Job:[%s] - JobLevel:[%d] - CrimesCommited:[%d] - TimesArrested:[%d] - Kills:[%d] - Deaths:[%d] - Disease:[%s]",jtext,jlevel,crimes,arrests,kills,deaths,dtext);
SendClientMessage(playerid, COLOR_YELLOW,coordsstring);
format(coordsstring, sizeof(coordsstring), "MarriedTo:[%s] - BiggestFish:[%d] - WantedLevel:[%d] - Pot:[%d] - Crack:[%d] - Seeds:[%d] - Packages:[%d] - Crates:[%d]",married,bigfish,wanted,pot,crack,seeds,packages,crates);
SendClientMessage(playerid, COLOR_YELLOW,coordsstring);
format(coordsstring, sizeof(coordsstring), "Gun parts:[%d] - Rope:[%d] - Blindfolds:[%d] - Cigars:[%d] - Sprunk:[%d] - ScrewDriver:[%d] - Scope:[%d]",mats,rope,blindfolds,cigars,sprunk,screw,scope);
SendClientMessage(playerid, COLOR_GREEN,coordsstring);
format(coordsstring, sizeof(coordsstring), "WTc:[%d] - Organization:[%s] - Rank:[%s]",wtc,ftext,rtext);
SendClientMessage(playerid, COLOR_GREEN,coordsstring);
format(coordsstring, sizeof(coordsstring), "HouseID:%d | BusinessID:%d | VIP Rank:[%s]",hkey,bkey,viprank);
SendClientMessage(playerid, COLOR_WHITE,coordsstring);
if(PlayerInfo[playerid][pMember] == 8)
{
format(coordsstring, sizeof(coordsstring), "C4:[%d]",PlayerInfo[playerid][pBombs]);
SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
}
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
}
}