Updating a player's value?
#1

So, let's say a player has 0 bombs.

Bomb = 0.
How could you do it so when you type a command it gives you 1.
Then 2. Then 3 and so on?
Reply
#2

This is just an example how it could work.

pawn Код:
if (strcmp("/givemeabomb", cmdtext, true, 10) == 0)
    {
        bomb[playerid] += 1;
        return 1;
    }
Reply
#3

Bomb++; = Increase the value by one.
Bomb += (value) - Increase the value by your selected number.
Reply
#4

Oh, same goes for decreasing, right?
Reply
#5

Yeah, just replace the + with a -
Reply
#6

How would I check if the value is 0 or 1?
With if? If so, how?
Reply
#7

pawn Код:
CMD:mybomb(playerid,params[])
{
 new string[100];
 format(string, sizeof(string), "bomb : %d",bomb[playerid] );
 SendClientMessage(playerid,-1,string);
 return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)