Advance structure?
#2

maybe
pawn Код:
enum Shops
{
    shop_name[500],
    shop_costmoney,
    shop_costscore,
    shop_reward[500],
    shop_unlocked[MAX_PLAYERS]
}

new ServerShop[][Shops]=
{
    {"No more speeding control",    150000, 10 ,    "You have bought 'No More Speeding Control' you cannot be caught by speedtraps no more!",   {0, ... }},
    {"Instant Level 2", 100000, 0 , "You have bought 'Instant Level 2' and you are now Level 2 (120 score)",    {1, ... }},
    {"Instant Level 3", 200000, 0 , "You have bought 'Instant Level 3' and you are now Level 3 (180 score)",    {1, ... }},
    {"Save Deathpos",   500000, 50 ,    "You have bought 'Save Deathpos' and you will be auto spawned to your death pos when you!", {1, ... }},
    {"10 Score",    25000,  0 , "You have bought 10 score points",  {1, ... }},
    {"50 Score",    100000, 0, "You have bought 50 score points",  {1, ... }},
    {"100 Score",   1750000,    0 , "You have bought 100 score points", {0, ... }},
    {"Free Weather",   10000,    5 , "You have bought Free Weather and u can now use /fweather to chose ur weather!", {0, ... }},
    {"Auto Armour", 50000,  7 , "You have bought 'Auto Armour' and u can now use the command: /auto armour once every 10 minuts", {1, ... }},
    {"Auto Health", 750000, 12 ,    "You have bought 'Auto Armour' and u can now use the command: /autp health once every 10 minuts", {0, ... }}//removed the ',' here too
};
Quote:

simple...
Next I made a little command that pops up a list dialog
pawn Код:
//...
        }else
                format(shop2, sizeof(shop2), "%s{FFFF00}|  {FFFFFF}-%s \n{FFFF00}|  \t{FFFFFF}%i Money{FFFF00}\n",shop2,ServerShop[i][shop_name], ServerShop[i][shop_costmoney]);
...    }
ok now the special thing about this is
that all the items that u have bought so far are displayed on top of the list in sexygreen
then all the items that u haven't bought yet are under all the displayed sexygreen yet bought items
in white...

pawn Код:
if(dialogid == 72)
    {
        if(!response) return 1;
        new index = 0;
        if(!isEven(listitem)) /* WHY? */
            return index = listitem - 1;

        if(ServerShop[index][shop_unlocked][playerid] == 0) // in your showplayerdialog, shop_unlocked[playerid] = 0 are white
            return SendClientMessage(playerid,COLOR_RED,"*You cannot buy shop items twice!");
        else
            return SendClientMessage(playerid,COLOR_SEXYGREEN,"*Proceeded");
    }
conclusion:
to your current problem, solution m3bb3 is changing if(ServerShop[index][shop_unlocked][playerid] == 0) to if(ServerShop[index][shop_unlocked][playerid] == 1) under OnDialogResponse.
Reply


Messages In This Thread
Advance structure? - by knackworst - 16.10.2011, 18:49
Re: Advance structure? - by KoczkaHUN - 16.10.2011, 18:59
Re: Advance structure? - by knackworst - 16.10.2011, 19:05

Forum Jump:


Users browsing this thread: 2 Guest(s)