SA-MP Forums Archive
+1 Kills when somone gets a kill. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: +1 Kills when somone gets a kill. (/showthread.php?tid=121041)



+1 Kills when somone gets a kill. - whereschris - 14.01.2010

Код:
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.


Re: +1 Kills when somone gets a kill. - whereschris - 14.01.2010

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