Help dialog [/stats]
#1

how can i make my this basic /stats in script

pawn Код:
new coordsstring[256];
        format(coordsstring, sizeof(coordsstring),"%s - Level %d • %s • Age: %d • Balance: $%d • PlayTime: %d • Ph.: %s",GetPlayerNameEx(targetid), level, sext, age, totalwealth, ptime, pnumber,);
        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Cash: $%d • Bank balance: $%d • Upgrade points: %d • Next level: %d/%d hours ($%d)", cash, account, upgradep, exp, expamount, costlevel);
        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
Reply
#2

Follow this general idea. This is basically the structure of the command and you can edit it or upgrade it to suit your needs.

Using ZCMD:

pawn Код:
CMD:stats(playerid,params[])
{
    new coordsstring[128];
    new level,sext,age,totalwealth,ptime,pnumber,cash,account,upgradep,exp,expamount,costlevel;
    //Assign these variables to values of the player.
    //EG:
    level = GetPlayerScore(playerid);
    pnumber = PlayerInfo[playerid][pNumber];
    //Do it for the rest. Replace PlayerInfo[playerid][pNumber] with the appropiate player data.
   
    format(coordsstring, sizeof(coordsstring),"%s - Level %d • %s • Age: %d • Balance: $%d • PlayTime: %d • Ph.: %s",GetPlayerNameEx(targetid), level, sext, age, totalwealth, ptime, pnumber,);
    SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Cash: $%d • Bank balance: $%d • Upgrade points: %d • Next level: %d/%d hours ($%d)", cash, account, upgradep, exp, expamount, costlevel);
    SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
    return 1;
}
Reply
#3

i mean i want to convert it to dialog
Reply
#4

Quote:
Originally Posted by ajam112
Посмотреть сообщение
i mean i want to convert it to dialog
Ooh, give me a few minutes to get some food and i'll make it for you :P
Reply
#5

This is my full /stats
pawn Код:
if(PlayerInfo[targetid][pPhousekey] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey]][hSafeMoney];
        if(PlayerInfo[targetid][pPhousekey2] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey2]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey2]][hSafeMoney];
        new coordsstring[128];
        format(coordsstring, sizeof(coordsstring),"%s - Level %d | %s | Age: %d | Total wealth: $%d | Playing hours: %d | Phone number: %s | Warnings: %d",GetPlayerNameEx(targetid), level, sext, age, totalwealth, ptime, pnumber, warns);
        SendClientMessageEx(playerid, COLOR_WHITE,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Cash: $%d | Bank balance: $%d | Upgrade points: %d | Spawn armor: %.0f | Next level: %d/%d hours ($%d)", cash, account, upgradep, shealth, exp, expamount, costlevel);
        SendClientMessageEx(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "%s: %s | Rank: %s (%d) | Division: %s | Job: %s (level: %d) | Job 2: %s (level: %d)", facfam, employer, rank, PlayerInfo[targetid][pRank], division, jtext,jlevel,jtext2, jlevel2);
        SendClientMessageEx(playerid, COLOR_GRAD5,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Crimes: %d | Arrests: %d | Insurance: %s | Wanted level: %d | Health: %.1f | Armor: %.1f | Paintball Tokens: %d",crimes,arrests,insur, wanted, health, armor, ptokens);
        SendClientMessageEx(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Married to: %s | Biggest fish: %d | Pot: %d | Crack: %d | Packages: %d | Crates: %d | Radio frequency: %d khz",married,bigfish,pot,crack,packages,crates, radiofreq);
        SendClientMessageEx(playerid, COLOR_GRAD5,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Materials: %d | Rope: %d | Cigars: %d | Sprunk: %d | Spray: %d | Screwdrivers: %d | VIP tokens: %d | Checks: %d | VIP: %s",mats,rope,cigars,sprunk,spray, PlayerInfo[targetid][pScrewdriver],tokens,checks,drank);
        SendClientMessageEx(playerid, COLOR_GRAD1,coordsstring);
        format(coordsstring, sizeof(coordsstring), "ADMutes: %d | NMutes: %d | RMutes: %d | Weapons Restricted: %d | Gang Warns: %d | EXP Hours: %d | Biz Key: %d", admutes, nmutes, PlayerInfo[targetid][pRMutedTotal],PlayerInfo[targetid][pWRestricted], PlayerInfo[targetid][pGangWarn], PlayerInfo[targetid][pDoubleEXP], PlayerInfo[targetid][pBiz]);

        SendClientMessageEx(playerid, COLOR_GRAD1,coordsstring);
P/S : Sorry i'm really2 newbie here..
Reply
#6

pawn Код:
if(PlayerInfo[targetid][pPhousekey] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey]][hSafeMoney];
if(PlayerInfo[targetid][pPhousekey2] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey2]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey2]][hSafeMoney];
new coordsstring[128], statsstring[1024];
format(coordsstring, sizeof(coordsstring),"%s - Level %d | %s | Age: %d | Total wealth: $%d | Playing hours: %d | Phone number: %s | Warnings: %d",GetPlayerNameEx(targetid), level, sext, age, totalwealth, ptime, pnumber, warns);
strcat(statsstring, coordsstring);
format(coordsstring, sizeof(coordsstring), "Cash: $%d | Bank balance: $%d | Upgrade points: %d | Spawn armor: %.0f | Next level: %d/%d hours ($%d)", cash, account, upgradep, shealth, exp, expamount, costlevel);
strcat(statsstring, coordsstring);
format(coordsstring, sizeof(coordsstring), "%s: %s | Rank: %s (%d) | Division: %s | Job: %s (level: %d) | Job 2: %s (level: %d)", facfam, employer, rank, PlayerInfo[targetid][pRank], division, jtext,jlevel,jtext2, jlevel2);
strcat(statsstring, coordsstring);
format(coordsstring, sizeof(coordsstring), "Crimes: %d | Arrests: %d | Insurance: %s | Wanted level: %d | Health: %.1f | Armor: %.1f | Paintball Tokens: %d",crimes,arrests,insur, wanted, health, armor, ptokens);
strcat(statsstring, coordsstring);
format(coordsstring, sizeof(coordsstring), "Married to: %s | Biggest fish: %d | Pot: %d | Crack: %d | Packages: %d | Crates: %d | Radio frequency: %d khz",married,bigfish,pot,crack,packages,crates, radiofreq);
strcat(statsstring, coordsstring);
format(coordsstring, sizeof(coordsstring), "Materials: %d | Rope: %d | Cigars: %d | Sprunk: %d | Spray: %d | Screwdrivers: %d | VIP tokens: %d | Checks: %d | VIP: %s",mats,rope,cigars,sprunk,spray, PlayerInfo[targetid][pScrewdriver],tokens,checks,drank);
strcat(statsstring, coordsstring);
format(coordsstring, sizeof(coordsstring), "ADMutes: %d | NMutes: %d | RMutes: %d | Weapons Restricted: %d | Gang Warns: %d | EXP Hours: %d | Biz Key: %d", admutes, nmutes, PlayerInfo[targetid][pRMutedTotal],PlayerInfo[targetid][pWRestricted], PlayerInfo[targetid][pGangWarn], PlayerInfo[targetid][pDoubleEXP], PlayerInfo[targetid][pBiz]);
strcat(statsstring, coordsstring);
ShowPlayerDialog(playerid, 5234, DIALOG_STYLE_MSGBOX, "Your stats:", statsstring, "Close", "");
Reply
#7

Put this near the top of your code, near the other '#defines'.
pawn Код:
#define DIALOG_STATS1 4444
Put this into the command; /stats. ->CMDtats(playerid,params[])
pawn Код:
new coordsstring[128];
        format(coordsstring, sizeof(coordsstring),"%s - Level %d\n%s\nAge: %d\nTotal wealth: $%d\nPlaying hours: %d\nPhone number: %s\nWarnings: %\nCash: $%d\nBank balance: $%d\nUpgrade points: %d\nSpawn armor: %.0f\nNext level: %d/%d hours ($%d)\n",GetPlayerNameEx(targetid), level, sext, age, totalwealth, ptime, pnumber, warns,, cash, account, upgradep, shealth, exp, expamount, costlevel);
        ShowPlayerDialog(playerid,DIALOG_STATS1, "Your account's statistics.",coordsstring,"Next Page","Quit");
Using this structure; you can build on it whichever way you want.
Reply
#8

It's dont need
Код:
/n
like that?

eries
I want like the new one i post.. pleis
Reply
#9

Little correction: You are right, I forgot to add \n 's. Just place them in before every message like this:
pawn Код:
format(blabla..., "\nText of stats", ...);
Reply
#10

lul.. i dont understand where to put it, like i said, i'm newbie in dialog style..

do you mean like this?
pawn Код:
Level %s\nExp %s
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)