Unknown Command for ID 25+
#1

Fixed.
Reply
#2

Check your code, maybe somewhere there is
Код:
#define MAX_PLAYERS 25
Reply
#3

Lmfao, nope.
Reply
#4

It is better change your commands to these ones .


pawn Код:
CMD:stats(playerid, params[])
{
    #pragma unused params
    ShowPlayerStats(playerid, playerid);
    return true;
}



CMD:check(playerid, params[])
{
    #pragma unused params
    new giveplayerid;
    if(IsAdmin(playerid,1))
    {
        if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "{F3FF02}USAGE:{33AA33} /check [playerid]");
        ShowPlayerStats(playerid, giveplayerid);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use this command !");
    }
    return true;
}

You said only these commands are sending the Unknown Command message , so, you have to put the ShowPlayerStats function here in the thread .


I hope that i have helped .
Reply
#5

It proprably has something to do with the ShowPlayerStats function. Could you show us the code?
Reply
#6

Btw, your "check" command wouldn't work

UPD:
pawn Код:
CMD:check(playerid, params[])
{
    if(IsNull(params)) return SendClientMessage(playerid, COLOR_GREY, "{F3FF02}USAGE:{33AA33} /check [playerid]");
    if(IsAdmin(playerid, 1))
    {
        new giveplayerid = strval(params);
        if(IsPlayerConnected(giveplayerid)) ShowPlayerStats(playerid, giveplayerid);
        else SendClientMessage(playerid, COLOR_GREY, " Player is not online");
    }
    else SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use this command !");
    return true;
}
Reply
#7

What are you talking about? It does work...Just not for Player ID 25+.
Anyway, Topic updated.
Reply
#8

pawn Код:
new name[MAX_PLAYER_NAME];
        new string[128];
        name = pName(targetid);
        if (name[targetid] == '_')
        name[targetid] = ' ';
MAX_PLAYER_NAME is 24 so if U have ID 25+
pawn Код:
if (name[targetid] == '_')
name[targetid] = ' ';
then array is crash and gives unknown command
btw
pawn Код:
COMMAND:check(playerid,params[])
{
    new giveplayerid;
    if(IsPlayerConnected(giveplayerid))
    {
giveplayerid returns 0 here so if ID 0 is not connected command dont work xd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)