Unknown Command
#1

Okay, I'm not sure whats up with this (You'll get rep+ if you answer)

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(checkhh,7,cmdtext);
    return 1;
}

dcmd_checkhh(playerid,params[])
{
    #pragma unused params
    if(!Admin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be logged in as an RCON administrator to perform this!");
    if(sscanf(params, "u", target)) return SendClientMessage(admin, COLOR_RED, "Correct usage -> /checkhh <playerid>");
    if(!IsPlayerConnected(target)) return SendClientMessage(admin, COLOR_RED, "ERROR: Player was not found!");
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetPlayerPos(target,X,Y,Z);
    SetPlayerPos(target,X,Y,Z+15);
    SetTimer("CheckTakenHealth",TakenHealthTime,false);
    print("CheckHH");
    return 1;
}
Reply
#2

return 0 on OnPlayerCommandText

Also I assume you have defined dcmd at the top of your script?

pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Reply
#3

Yes I did and i'll try the return 0, Thanks.

EDIT: This still isn't working.
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(checkhh,7,cmdtext);
    return 1;
}

dcmd_checkhh(playerid,params[])
{
    #pragma unused params
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be logged in as an RCON administrator to perform this!");
    if(sscanf(params, "u", target)) return SendClientMessage(admin, COLOR_RED, "Correct usage -> /checkhh <playerid>");
    if(!IsPlayerConnected(target)) return SendClientMessage(admin, COLOR_RED, "ERROR: Player was not found!");
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetPlayerPos(target,X,Y,Z);
    SetPlayerPos(target,X,Y,Z+15);
    SetTimer("CheckTakenHealth",TakenHealthTime,false);
    print("CheckHH");
    return 1;
}
Try that you mentioned the if(!Admin(playerid)) but to check for RCOn admin it is

if(!IsPlayerAdmin(playerid)) or without the !
Reply
#5

Yeah I have this:

#define Admin IsPlayerAdmin //change to your Admin script
Reply
#6

Same problem here, I made a comand but it keep saying wrong command.
Reply
#7

Delete this code:
pawn Код:
#pragma unused params
Reply
#8

Quote:
Originally Posted by Andi_Evandy
Посмотреть сообщение
Delete this code:
pawn Код:
#pragma unused params
Still not working.
Reply
#9

just try

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(checkhh,7,cmdtext);
    return 1;
}

dcmd_checkhh(playerid,params[])
{
    #pragma unused params
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be logged in as an RCON administrator to perform this!");
    if(sscanf(params, "u", target)) return SendClientMessage(admin, COLOR_RED, "Correct usage -> /checkhh <playerid>");
    if(!IsPlayerConnected(target)) return SendClientMessage(admin, COLOR_RED, "ERROR: Player was not found!");
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetPlayerPos(target,X,Y,Z);
    SetPlayerPos(target,X,Y,Z+15);
    SetTimer("CheckTakenHealth",TakenHealthTime,false);
    print("CheckHH");
    return 1;
}
And remove that #define and try it
Reply
#10

You've given the code but didn't said what the problem is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)