06.09.2016, 21:34
Buying 1 C4 at a time:
Buying 2 C4 at a time:
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!
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.");
}
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!");
}