Command that returns SERVER: Unknown Command.
#1

This command:

pawn Код:
COMMAND:rank(playerid,params[])
{
    new string[128];
    {
        new p,s;
        SendClientMessage(playerid,LIME,"Players Ranks");
        GetPlayerAllRanks(playerid,p,s);
        if(p != INVALID_RANK_ID)
        {
            format(string,sizeof(string),"Police Rank: %s",GetPlayerPoliceRankName(playerid));
            SendClientMessage(playerid,LIME,string);
        }
        if(s != INVALID_RANK_ID)
        {
            format(string,sizeof(string),"S.W.A.T Rank: %s",GetPlayerSwatRankName(playerid));
            SendClientMessage(playerid,LIME,string);
        }
    }
    return 1;
}
But, it comes up

Player Ranks
SERVER: Unknown Command
Reply
#2

you've forgotten your sscanf
Reply
#3

I know what I forgot! #pragma unused params

EDIT: No that didn't work
Reply
#4

if i'm not wrong the function GetPlayerAllRanks(playerid,p,s); returns 0 ...
Reply
#5

pawn Код:
stock GetPlayerAllRanks(playerid,&police,&swat)
{
    police = pRank[playerid][p_police_rank];
    swat = pRank[playerid][p_swat_rank];
}
??
Reply
#6

hmm the code is all right..

try first
pawn Код:
stock GetPlayerAllRanks(playerid,&police,&swat)
{
    police = pRank[playerid][p_police_rank];
    swat = pRank[playerid][p_swat_rank];
    return 1;
}
and if this doesn't work.. maybe try to disable this command and debug your code.
Reply
#7

Nope didn't work. :S
Reply
#8

well I think there's something wrong with

GetPlayerAllRanks(playerid,p,s);

or

GetPlayerPoliceRankName(playerid)

so paste those codes
Reply
#9

Quote:
Originally Posted by cessil
well I think there's something wrong with

GetPlayerAllRanks(playerid,p,s);

or

GetPlayerPoliceRankName(playerid)

so paste those codes
Brain off
Reply
#10

I cant give out too much code, but I found another way around it. All thanks go to you who helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)