Enum help! :)
#1

Hello.

I'm making a script,(shocker!).

I have enum

pZombie
pHuman

So I made that

pawn Код:
if(PlayerInfo[killerid][pZombie] >= 1) {
        PlayerInfo[playerid][pZombie]++;
    }
Basically that if the killer is a zombie, the playerid will get an increase in his pZombie enum.

However, I want to know how to make the opposite of


pawn Код:
PlayerInfo[playerid][pZombie]++
So that in the INI_WriteInt it actually decreases it, rather than adds 1.

Because what I'm trying to do is, to decrease his pHuman enum, so that once he spawns again

pawn Код:
if(PlayerInfo[playerid][pHuman] >= 1);
   SetPlayerColor....
   GivePlayerWeapon...

if(PlayerInfo[playerid][pHuman] <= 0);
  SetPlayerColor...
Reply
#2

Use -- instead of ++? I'm not sure if I understand your question correctly.
Reply
#3

Yes that was it, thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)