[HELP]Stats
#1

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;
}
Reply
#2

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?
Reply
#3

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

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

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!
Reply
#6

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
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)