SA-MP Forums Archive
Command adding - 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: Command adding (/showthread.php?tid=363636)



Command adding - Goldilox - 28.07.2012

I added a command but I is not coming up, it says SERVER:UNKNOWN COMMAND

public OnPlayerCommandText(playerid, cmdtext[])
{

if(!strcmp(cmdtext, "/drinks", true))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}


Re: Command adding - LaGrande - 28.07.2012

use zcmd


Re: Command adding - Kindred - 28.07.2012

Considering you added OnFilterScriptInit, let me ask this, is it a filterscript?

That might be why, idk, never used the default command processing, but look:

Quote:
Originally Posted by SA-MP Wiki, OnPlayerCommandText
Returning 1 informs the server that the command has been processed.
OnPlayerCommandText won't be called in other scripts.



Re: Command adding - Hervest1998 - 28.07.2012

On end callback is return 0; ?
Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext,"/Commands",true))
{
return 1;
}
return 0;
}



Re: Command adding - Goldilox - 28.07.2012

Quote:
Originally Posted by LaGrande
Посмотреть сообщение
use zcmd
What is it and how can I get it?


Re: Command adding - Devilxz97 - 28.07.2012

ZCMD: https://sampforum.blast.hk/showthread.php?tid=91354


Re: Command adding - Devilxz97 - 28.07.2012

pawn Код:
#include zcmd //The Includes
   
#define DIALOG_DRINKS 7 //under include's
   
CMD:drinks(playerid, params[]) //this commands is in ZCMD Commands Processer ;D
{
    ShowPlayerDialog(playerid, DIALOG_DRINKS, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
    return 1;
}



Re: Command adding - Goldilox - 28.07.2012

Would you please elaborate it, where should I add all of them and rest?

I am sorry if I am bothering you but I just wanted to try it.


Re: Command adding - Devilxz97 - 28.07.2012

pawn Код:
CMD:drinks(playerid, params[]) //this commands is in ZCMD Commands Processer ;D
{
    ShowPlayerDialog(playerid, DIALOG_DRINKS, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
    return 1;
}
anywhere on ur script without callbacks