Stock problem
#1

Im making a skill system and i made a /skillstats cmd, which i used this stock:

pawn Код:
stock SkillStats(playerid)
{
        if(pInfo[playerid][Skill] == 1)
        {
        //
        }
        if(pInfo[playerid][Skill] == 2)
        {
        new bo[250];
        new info[250];
        format(bo, sizeof bo, "Your current skill is: {F70505}%s {FFFFFF}- If you wish to change it use {F70505}/cs\n",SkillName(playerid));
        strcat(info, bo);
        strcat(bo,"{53C506}Your Skill Stats:\n");
        strcat(info, bo);
        format(bo, sizeof bo, "Bombs Left: {F70505}%d\n",pInfo[playerid][Bombs]);
        strcat(info, bo);
        format(bo, sizeof bo, "Bombs Planted {F70505}%d\n",pInfo[playerid][BombsPlanted]);
        strcat(info, bo);
        ShowPlayerDialog(playerid,DIALOG_BOMBER,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",bo,"Ok","");
        }
        if(pInfo[playerid][Skill] == 3)
        {
        new no[250];
        new info[250];
        format(no, sizeof no, "Your current skill is: {F70505}%s {FFFFFF}- If you wish to change it use {F70505}/cs\n",SkillName(playerid));
        strcat(info, no);
        strcat(no,"{53C506}Your Skill Stats:\n");
        strcat(info, no);
        format(no, sizeof no, "Taxes Paid: {F70505}%d\n",pInfo[playerid][Taxes]);
        strcat(info, no);
        ShowPlayerDialog(playerid,DIALOG_NORMALCIV,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",no,"Ok","");
        }
        if(pInfo[playerid][Skill] == 4)
        {
        //
        }
        if(pInfo[playerid][Skill] == 5)
        {
        new ro[250];
        new info[250];
        format(ro, sizeof ro, "Your current skill is: {F70505}%s {FFFFFF}- If you wish to change it use {F70505}/cs\n",SkillName(playerid));
        strcat(info, ro);
        strcat(ro,"{53C506}Your Skill Stats:\n");
        strcat(info, ro);
        format(ro, sizeof ro, "Players Robbed: {F70505}%d\n",pInfo[playerid][PlayersRobbed]);
        strcat(info, ro);
        format(ro, sizeof ro, "Total Robbed Money: {F70505}%d\n",pInfo[playerid][TotalRobbedMoney]);
        strcat(info, ro);
        ShowPlayerDialog(playerid,DIALOG_ROBBER,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",ro,"Ok","");
        }
        if(pInfo[playerid][Skill] == 6)
        {
        new ra[250];
        new info[250];
        format(ra, sizeof ra, "Your current skill is: {F70505}%s {FFFFFF}- If you wish to change it use {F70505}/cs\n",SkillName(playerid));
        strcat(info, ra);
        strcat(ra,"{53C506}Your Skill Stats:\n");
        strcat(info, ra);
        format(ra, sizeof ra, "Players Raped: {F70505}%d\n",pInfo[playerid][PlayersRaped]);
        strcat(info, ra);
        format(ra, sizeof ra, "Players Infected: {F70505}%d\n",pInfo[playerid][PlayersInfected]);
        strcat(info, ra);
        ShowPlayerDialog(playerid,DIALOG_RAPIST,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",ra,"Ok","");
        }
        if(pInfo[playerid][Skill] == 7)
        {
        new ca[250];
        new info[250];
        format(ca, sizeof ca, "Your current skill is: {F70505}%s {FFFFFF}- If you wish to change it use {F70505}/cs\n",SkillName(playerid));
        strcat(info, ca);
        strcat(ca,"{53C506}Your Skill Stats:\n");
        strcat(info, ca);
        format(ca, sizeof ca, "Vehicles Sold: {F70505}%d\n",pInfo[playerid][SoldVehicles]);
        strcat(info, ca);
        format(ca, sizeof ca, "Total Profit: {F70505}%d\n",pInfo[playerid][CarjackerProfit]);
        strcat(info, ca);
        ShowPlayerDialog(playerid,DIALOG_CARJACKER,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",ca,"Ok","");
        }
        if(pInfo[playerid][Skill] == 8)
        {
        //
        }
        return 1;
}
So in the cmd i used SkillStats(playerid);, but the cmd doesn't work, it doesnt show any dialog box.
Reply
#2

Did you checked which skill level player have?
Reply
#3

pawn Код:
if(pInfo[playerid][Skill] == 2)
Yeah..
Reply
#4

pawn Код:
stock SkillStats(playerid)
{
    new info[250]; // large string 250 is not enough ?
    format(info, sizeof info, "Your current skill is: {F70505}%s {FFFFFF}- If you wish to change it use {F70505}/cs\n",SkillName(playerid));
    strcat(info,"{53C506}Your Skill Stats:\n");
    switch(pInfo[playerid][Skill])
    {
        case 1:
        {
        }
        case 2:
        {
            format(info, sizeof info, "%sBombs Left: {F70505}%d\n",info,pInfo[playerid][Bombs]);
            format(info, sizeof info, "%sBombs Planted {F70505}%d",info,pInfo[playerid][BombsPlanted]);
            ShowPlayerDialog(playerid,DIALOG_BOMBER,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",info,"Ok","");
        }
        case 3:
        {
            format(info, sizeof info, "%sTaxes Paid: {F70505}%d",info,pInfo[playerid][Taxes]);
            ShowPlayerDialog(playerid,DIALOG_NORMALCIV,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",info,"Ok","");
        }
        case 4:
        {
        }
        case 5
        {
            format(info, sizeof info, "%sPlayers Robbed: {F70505}%d\n",info,pInfo[playerid][PlayersRobbed]);
            format(info, sizeof info, "%sTotal Robbed Money: {F70505}%d",info,pInfo[playerid][TotalRobbedMoney]);
            ShowPlayerDialog(playerid,DIALOG_ROBBER,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",info,"Ok","");
        }
        case 6:
        {
            format(info, sizeof info, "%sPlayers Raped: {F70505}%d\n",info,pInfo[playerid][PlayersRaped]);
            format(info, sizeof info, "%sPlayers Infected: {F70505}%d",info,pInfo[playerid][PlayersInfected]);
            ShowPlayerDialog(playerid,DIALOG_RAPIST,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",info,"Ok","");
        }
        case 7:
        {
            format(info, sizeof info, "%sVehicles Sold: {F70505}%d\n",info,pInfo[playerid][SoldVehicles]);
            format(info, sizeof info, "%sTotal Profit: {F70505}%d",info,pInfo[playerid][CarjackerProfit]);
            ShowPlayerDialog(playerid,DIALOG_CARJACKER,DIALOG_STYLE_MSGBOX, "{FFFFFF}Skill Stats",info,"Ok","");
        }
        case 8:
        {
        }
    }
    return 1;
}
Reply
#5

Is there any error with it or?
Reply
#6

Quote:
Originally Posted by Jefff
Посмотреть сообщение
//
Still doesn't work.

Quote:
Originally Posted by Pawnie
Посмотреть сообщение
Is there any error with it or?
No errors at all.
Reply
#7

Bump.
Reply
#8

How did you define the dialogs used in the stock?

Also use Jefff's code, it is much better.
Reply
#9

Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
How did you define the dialogs used in the stock?

Also use Jefff's code, it is much better.
Im using that code.

pawn Код:
//Skills Dialog Defines
#define DIALOG_MEDIC 111
#define DIALOG_BOMBER 112
#define DIALOG_NORMALCIV 113
#define DIALOG_DRUGDEALER 114
#define DIALOG_ROBBER 115
#define DIALOG_RAPIST 116
#define DIALOG_CARJACKER 117
#define DIALOG_FISHERMAN 118
//
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)