Im having a problem
#1

Hello i have problem with stats command when i type /stats it shows stats of id0 even tho im id1


Код:
CMD:stats(playerid,params[])
{
    new string[1250];
    new player1;
    new name[MAX_PLAYER_NAME];
    new rankdon1[50], rankdon2[50];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    switch(PlayerInfo[player1][pDj])
	{
	    case 0: rankdon1 = "No";
	    case 1: rankdon1 = "Yes";
    }
    switch(PlayerInfo[player1][pHelper])
	{
	    case 0: rankdon2 = "No";
	    case 1: rankdon2 = "Yes";
    }
    if(IsPlayerConnected(player1))
    {
    	format(string, sizeof(string), "%s Stats of %s\n",string, name);
    	format(string, sizeof(string), "%s» Score: %s\n",string,PlayerInfo[player1][pScores]);
    	format(string, sizeof(string), "%s» Money: %d\n",string,PlayerInfo[player1][pMoney]);
     	format(string, sizeof(string), "%s» Kills: %d\n",string,PlayerInfo[player1][pKills]);
    	format(string, sizeof(string), "%s» Deaths: %d\n",string,PlayerInfo[player1][pDeaths]);
     	format(string, sizeof(string), "%s» Admin Level: %d\n",string,PlayerInfo[player1][pAdmin]);
     	format(string, sizeof(string), "%s» Reaction Tests Won: %d\n",string,PlayerInfo[player1][pReactions]);
     	format(string, sizeof(string), "%s» Total Warns: %d\n",string,PlayerInfo[player1][pWarns]);
     	format(string, sizeof(string), "%s» Total kicks: %d\n",string,PlayerInfo[player1][pKicks]);
        format(string, sizeof(string), "%s» Total bans: %d\n",string,PlayerInfo[player1][pBans]);
        format(string, sizeof(string), "%s» Trusted Player: %s\n",string,rankdon2);
        format(string, sizeof(string), "%s» DJ: %s\n",string,rankdon1);
    	ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "Player Stistics" , string,"ok","");
    }
	else
    return SendClientMessage(playerid, RED, "ERROR: Player Not Connected!");
	return 1;
}
Reply
#2

Anyone?
Reply
#3

Can you not bump after 24 minutes?
Read the rules.
Reply
#4

you could atleast help..
Reply
#5

Use sscanf instead of strval
Reply
#6

Try this
Код:
if(sscanf(params,"u",player1)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /stats [playerid]");
Reply
#7

But if i want to check my stats not someone elses i dont want to put my id.. when i use /stats it says USAGE: /stats [playerid]
Reply
#8

Quote:
Originally Posted by BrianS123
Посмотреть сообщение
Try this
Код:
if(sscanf(params,"u",player1)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /stats [playerid]");
Quote:
Originally Posted by RuNBoY
Посмотреть сообщение
But if i want to check my stats not someone elses i dont want to put my id.. when i use /stats it says USAGE: /stats [playerid]
Код:
if (sscanf(params, "u", player1)) player1 = playerid;
Reply
#9

Thanks that worked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)