+1 Kills when somone gets a kill.
#1

Код:
public OnPlayerDeath(playerid, killerid, reason)
{

if (IsPlayerConnected(playerid)) {
   PlayerInfo[playerid][Deaths]++;
  }
  
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
		PlayerInfo[playerid][Kills]++;
	}
	
return 1;
}
I added a system to save players deaths and kills, the deaths work fine, but the kills do not.

When I die it adds +1 death and +1 kill to me, and not the killer for some reason..

Anyone got any clue why? I've looked through how people did it in other scripts and they did something like this.
Reply
#2

Quote:
Originally Posted by [ЉǾǖŦĦЗŁΛẄ
~ [HellFire] ]
Lol been there xD

PlayerInfo[playerid][Kills]

PlayerInfo[killerid][Kills]

killerid = killer

playerid = person who got killed

You probably know this already and it's just a simple mistake I'm not patronizing you
Believe it or not, I did not know that I thought it was suppose to be like that, I'll test it out with killerid instead of playerid

Boy if thats why it didn't work I'll feel like an idiot lol.


EDIT: It worked..

/facepalm

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)