22.05.2012, 17:20
This is my code and I want do show player stats with dialog. This is the code:
Please help me. I have tryed a lot to make a dialog but every times I've failed
Sorry for bad English
Code:
public ShowStats(playerid,targetid) { if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid)) { new cash = GetPlayerMoney(targetid); new atext[20]; if(PlayerInfo[targetid][pSex] == 1) { atext = "Male"; } else if(PlayerInfo[targetid][pSex] == 2) { atext = "Female"; } new otext[20]; if(PlayerInfo[targetid][pOrigin] == 1) { otext = "San Fierro"; } else if(PlayerInfo[targetid][pOrigin] == 2) { otext = "Los Santos"; } new ttext[20]; if(gTeam[targetid] == 3 || gTeam[targetid] == 4) { ttext = "Civilian"; } else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1) { ttext = "Police Departament"; } else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2) { ttext = "F.B.I. Agent"; } else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3) { ttext = "National Guard"; } else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Medic & Fireman"; } else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5) { ttext = "La Cosa Nostra"; } else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6) { ttext = "Yakuza"; } else if(PlayerInfo[targetid][pMember] == 7 || PlayerInfo[targetid][pLeader] == 7) { ttext = "Mayor"; } else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8) { ttext = "Hitman Agency"; } else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9) { ttext = "News Reporter"; } else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10) { ttext = "Taxi Cab Company"; } else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11) { ttext = "School Instructor"; } else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12) { ttext = "Bloods Gang"; } else if(PlayerInfo[targetid][pMember] == 13 || PlayerInfo[targetid][pLeader] == 13) { ttext = "Crips Gang"; } else if(PlayerInfo[targetid][pMember] == 14 || PlayerInfo[targetid][pLeader] == 14) { ttext = "Surenos Gang"; } else if(PlayerInfo[targetid][pMember] == 15 || PlayerInfo[targetid][pLeader] == 15) { ttext = "Nortenos Gang"; } 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"; } new ftext[20]; if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1) { ftext = "Police Departament"; } if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2) { ftext = "F.B.I. Agency"; } if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3) { ftext = "National Guard"; } if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ftext = "Medic & Fireman"; } else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5) { ftext = "La Cosa Nostra"; } else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6) { ftext = "Yakuza"; } else if(PlayerInfo[targetid][pMember] == 7 || PlayerInfo[targetid][pLeader] == 7) { ftext = "Mayor"; } else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8) { ftext = "Hitman Agency"; } else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9) { ftext = "News Reporter"; } else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10) { ftext = "Taxi Cab Company"; } else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11) { ftext = "School Instructor"; } else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12) { ftext = "Bloods Gang"; } else if(PlayerInfo[targetid][pMember] == 13 || PlayerInfo[targetid][pLeader] == 13) { ftext = "Crips Gang"; } else if(PlayerInfo[targetid][pMember] == 14 || PlayerInfo[targetid][pLeader] == 14) { ftext = "Surenos Gang"; } else if(PlayerInfo[targetid][pMember] == 15 || PlayerInfo[targetid][pLeader] == 15) { ftext = "Nortenos Gang"; } else { ftext = "None"; } new rtext[64]; if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1)//Police Departament Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Cadet"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Officer"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Sergeant"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Lieutenant"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Captain"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Police Chief"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2)//Federal Bureau Of Investigations Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Professional Staff"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Special Agent Trainee"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Special Agent"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Special Agent in Charge"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Assistant Director in Charge"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Director"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3)//National Guard Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Private"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Sergeant"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Major"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Captain"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Lieutenant"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "General"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)//Medic & Fireman Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Medic"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Paramedic"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Assistent in charge"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Assistent"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Special Medic"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Medic Chief"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5)//La Cosa Nostra Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Soldato"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Caporale"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Sergente"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Luogottenente"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Collonelo"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Padrino"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6)//Yakuza Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Recruit"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Corporal"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Colonel"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Brigadier"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "General"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Warlord"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 7 || PlayerInfo[targetid][pLeader] == 7)//Mayor Ranks { if(PlayerInfo[targetid][pRank] == 6) { rtext = "Staff"; } } else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8)//Hitman Agency Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Freelancer"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Marksman"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Agent"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Special Agent"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Vice-Director"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Director"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9)//News Reporter Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Intern"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Local Reporter"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Local Editor"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Network Anchor"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Network Editor"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Network Producer"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10)//Taxi Cab Company Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Trainee"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Taxi Rookie"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Cabbie"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Dispatcher"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Shift Supervisor"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Taxi Company Owner"; } else { rtext = "Intern"; } } else if(IsAnInstructor(targetid))//School Intructor Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Trainee"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Instructor"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Senior Instructor"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Manager"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Vice-Director"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Director"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12)//Bloods Gang Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Outsider"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Gangsta"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Souja"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Original Gangsta"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Double OG"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Big Papa"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 13 || PlayerInfo[targetid][pLeader] == 13)//Crips Gang Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Outsider"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Gangsta"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Souja"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Original Gangsta"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Double OG"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Big Papa"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 14 || PlayerInfo[targetid][pLeader] == 14)//Surenos Gang Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Cabron"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Azteca"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Soldato"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Mafioso"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Drecha Mano"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Senior"; } else { rtext = "Intern"; } } else if(PlayerInfo[targetid][pMember] == 15 || PlayerInfo[targetid][pLeader] == 15)//Nortenos Gang Ranks { if(PlayerInfo[targetid][pRank] == 1) { rtext = "Cabron"; } else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Vago"; } else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Soldato"; } else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Mafioso"; } else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Derecha Mano"; } else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Senior"; } else { rtext = "Intern"; } } else { rtext = "None"; } new jtext[20]; if(PlayerInfo[targetid][pJob] == 1) { jtext = "Detective"; } else if(PlayerInfo[targetid][pJob] == 2) { jtext = "Lawyer"; } else if(PlayerInfo[targetid][pJob] == 3) { jtext = "Whore"; } else if(PlayerInfo[targetid][pJob] == 4) { jtext = "Drugs Dealer"; } else if(PlayerInfo[targetid][pJob] == 5) { jtext = "Car Jacker"; } else if(PlayerInfo[targetid][pJob] == 6) { jtext = "News Reporter"; } else if(PlayerInfo[targetid][pJob] == 7) { jtext = "Car Mechanic"; } else if(PlayerInfo[targetid][pJob] == 8) { jtext = "Bodyguard"; } else if(PlayerInfo[targetid][pJob] == 9) { jtext = "Arms Dealer"; } else if(PlayerInfo[targetid][pJob] == 10) { jtext = "Car Dealer"; } else if(PlayerInfo[targetid][pJob] == 12) { jtext = "Boxer"; } else if(PlayerInfo[targetid][pJob] == 14) { jtext = "Bus Driver"; } else if(PlayerInfo[targetid][pJob] == 15) { jtext = "Paper Boy"; } else if(PlayerInfo[targetid][pJob] == 16) { jtext = "Trucker"; } else { jtext = "None"; } new drank[20]; if(PlayerInfo[targetid][pDonateRank] == 1) { drank = "Power User"; } else if(PlayerInfo[targetid][pDonateRank] >= 2) { drank = "Donater"; } else { drank = "None"; } 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 lotto = PlayerInfo[targetid][pLottoNr]; new plevel = PlayerInfo[targetid][pLevel]; new fishes = PlayerInfo[targetid][pFishes]; new deaths = PlayerInfo[targetid][pDeaths]; new arrests = PlayerInfo[targetid][pArrested]; new drugs = PlayerInfo[targetid][pDrugs]; new pills = PlayerInfo[targetid][pPills]; new mats = PlayerInfo[targetid][pMats]; new wanted = WantedLevel[targetid]; new exp = PlayerInfo[targetid][pExp]; new kills = PlayerInfo[targetid][pKills]; new bigfish = PlayerInfo[targetid][pBiggestFish]; new pnumber = PlayerInfo[targetid][pPnumber]; new account = PlayerInfo[targetid][pAccount]; new nxtlevel = PlayerInfo[targetid][pLevel]+1; new expamount = nxtlevel*levelexp; new warns = PlayerInfo[targetid][pWarns]; new costlevel = nxtlevel*levelcost; // 10.000$ for testing purposes new Float:shealth = PlayerInfo[targetid][pSHealth]; new Float:health; new name[MAX_PLAYER_NAME]; GetPlayerName(targetid, name, sizeof(name)); GetPlayerHealth(targetid,health); new Float:px,Float:py,Float:pz; GetPlayerPos(targetid, px, py, pz); new coordsstring[256]; SendClientMessage(playerid, COLOR_GREEN,"___________________________________________________________________________________________________"); format(coordsstring, sizeof(coordsstring),"» Name: %s • Level: %d • Faction: %s • Rank: %s",name,plevel,ttext,rtext); SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring); format(coordsstring, sizeof(coordsstring), "» Sex: %s • Age: %d • SpawnHealth: %.1f • Cash: %s • Bank: %s • NumberPhone: %d", atext, age, shealth+50, FormatMoney(cash), FormatMoney(account), pnumber); SendClientMessage(playerid, COLOR_WHITE,coordsstring); format(coordsstring, sizeof(coordsstring), "» DonateRank: %s • PlayingHours: %d • Respect: %d/%d • NumberLotto: %d", drank,ptime,exp,expamount,lotto); SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring); format(coordsstring, sizeof(coordsstring), "» TimesArrested: %d • WantedLevel: %d • MarriedTo: %s • Disease: %s", arrests,wanted,married,dtext); SendClientMessage(playerid, COLOR_WHITE,coordsstring); format(coordsstring, sizeof(coordsstring), "» Kills: %d • Deaths: %d • NextLevel: %d$ • Job: %s",kills,deaths,costlevel,jtext); SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring); format(coordsstring, sizeof(coordsstring), "» FishesCaught: %d • BiggestFish: %d • Drugs: %d • Materials: %d • Pills: %d • Warns: %d",fishes,bigfish,drugs,mats,pills,warns); SendClientMessage(playerid, COLOR_WHITE,coordsstring); SendClientMessage(playerid, COLOR_GREEN,"___________________________________________________________________________________________________"); } }
Sorry for bad English