/stats help - 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: /stats help (
/showthread.php?tid=424210)
/stats help -
Ryan_Obeles - 21.03.2013
well my mistake of the /stats cmd i did a wrong explaination
anyway
CMD

tats(playerid, params[])
{
new string[256], string2[256], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s's Statistics", PlayerName);
format(string2, sizeof(string2), "Vip Level: %d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nMoney: %d", PlayerInfo[playerid][pVip], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pCash] );
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "Cancel");
return 1;
}
i wanted it to work like this
/stats = will show your own stats
/stats id/name = will show the dood's stats
Re: /stats help -
[ABK]Antonio - 21.03.2013
pawn Код:
CMD:stats(playerid, params[])
{
new player;
sscanf(params, "R(-1)", player);
if(player==-1) player = playerid;
new string[37], string2[128], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(player, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s's Statistics", PlayerName);
format(string2, sizeof(string2), "Vip Level: %d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nMoney: %d", PlayerInfo[player][pVip], PlayerInfo[player][pKills], PlayerInfo[player][pDeaths], PlayerInfo[player][pCash] );
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "Cancel");
return 1;
}
Try that out