/stats open in ShowPlayerDialog
#1

Hi .. im not so pro with pawn .. can someone make that /stats looks nice in ShowPlayerDialog



STATS :

pawn Код:
public ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new cash =  GetPlayerMoney(targetid);
        new atext[20];
        if(PlayerInfo[targetid][pSex] == 1) { atext = "Musko"; }
        else if(PlayerInfo[targetid][pSex] == 2) { atext = "Zensko"; }
        new otext[20];
        if(PlayerInfo[targetid][pOrigin] == 1) { otext = "Hrvatska"; }
        else if(PlayerInfo[targetid][pOrigin] == 2) { otext = "Srbija"; }
        else if(PlayerInfo[targetid][pOrigin] == 3) { otext = "Makedonija"; }
        else if(PlayerInfo[targetid][pOrigin] == 4) { otext = "Crna Gora"; }
        else if(PlayerInfo[targetid][pOrigin] == 5) { otext = "Slovenija"; }
        else if(PlayerInfo[targetid][pOrigin] == 6) { otext = "BiH"; }
        new ttext[20];
        if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Medic"; }
        else if(gTeam[targetid] == 3 || gTeam[targetid] == 4) { ttext = "Civilian"; }
        else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1) { ttext = "Policija"; }
        else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2) { ttext = "SIPA"; }
        else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3) { ttext = "Nacionalna garda"; }
        else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Hitna"; }
        else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5) { ttext = "LCN"; }
        else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6) { ttext = "Grove Mafia"; }
        else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8) { ttext = "Hitmen"; }
        else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9) { ttext = "UnderGroundRacer"; }
        else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10) { ttext = "Taxi"; }
        else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11) { ttext = "Licenseri"; }
        else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12) { ttext = "Yakuza"; }
        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] == 4 || PlayerInfo[targetid][pLeader] == 4)
        { ftext = "Firemen/Paramedics"; }
        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 = "Grove Mafia"; }
        else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11)
        { ftext = "License Faction"; }
        else
        { ftext = "None"; }
        new f2text[20];
        if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName]; }
        else { f2text = "None"; }
        new rtext[64];
        if(gTeam[targetid] == 5 || PlayerInfo[targetid][pFMember] < 255)//The 2 Organisations
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "NoviClan"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Associate"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "MladjiClan"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "StarijiClan"; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "PodLider"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Lider"; }
            else { rtext = "NoviClan"; }
        }
        else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1)//PD Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "PD.Ucenik"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "PD.Policajac"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "PD.Agent"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "PD.Kapetan"; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "PD.Porucnik"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "PD.Direktor"; }
            else { rtext = "PD.Ucenik"; }
        }
        else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2)//FBI Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "FBI.Agent"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "FBI.Presretac"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "FBI.Tajni Agent"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "FBI.Cobra"; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "FBI.Zamenik"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "FBI.Direktor"; }
            else { rtext = "FBI.Agent"; }
        }
        else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3)//NG Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "S:W:A:T.Vojnik"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "S:W:A:T.Casnik"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "S:W:A:T.Deserter"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "S:W:A:T.General"; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "S:W:A:T.Agent"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "S:W:A:T.Pukovnik"; }
            else { rtext = "S:W:A:T.Vojnik"; }
        }
        else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8)//Hitman 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 = "Freelancer"; }
        }
        else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9)//NR Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "UGR NoviClan"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "UGR LocalBandit"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "UGR Bnadit"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "UGR Spijun"; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "UGR Podlider"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "UGR Lider."; }
            else { rtext = "SkinHeads NoviClan"; }
        }
        else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)//NR Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "MD.Brat/Sestra"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "MD.Doktor"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "MD.Kirurg"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "MD.Spec.Kirurg"; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "MD.Zamjenik"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "MD.Upravitelj"; }
            else { rtext = "MD.Brat/Sestra"; }
        }
        else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10)//Taxi Company Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "Taxi Ucenik"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Taxi LocalVozac"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Taxi Vozac"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Taxi Clan "; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Taxi PodLider"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Taxi Lider"; }
            else { rtext = "Taxi Ucenik"; }
        }
        else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12)//Yakuza Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "Ucenik"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Yakuza Vozac"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Mafijas"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Profesionalac "; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Yakuza PodLider"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Yakuza Lider"; }
            else { rtext = "Taxi Ucenik"; }
        }
        else if(IsAnInstructor(targetid))//grove mafia Ranks
        {
            if(PlayerInfo[targetid][pRank] == 1) { rtext = "LIC.Ucenik"; }
            else if(PlayerInfo[targetid][pRank] == 2) { rtext = "LIC.Instruktor"; }
            else if(PlayerInfo[targetid][pRank] == 3) { rtext = "LIC.Stariji Instruktor"; }
            else if(PlayerInfo[targetid][pRank] == 4) { rtext = "LIC.Pro Instruktor"; }
            else if(PlayerInfo[targetid][pRank] == 5) { rtext = "LIC.Zamjenik"; }
            else if(PlayerInfo[targetid][pRank] == 6) { rtext = "LIC.Leader"; }
            else { rtext = "LIC.Ucenik"; }
        }
        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 Jackert"; }
        else if(PlayerInfo[targetid][pJob] == 6) { jtext = "TuningRace Club"; }
        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 = "GradonaVozac"; }
        else if(PlayerInfo[targetid][pJob] == 15) { jtext = "Paper Boy"; }
        else if(PlayerInfo[targetid][pJob] == 16) { jtext = "Trucker"; }
        else if(PlayerInfo[targetid][pJob] == 17) { jtext = "Donator"; }
        else if(PlayerInfo[targetid][pJob] == 18) { jtext = "Postar"; }
        else { jtext = "None"; }
        new drank[20];
        if(PlayerInfo[targetid][pDonateRank] == 1) { drank = "Donator"; }
        else if(PlayerInfo[targetid][pDonateRank] >= 2) { drank = "Super Donator"; }
        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 deaths = PlayerInfo[targetid][pDeaths];
        new crimes = PlayerInfo[targetid][pCrimes];
        new arrests = PlayerInfo[targetid][pArrested];
        new drugs = PlayerInfo[targetid][pDrugs];
        new mats = PlayerInfo[targetid][pMats];
        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 costlevel = nxtlevel*levelcost;//10k for testing purposes
        new housekey = PlayerInfo[targetid][pPhousekey];
        new bizkey = PlayerInfo[targetid][pPbiskey];
        new intir = PlayerInfo[targetid][pInt];
        new local = PlayerInfo[targetid][pLocal];
        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),"*** %s ***",name);
        SendClientMessage(playerid, COLOR_DOBRA,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Level:[%d] Spol:[%s] God:[%d] Drz:[%s] SpawnHealth:[%.1f] Novaca:[$%d] Bank:[$%d] Ph:[%d]", level,atext,age,otext,shealth+50, cash, account, pnumber);
        SendClientMessage(playerid, COLOR_GREEN,coordsstring);
        format(coordsstring, sizeof(coordsstring), "DonateRank:[%s] OzenjenSa:[%s] SatiIgranja:[%d] LottoNr:[%d]", drank,married,ptime,lotto);
        SendClientMessage(playerid, COLOR_GREEN,coordsstring);
        format(coordsstring, sizeof(coordsstring), "KriminalaPocinjenih:[%d] TimesArrested:[%d] Posao:[%s]", crimes,arrests,jtext);
        SendClientMessage(playerid, COLOR_GREEN,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Ubojstva:[%d] Smrti:[%d] SljedeciLvl:[$%d] Respect:[%d/%d] Obitelj:[%s]",kills,deaths,costlevel,exp,expamount,f2text);
        SendClientMessage(playerid, COLOR_GREEN,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Droge:[%d] Materiali:[%d] Disease:[%s] Organizacija:[%s] Rank:[%s]",drugs,mats,dtext,ttext,rtext);
        SendClientMessage(playerid, COLOR_GREEN,coordsstring);
        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            format(coordsstring, sizeof(coordsstring), "House kljuc [%d] Business kljuc [%d] HireKey [%d] int:[%d] local[%d]", housekey,bizkey,HireCar[targetid],intir,local);
            SendClientMessage(playerid, COLOR_GREEN,coordsstring);
        }
        SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
    }
}
Reply
#2

just show a playerdialog with the command and when you get that dialog you just use this code and instead of SendClientMessage you use ShowPlayerDialog,

I don't have time to script this for you sorry but you should be able to do it yourself if you just read some about ShowPlayerDialog.
Reply
#3

Sorry , forgot to say it .. i've done it


pawn Код:
new coordsstring[1024];
        new coordsstring1[400];
        new coordsstring2[400];
        new coordsstring3[400];
        new coordsstring4[400];
        new coordsstring5[400];
        new coordsstring6[400];
        format(coordsstring1, sizeof(coordsstring1),"{ffffff}|______________Ime:{80bfeb}%s ID:(%d){ffffff}______________|\n",name, playerid);
        format(coordsstring2, sizeof(coordsstring2),"-----------------------{e5a43d}[Novcano Stanje]{ffffff}---------------------\n{d2eb59}Dzep:{59ebd0}[$%d]\n{d2eb59}Banka:{59ebd0}[$%d]\n{d2eb59}Broj:{59ebd0}[%d]",cash,account,pnumber);
        format(coordsstring3, sizeof(coordsstring3),"-----------------------{e5a43d}[Osnovni Podatci]{ffffff}-----------------------\n{d2eb59}Level:{59ebd0}[%d]\n{d2eb59}Sledeci level:{59ebd0}[%d]\n{d2eb59}Respect Poeni:{59ebd0}[%d] / [%d]\n{d2eb59}Spol:{59ebd0}[%d/%d]\n{d2eb59}Godine:{59ebd0}[%d]\n{d2eb59}Drzava:{59ebd0}[%d]\n{d2eb59}SpawnHelt:{59ebd0}[%d]\n{d2eb59}Sati igranja:{59ebd0}[%d]\n{d2eb59}Lotto Broj:{59ebd0}[%d]\n{d2eb59}Donate Rank:{59ebd0}[%d]\n{d2eb59}Ozenjen sa:{59ebd0}[%d]",level,costlevel,exp,expamount,atext,age,otext,shealth+50,ptime,lotto,drank,married);
        format(coordsstring4, sizeof(coordsstring4),"-----------------------{e5a43d}[Licna Karta]{ffffff}-----------------------\n{d2eb59}Posao:{59ebd0}[%s]\n{d2eb59}Organizacija:{59ebd0}[%s]\n{d2eb59}Rank:{59ebd0}[%s]\n{d2eb59}Porodica:{59ebd0}[%s]\n{d2eb59}Bolest:{59ebd0}[%s]",jtext,ttext,rtext,f2text,dtext);
        format(coordsstring5, sizeof(coordsstring5),"-----------------------{e5a43d}[Dosije]{ffffff}----------------------\n{d2eb59}Ubistava:{59ebd0}[%d]\n{d2eb59}Pocinjenih zlocina:{59ebd0}[%d]\n{d2eb59}Hapsen puta:{59ebd0}[%d]\n{d2eb59}Smrti:{59ebd0}[%d]\n{d2eb59}Droga:{59ebd0}[%d]\n{d2eb59}Materijali:{59ebd0}[%d]",kills,crimes,arrests,deaths,drugs,mats);
        format(coordsstring6, sizeof(coordsstring6),"-----------------------{e5a43d}[Imovina]{ffffff}----------------------\n{d2eb59}Kljuc kuce:{59ebd0}[%d]\n{d2eb59}Kljuc biznisa:{59ebd0}[%d]\n{d2eb59}Kljuc posla:{59ebd0}[%d]\n{d2eb59}int:{59ebd0}[%d]\n{d2eb59}local:{59ebd0}[%d]", housekey,bizkey,HireCar[targetid],intir,local);
        format(coordsstring, sizeof(coordsstring), "%s\n%s\n%s\n%s\n%s",coordsstring1,coordsstring2,coordsstring3,coordsstring4,coordsstring5,coordsstring6);
        ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX,"{42c1ea}BeotelNet | {d29f5e}Stats",coordsstring,"U redu","Uredu");
    }
}


Is it ok like this bcz i can't test my script right now
Reply
#4

is this ok ?
Reply
#5

Find out for yourself. We don't have all your variables.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)