SA-MP Forums Archive
Stats 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: Stats help (/showthread.php?tid=369349)



Stats help - Korisnik - 16.08.2012

I have problems with counting kills and deaths. When I put number of kills in my scriptfiles it load it IG, but dont count when i kill somebody or get killed.

here is the cmd:
Код:
CMD:stats(playerid, params[])
{
	new stats[300];
	format(stats, sizeof(stats), " Level: %d \n Ubistva: %d \n Smrti: %d \n Novac: %d \n Banka: %d \n Admin level: %d", PlayerInfo[playerid][Rank], PlayerInfo[playerid][Ubistva], PlayerInfo[playerid][Smrti], PlayerInfo[playerid][Novac], PlayerInfo[playerid][Banka], PlayerInfo[playerid][Admin]);
	ShowPlayerDialog(playerid, 520, DIALOG_STYLE_MSGBOX, "Statistika", stats, "OK", "");
	return 1;
}
and there is counting:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new skor;
	SendDeathMessage(killerid, playerid, reason);
	skor = GetPlayerScore(killerid);
	SetPlayerScore(killerid, skor + 1);
	GivePlayerMoney(playerid, -300);
	GivePlayerMoney(killerid, 500);
	PlayerInfo[killerid][Ubistva] ++;
	PlayerInfo[playerid][Smrti] ++;
	return 1;
}