[y_commands] /help command.
#1

Hello. I wonder if anyone knows if there is a function for it to scan through all commands and return true/false if the command doesn't exist?

E.g.
pawn Код:
/help test

/test doesn't exist.
pawn Код:
if(!Command_Exists(test)) return SendClientMessage(playerid, -1, "Command doesn't exist");
Reply
#2

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "command doesn't exist" );
    return 1;
}
Reply
#3

Already have that written. But in order to do that I have to process the command through the system again. I would like to check it without processing...

if(Command_ReProcess(playerid,params,false)) doesn't work.
Reply
#4

You're talking about OnPlayerCommandReceived, but for some reason i can't find any wiki documentation about it..
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(LoggedIn[playerid] ==0)return SendClientMessage(playerid,-1,"you need to login to try a command");
    if(Var[playerid] ==0)return SendClientMessage(playerid,-1,"the command you typed stopped here and didn't get performed");
    return 1;//This call back returns 1.
}
Reply
#5

says the function isn't implented....
Reply
#6

Is there any way to copy the function so this will work without destroying the original function?

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[])
{
    return success/fail;
}
Reply
#7

Thank you!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)