Making a Donut System! [Urgent]
#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


Messages In This Thread
Making a Donut System! [Urgent] - by MeowZ - 13.08.2014, 17:48
Re: Making a Donut System! [Urgent] - by [XST]O_x - 13.08.2014, 17:57
Re: Making a Donut System! [Urgent] - by MeowZ - 13.08.2014, 17:58
Re: Making a Donut System! [Urgent] - by MeowZ - 15.08.2014, 21:24
Re: Making a Donut System! [Urgent] - by Norrin - 16.08.2014, 07:02
Re: Making a Donut System! [Urgent] - by Affan - 16.08.2014, 07:46
Re: Making a Donut System! [Urgent] - by MeowZ - 05.09.2014, 16:10

Forum Jump:


Users browsing this thread: 3 Guest(s)