Adding a new value to a variable
#1

Alright, on the public OnPlayerDeath, im trying to define a variable that if the killer kills a player on the TEAM_ZOMBIE, that will add 1 value to the var_KILL. And once the var kill is at least 1, the player gets a new weapon. And a newer one once var = 2 and so on and so forth. I already #defined var_KILL at the top of the script. Heres the code im trying to use:

Код:
if(gTeam[killerid] == TEAM_ZOMBIE);
	var_KILL == 1
Could anyone help with this?
Reply
#2

at the top:
new Kills[MAX_PLAYERS];

onplayerdeath
Kills[killerid] ++; //this makes it increase by 1
if(Kills[killerid] == 1) GivePlayerWeapon(killerid, 22, 100);//if he has 1 kill he gets this weapon
else if(Kills[killerid] == 2) GivePlayerWeapon(killerid, 25, 100);//at 2 kills this one
else if(Kills[killerid] == 3) GivePlayerWeapon(killerid, 28 , 300);//and with 3 kills he receives this weapon
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)