Making a Donut System! [Urgent]
#1

Was just wondering if anyone could help making me a donut system, it would consist of a few commands... First of all....

/givedonuts [PlayerID] [Donut Amount] - This command would be used to give donuts to a player, with donuts, players could go to the Donut store behind All Saints to exchange them for prizes.

/exchange - Doing this would require you to be in the Donut store, with doing this, will bring up with a menu which consists of prizes that you can exchange your donuts for.

/takedonuts - Doing this, Admins could deduct donuts from a players account.

Prizes to win....

Basic Shotgun+ Mp5: 1 Donut
Deagle: 1 Donut
M4: 1 Donut
Spas12: 2 Donuts
Sniper: 3 Donuts
x2 Grenades: 5 Donuts
1 Free car! (Sends a message to admins saying "Player ID [id] bought a free car at the donut shop": 20 Donuts
500k Cash: 20 Donuts
Making a Business ( Also Sends a admin a message: 45 donuts
Making a house ( Also sends a admin a message): 50 Donuts
Jetpack: 75 Donuts

I would be very grateful, if you need to contact me, use this method...

Message me over here.
Skype: lukeb53

All credits will be given to you.
Reply
#2

https://www.******.co.il/?gws_rd=ssl...+cookie+system
So much results... Just alter the code and add codes like:
pawn Код:
if(playerCookies[playerid >= 20]
GivePlayerCar or whatever
Reply
#3

Im a noob thats why i required help, but thanks, reckon you could help? +1 to that comment anywayz bud
Reply
#4

Anyone?
Reply
#5

Set a variable known as donuts consisting of a player array.
new pDonuts[MAX_PLAYERS];

Then add this to OnPlayerConnect - pDontus[playerid] = 0.0;

For /givedonuts, let us assume the person who you want to give is stored in a variable "targetid" and "amount" contains the donut amounts.

It should be something like:
pDontus[targetid] += amount;

Then for /exchange, it should be:

if(pDonuts[playerid] >= 10) // add prize here
else if(pDonuts[playerid] >= 20) // add a better prize here
else SendClientMessage(playerid, -1, "You don't have enough donuts!");

Hope this help.
Reply
#6

pawn Код:
enum donutsystem
{
    donuts,
    admin
}
new donutinfo[MAX_PLAYERS][donutsystem];

// Save & Load the donuts , I expect you know how to do it. I won't do it since I don't know what system you are using

CMD:givedonuts(playerid, params[])
{
    new id, amount;
    if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1, "USAGE: /givedonuts [PlayerID] [Donut Amount]");
    donutinfo[id][donuts] = donutinfo[id][donuts] + amount; // Getting the amount of donuts you have and adding the amount you gave
    // Do the rest you want
    return 1;
}

CMD:exchange(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, xxx, xxx, xxx)) // input your corindates of the shop
    {
        // Show the dialog
    }
    else return SendClientMessage(playerid, -1, "You are not inside the shop");
    return 1;
}

CMD:takedonuts(playerid, params[])
{
    if(donutinfo[playerid][admin] > 1)
    {
        new id, amount;
        if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1, "USAGE: /takedonuts [PlayerID] [Donut Amount]");
        donutinfo[id][donuts] = donutinfo[id][donuts] - amount; // Getting the amount of donuts you have and subtracting the amount you specified
        // Do the rest you want
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by Affan
Посмотреть сообщение
pawn Код:
enum donutsystem
{
    donuts,
    admin
}
new donutinfo[MAX_PLAYERS][donutsystem];

// Save & Load the donuts , I expect you know how to do it. I won't do it since I don't know what system you are using

CMD:givedonuts(playerid, params[])
{
    new id, amount;
    if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1, "USAGE: /givedonuts [PlayerID] [Donut Amount]");
    donutinfo[id][donuts] = donutinfo[id][donuts] + amount; // Getting the amount of donuts you have and adding the amount you gave
    // Do the rest you want
    return 1;
}

CMD:exchange(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, xxx, xxx, xxx)) // input your corindates of the shop
    {
        // Show the dialog
    }
    else return SendClientMessage(playerid, -1, "You are not inside the shop");
    return 1;
}

CMD:takedonuts(playerid, params[])
{
    if(donutinfo[playerid][admin] > 1)
    {
        new id, amount;
        if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1, "USAGE: /takedonuts [PlayerID] [Donut Amount]");
        donutinfo[id][donuts] = donutinfo[id][donuts] - amount; // Getting the amount of donuts you have and subtracting the amount you specified
        // Do the rest you want
    }
    return 1;
}
So what will i need to do?

and i use this admin system LuxAdmin (https://sampforum.blast.hk/showthread.php?tid=120724)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)