16.08.2014, 07:02
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.
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.