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



Offline Player Stats - Twiix - 20.07.2016

Hello, i want Offline Player Stats, Here's my Stats CMD

Код:
function:ShowPlayerStats(playerid, playerid2)
{
	if(playerid2 == INVALID_PLAYER_ID) return 1; //Do not proceed.

	new string[1000], string2[256];

	format(string2, 256, ""YELLOW"%s(%d)\n\nGeneral:\n", GetName(playerid2), playerid2);
	strcat(string, string2);
	strcat(string, ""GREY"");
	format(string2, 556, ""WHITE"- Logged In: %d\n", PlayerInfo[playerid2][pLoggedIn]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Admin: %d\n", PlayerInfo[playerid2][pAdmin]); strcat(string, string2);
	format(string2, 556, ""WHITE"- VIP: %d "YELLOW"\n\n", PlayerInfo[playerid2][pVIP]); strcat(string, string2);
	format(string2, 556, ""YELLOW"Scores:\n"); strcat(string, string2);
	format(string2, 556, ""WHITE"- PlayTime Score: %d\n", PlayerInfo[playerid2][pPTScore]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Freeroam Score: %d\n", PlayerInfo[playerid2][pFRScore]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Deathmatch Score: %d\n", PlayerInfo[playerid2][pDMScore]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Race Score: 0\n"); strcat(string, string2);
	format(string2, 556, ""WHITE"- Football Goals: %d\n", PlayerInfo[playerid2][pFBScore]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Total Score: %d "YELLOW"\n\n", GetPlayerScore(playerid2)); strcat(string, string2);
	format(string2, 556, ""YELLOW"Misc:\n"); strcat(string, string2);
	format(string2, 556, ""WHITE"- Godmode: %d\n", PlayerInfo[playerid2][pGod]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Skin: %d\n", GetPlayerSkin(playerid2)); strcat(string, string2);
	format(string2, 556, ""WHITE"- Money: %d\n", GetPlayerMoney(playerid2)); strcat(string, string2);
	format(string2, 556, ""WHITE"- Active: %d\n", PlayerInfo[playerid2][pActive]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Ping: %d "YELLOW"\n\n", GetPlayerPing(playerid2)); strcat(string, string2);
	format(string2, 556, ""YELLOW"Weapons:\n"); strcat(string, string2);
	format(string2, 556, ""WHITE"- Assault Rifle: %d\n", PlayerInfo[playerid2][pAssault]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Submachine Gun: %d\n", PlayerInfo[playerid2][pSubmachine]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Shotgun: %d\n", PlayerInfo[playerid2][pShotgun]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Pistol: %d\n", PlayerInfo[playerid2][pPistol]); strcat(string, string2);
	format(string2, 556, ""WHITE"- Melee Weapon: %d "YELLOW"\n\n", PlayerInfo[playerid2][pMelee]); strcat(string, string2);

	ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, ""YELLOW"UG - Player Statistics", string, "Close", "");
	return 1;
}
Thanks for who will help me, i'll apperciate it.



Re: Offline Player Stats - Logic_ - 20.07.2016

Which saving system are you using? dini or y_ini or dini2?


Re: Offline Player Stats - Twiix - 20.07.2016

Y_INI


Re: Offline Player Stats - GuyB790 - 20.07.2016

Just add a possibility to look it up by name (or however you name the player's INI file). Add a check to see if the file exists or not, if it does then display the details by reading the file.