Help me stats command
#1

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

can you show your first variable like

pawn Код:
enum PInfo
{
    Bla2,
    Bla
}
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;
}
Reply
#3

here :
Код:
enum pInfo
{
	pPass,
	pCash,
	pAdmin,
	pKills,
	pDeaths,
}
Reply
#4

Where do you set these variables? Could you please post that code?
Reply
#5

pawn Код:
enum pInfo
{
    pAdmin,
    pCash,
    pKills,
    pDeaths,
    pPass
}
Reply
#6

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)