Making a stats command..
#2

Код:
command(stats, playerid, params[])
{
	new string[128];
	
	format(string, sizeof(string), "Player Stats: "); // depends what you want here, nick name?
	// Look at the message below, if you want a nick name, in the speech marks, set %u to find the nick name, and after the speech marks, set the enum and fields you want to get the data from.
	TextDrawShowForPlayer(playerid, STextdraw0);
	format(string, sizeof(string), "Score: %s", pInfo[playerid][pScore]); // looks for player's score...
	TextDrawShowForPlayer(playerid, STextdraw1); // this shows the textdraw using the string above
	format(string, sizeof(string), "Kills: %s", pInfo[playerid][pKills]);
	TextDrawShowForPlayer(playerid, STextdraw2);
	format(string, sizeof(string), "Deaths: %s", pInfo[playerid][pScore]);
	TextDrawShowForPlayer(playerid, STextdraw3);
	format(string, sizeof(string), "Robberies: %s", pInfo[playerid][pRobberies]);
	TextDrawShowForPlayer(playerid, STextdraw4);
	format(string, sizeof(string), "Arrests: %s", pInfo[playerid][pArrests]);
	TextDrawShowForPlayer(playerid, STextdraw5);
	
	return 1;
}
Untested :P

For this, you need to include ZCMD in your script:
https://sampforum.blast.hk/showthread.php?tid=91354
Reply


Messages In This Thread
Making a stats command.. - by _Khaled_ - 15.09.2012, 20:57
Re: Making a stats command.. - by HighFlyer - 15.09.2012, 21:32
Re: Making a stats command.. - by _Khaled_ - 16.09.2012, 03:19
Re: Making a stats command.. - by _Khaled_ - 17.09.2012, 03:53
Re: Making a stats command.. - by clarencecuzz - 17.09.2012, 06:48
Re: Making a stats command.. - by Camacorn - 17.09.2012, 08:16
Re: Making a stats command.. - by clarencecuzz - 17.09.2012, 08:21

Forum Jump:


Users browsing this thread: 1 Guest(s)