Command adding
#1

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;
}
Reply
#2

use zcmd
Reply
#3

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.
Reply
#4

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

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

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

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;
}
Reply
#8

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.
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)