[HELP] ID:0 problem...
#1

hi,

I have a command which used for getting a player's stats. But, i have two commands:

"/my stats" and "/getstats [ID]".

If ID:0 types "/getstats 0" it shows an error like "use /my stats to see your own stats", and, if ID:0 types "/getstats 1" (or 2,3,4...), it still shows that error. This command works for other players, but doesn't work for id 0.

Here is the error code:

pawn Код:
if(ReturnPlayer == playerid) return SendClientMessage(playerid, mbrightred, "Use /my stats to see your own stats.");
Can anyone help?
Reply
#2

Can't help without the full code (whole cmd).
Reply
#3

pawn Код:
dcmd_getstats(playerid, params[])
{
    new ReturnPlayer, ReturnUserName[24], ReturnPlayerFile[50], str[256], pDeaths[50], pKills[50], pDuelDeaths[50], pDuelKills[50], pMadnesswin[50];

    if(sscanf(params, "d", ReturnPlayer)) return SendClientMessage(playerid, mwhite, "Usage: /getstats [playerid]");

    if(ReturnPlayer == playerid) return SendClientMessage(playerid, mbrightred, "Use /my stats to see your own stats.");

    GetPlayerName(ReturnPlayer, ReturnUserName, sizeof(ReturnUserName));
    format(ReturnPlayerFile, sizeof(ReturnPlayerFile), "/users/%s.ini", ReturnUserName);

    if(!IsPlayerConnected(ReturnPlayer)) return SendClientMessage(playerid, mbrightred, "Invalid player ID.");
    if(!dini_Exists(ReturnPlayerFile)) return SendClientMessage(playerid, mbrightred, "This player is an unregistered player.");

    if(dini_Exists(ReturnPlayerFile))
    {
.
.
.
        }
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)