SA-MP Forums Archive
Enum help! :) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Enum help! :) (/showthread.php?tid=555025)



Enum help! :) - TheTerminator - 06.01.2015

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...



Re: Enum help! :) - Vince - 06.01.2015

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


Re: Enum help! :) - TheTerminator - 06.01.2015

Yes that was it, thank you!