SA-MP Forums Archive
[HELP]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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Stats (/showthread.php?tid=120707)



[HELP]Stats - Remba - 12.01.2010

I made some kind of stats(not working).I was wondering if you guys could help.I need this for my server.
I want something like when a player hit /stats it says:His name,money,team,weapons(not needed).
So i made this and it only shows cash.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/stats",cmdtext,true, 10) == 0)
{
new name[MAX_PLAYER_NAME],string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Money:$%i Name:%s", GetPlayerMoney(playerid));
SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}


Re: [HELP]Stats - SiJ - 12.01.2010

Quote:
Originally Posted by Remba
I made some kind of stats(not working).I was wondering if you guys could help.I need this for my server.
I want something like when a player hit /stats it says:His name,money,team,weapons(not needed).
So i made this and it only shows cash.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/stats",cmdtext,true, 10) == 0)
{
new name[MAX_PLAYER_NAME],string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Money:$%i Name:%s Team:%d", GetPlayerMoney(playerid),name,GetPlayerTeam(player id));
SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}
Does it works now?


Re: [HELP]Stats - Remba - 12.01.2010

Thank you it works.Only team shows "255" xD
But i won't bother you.You can fix that only if you want.


Re: [HELP]Stats - Correlli - 12.01.2010

Quote:
Originally Posted by Remba
Thank you it works.Only team shows "255" xD
It means that player isn't in any team.


Re: [HELP]Stats - Remba - 12.01.2010

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Remba
Thank you it works.Only team shows "255" xD
It means that player isn't in any team.
OK Thanks alot!


Re: [HELP]Stats - SiJ - 12.01.2010

Quote:
Originally Posted by Remba
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Remba
Thank you it works.Only team shows "255" xD
It means that player isn't in any team.
OK Thanks alot!
For GetPlayerTeam to work, you must use SetPlayerTeam too :P


Re: [HELP]Stats - Remba - 12.01.2010

Quote:
Originally Posted by SiJ
Quote:
Originally Posted by Remba
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Remba
Thank you it works.Only team shows "255" xD
It means that player isn't in any team.
OK Thanks alot!
For GetPlayerTeam to work, you must use SetPlayerTeam too :P
I did that