[y_commands] /help command. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [y_commands] /help command. (
/showthread.php?tid=447128)
[y_commands] /help command. -
introzen - 28.06.2013
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");
Re: [y_commands] /help command. -
DaRk_RaiN - 28.06.2013
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
  if(!success) SendClientMessage(playerid, -1, "command doesn't exist" );
  return 1;
}
Re: [y_commands] /help command. -
introzen - 28.06.2013
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.
Re: [y_commands] /help command. -
DaRk_RaiN - 28.06.2013
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.
}
Re: [y_commands] /help command. -
introzen - 28.06.2013
says the function isn't implented....
Re: [y_commands] /help command. -
introzen - 28.06.2013
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;
}
Re: [y_commands] /help command. -
introzen - 29.06.2013
Thank you!!