/stats Dialog Help
#1

I need help. I was wondering how I could put this in dialog.

pawn Код:
stock ShowStats(playerid, playerb)
{
    new string[256], gender[8], Float:H, Float:A;
    if(PlayerInfo[playerb][pGender] == 1) format(gender, sizeof(gender), "Male");
    else if(PlayerInfo[playerb][pGender] == 2) format(gender, sizeof(gender), "Female");
    GetPlayerHealth(playerb, H); GetPlayerArmour(playerb, A);
    new loyal[4];
    if(!PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "Yes");
    if(PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "No");
    new oldskool[4];
    if(PlayerInfo[playerid][pHours] >= 248) format(oldskool, sizeof(oldskool), "Yes");
    else if(PlayerInfo[playerid][pHours] < 248) format(oldskool, sizeof(oldskool), "No");
    new rank[128];
    if(PlayerInfo[playerb][pFac] >= 1) format(rank, sizeof(rank), "%s", RPFRN(playerb));
    else format(rank, sizeof(rank), "None");
    new org[128];
    if(PlayerInfo[playerb][pFac] >= 1) format(org, sizeof(org), "%s", RPFNEx(playerb));
    else format(org, sizeof(org), "None");
    new rank2[128];
    if(PlayerInfo[playerb][pFam] >=1) format(rank2, sizeof(rank2), "%s", RPFaRN(playerb));
    else format(rank2, sizeof(rank2), "None");
    new org2[128];
    if(PlayerInfo[playerb][pFam] >=1) format(org2, sizeof(org2), "%s", RPFaN(playerb));
    else format(org2, sizeof(org2), "None");
    new exp = PlayerInfo[playerb][pExp];
    new nxtlevel = PlayerInfo[playerb][pLevel]+1;
    new expamount = nxtlevel*4;
    new costlevel = nxtlevel*4000;
    /*//respect
    new respectneed[4];
    if(PlayerInfo[playerb][pLevel] == 1) format(respectneed, sizeof(respectneed), "4");
    else if(PlayerInfo[playerb][pLevel] == 2) format(respectneed, sizeof(respectneed), "10");
    else if(PlayerInfo[playerb][pLevel] == 3) format(respectneed, sizeof(respectneed), "18");
    else if(PlayerInfo[playerb][pLevel] == 4) format(respectneed, sizeof(respectneed), "30");
    else if(PlayerInfo[playerb][pLevel] == 5) format(respectneed, sizeof(respectneed), "42");
    else if(PlayerInfo[playerb][pLevel] == 6) format(respectneed, sizeof(respectneed), "54");
    else if(PlayerInfo[playerb][pLevel] == 7) format(respectneed, sizeof(respectneed), "70");
    else if(PlayerInfo[playerb][pLevel] == 8) format(respectneed, sizeof(respectneed), "88");
    else if(PlayerInfo[playerb][pLevel] == 9) format(respectneed, sizeof(respectneed), "108");
    else if(PlayerInfo[playerb][pLevel] == 10) format(respectneed, sizeof(respectneed), "130");
    else if(PlayerInfo[playerb][pLevel] == 11) format(respectneed, sizeof(respectneed), "154");
    else if(PlayerInfo[playerb][pLevel] == 12) format(respectneed, sizeof(respectneed), "180");
    else if(PlayerInfo[playerb][pLevel] == 13) format(respectneed, sizeof(respectneed), "208");
    else if(PlayerInfo[playerb][pLevel] == 14) format(respectneed, sizeof(respectneed), "238");
    else if(PlayerInfo[playerb][pLevel] == 15) format(respectneed, sizeof(respectneed), "270");
    else if(PlayerInfo[playerb][pLevel] == 16) format(respectneed, sizeof(respectneed), "304");
    else if(PlayerInfo[playerb][pLevel] == 17) format(respectneed, sizeof(respectneed), "340");
    else if(PlayerInfo[playerb][pLevel] == 18) format(respectneed, sizeof(respectneed), "378");
    else if(PlayerInfo[playerb][pLevel] == 19) format(respectneed, sizeof(respectneed), "418");
    else if(PlayerInfo[playerb][pLevel] == 20) format(respectneed, sizeof(respectneed), "460");
    else if(PlayerInfo[playerb][pLevel] == 21) format(respectneed, sizeof(respectneed), "504");
    else if(PlayerInfo[playerb][pLevel] == 22) format(respectneed, sizeof(respectneed), "550");
    else if(PlayerInfo[playerb][pLevel] == 23) format(respectneed, sizeof(respectneed), "598");
    else if(PlayerInfo[playerb][pLevel] == 24) format(respectneed, sizeof(respectneed), "648");
    else if(PlayerInfo[playerb][pLevel] == 25) format(respectneed, sizeof(respectneed), "700");
    else if(PlayerInfo[playerb][pLevel] == 26) format(respectneed, sizeof(respectneed), "754");
    else if(PlayerInfo[playerb][pLevel] == 27) format(respectneed, sizeof(respectneed), "810");
    else if(PlayerInfo[playerb][pLevel] == 28) format(respectneed, sizeof(respectneed), "868");
    else if(PlayerInfo[playerb][pLevel] == 29) format(respectneed, sizeof(respectneed), "928");*/

    //new average = (PlayerInfo[playerb][pTMinutes] / PlayerInfo[playerb][pDay]);
    // Stats
    format(string, sizeof(string), " Statistics of %s", RPN(playerb));
    SendClientMessage(playerid, COLOR_ORANGE, string);
    format(string, sizeof(string), "Level: [%d] - Gender: [%s] - Age: [%d] - Money: [$%d] - Bank: [$%d] - Health: [%0.1f] - Armor: [%0.1f]", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], H, A);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string), "Phone Number: [%d] - Playing Hours: [%d] Next Level: [%d/%d] - Next Level Cost: [$%d] - Respect Points: [%d]", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], exp, expamount, costlevel, PlayerInfo[playerb][pExp]);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string), "Occupation: [%s] - Wanted Level: [%d] - Crimes Committed: [%d] - Arrested: [%dx] - Kill: [%d] - Death: [%d]", RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    format(string, sizeof(string), "Faction: [%s] - Faction Rank: [%s] - Family: [%s] - Family Rank: [%s]", org, rank, org2, rank2);
    SendClientMessage(playerid, COLOR_RADIO, string);
    format(string, sizeof(string), "Business: [%s] - House: [%s] - Garage: [%s] - Vehicles: 1[%s (ID:%d) - 2[%s (ID:%d)]", RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh]);
    SendClientMessage(playerid, COLOR_RADIO, string);
    SendClientMessage(playerid, COLOR_BLUE, " Type /inv to see you're inventory");
    return 1;
}
I want it so I when you type /stats It shows the stats in Dialog
Reply
#2

make it command.
Reply
#3

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
make it command.
pawn Код:
CMD:stats(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    ShowStats(playerid, playerid);
    return 1;
}
Reply
#4

Код:
CMD:stats(playerid, params[])
{
    ShowStats(playerid, playerid);
    return 1;
}
And make it public. It's bad idea to make it in stock trust me
Reply
#5

He means he wants a dialog to pop-up on his screen.

Right?

If so, you need to add ShowPlayerDialog to it..

Код:
ShowPlayerDialog(playerid, dialogid, style, caption [ ], info [ ],button1 [ ], button2 [ ] );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)