Help me stats command - 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: Help me stats command (
/showthread.php?tid=448596)
Help me stats command -
xganyx - 05.07.2013
i have this :
Код:
CMD:stats(playerid,params[])
{
new Admin = PlayerInfo[playerid][pAdmin];
new Cash = PlayerInfo[playerid][pCash];
new Score = GetPlayerScore(playerid);
new Kills = PlayerInfo[playerid][pKills];
new Deaths = PlayerInfo[playerid][pDeaths];
new str[128];
format(str,sizeof(str),"{00FF22}Admin: %d\n{00FF22}Cash: %d\n{00FF22}Score: %d\n{00FF22}Kills: %d\n{00FF22}Deaths: %d",Admin,Cash,Score,Kills,Deaths);
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Your Account",str,"OK","");
return 1;
}
but when i'm going to server the stats just right admin is level 1338 and cash score kills deaths everything just zero why ?
Re: Help me stats command -
Guest123 - 05.07.2013
can you show your first variable like
edit: use this
pawn Код:
CMD:stats(playerid,params[])
{
new Admin = PlayerInfo[playerid][pAdmin];
new Cash = PlayerInfo[playerid][pCash];
new Score = GetPlayerScore(playerid);
new Kills = PlayerInfo[playerid][pKills];
new Deaths = PlayerInfo[playerid][pDeaths];
new str[128];
format(str,sizeof(str),"{00FF22}Cash: %d\nAdmin: %d\n{00FF22}Score: %d\n{00FF22}Kills: %d\n{00FF22}Deaths: %d",Cash,Admin,Score,Kills,Deaths);
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Your Account",str,"OK","");
return 1;
}
Re: Help me stats command -
xganyx - 05.07.2013
here :
Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
}
Re: Help me stats command -
[HiC]TheKiller - 05.07.2013
Where do you set these variables? Could you please post that code?
Re: Help me stats command -
Guest123 - 05.07.2013
pawn Код:
enum pInfo
{
pAdmin,
pCash,
pKills,
pDeaths,
pPass
}
Re: Help me stats command -
xganyx - 05.07.2013
Quote:
Originally Posted by Guest123
pawn Код:
enum pInfo { pAdmin, pCash, pKills, pDeaths, pPass }
|
yes i have that but my money is 10000$ when in game i type /stats it have 0 money only the admin 1338 is right
Re: Help me stats command -
[HiC]TheKiller - 05.07.2013
Yep, sweet, but could you please show us where the variable PlayerInfo[playerid][pCash] is actually being set to a specific value. It does not magically set itself
.