max c4s
#4

Buying 1 C4 at a time:
pawn Код:
// on top
#define MAX_C4_PER_PLAYER 10

new pC4[MAX_PLAYERS];

// when they buy C4
pC4[playerid] ++;

// when they use C4
pC4[playerid] --;

// when they try to buy C4
if((pC4[playerid] + 1) > MAX_C4_PER_PLAYER)
{
    SendClientMessage(playerid, -1, "You can only carry up to "#MAX_C4_PER_PLAYER" at a time.");
}
Buying 2 C4 at a time:
pawn Код:
// on top
#define MAX_C4_PER_PLAYER 10

new pC4[MAX_PLAYERS];

// when they buy C4
pC4[playerid] += 2;

// when they use C4
pC4[playerid] --;

// when they try to buy C4
if((pC4[playerid] + 2) > MAX_C4_PER_PLAYER)
{
    SendClientMessage(playerid, -1, "Error while buying C4, try buying 1!");
}
I don't know how anyone wouldn't know how, it's vastly simple. I would just remind you that this section isn't for requests, but I left you an example above. Enjoy!
Reply


Messages In This Thread
max c4s - by XHunterZ - 04.09.2016, 13:45
Re: max c4s - by XHunterZ - 05.09.2016, 10:18
Re: max c4s - by XHunterZ - 06.09.2016, 21:21
Re: max c4s - by SickAttack - 06.09.2016, 21:34

Forum Jump:


Users browsing this thread: 2 Guest(s)