SA-MP Forums Archive
How to get kills and deaths for /stats? - 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: How to get kills and deaths for /stats? (/showthread.php?tid=314243)



How to get kills and deaths for /stats? - ttloko2 - 29.01.2012

sup guys i made this:

Код:
dcmd_stats(playerid, params[])
{
	new name[MAX_PLAYER_NAME], str[256], ip[16];
	GetPlayerName(playerid,(name),sizeof(name));
    GetPlayerIp(playerid, ip, sizeof(ip));
	format(str, sizeof(str), "| %s Stats: Id: %i | Kills: %d | Deaths: %d | Ip: %i", name, playerid, gPlayerInfo[playerid][PLAYER_KILLS], gPlayerInfo[playerid][PLAYER_DEATHS], ip);
	SendClientMessage(playerid, COLOR_GREEN, str);
	if(gPlayerInfo[playerid][PLAYER_VIP] == 1)
	{
	SendClientMessage(playerid, COLOR_GREEN, "<|VIP|>: Yes");
	}
	else
    {
    SendClientMessage(playerid, COLOR_GREEN, "<|VIP|>: No");
	}
	return 1;
}
but kills and deaths are not showing (both 0).


Re: How to get kills and deaths for /stats? - T0pAz - 29.01.2012

It means it's place holder is 0. I see no problem in it. Show us the load part.


Re: How to get kills and deaths for /stats? - Snowman12 - 29.01.2012

I see a very big problem. When using SendClientMessage you cannot ever exceed 128 cells per string, so why on earth do you have 256 do you know how much CPU that will use?


Re: How to get kills and deaths for /stats? - ttloko2 - 29.01.2012

nvm i forgot to add the kills and deaths ++ in onplayerdeath