Dialog command servers not even picking up
#1

I created a command called /findlocation and a dialog is ment to pop up and list all these places, and once you click on one, it creates a checkpoint. I finished the filterscript fine and then added it into the server.cfg file and when I go in game, nothing happens when I type the command?

Heres my filterscript.

Код:
#define FILTERSCRIPT

#include <a_samp>
#include <sscanf2>
#include <zcmd>

#if defined FILTERSCRIPT

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/findlocation", true) == 0)
	{
		ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST, "Locations List", "Mechanic Job \n Private Investigator Job \n Arms Dealer Job \n Deliverer Job \n Drug Smuggler Job \n Lawyer Job \n Guard Job \n Dealership \n Bank", "Select", "Cancel");
		return 1;
	}
	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 13)
	{
		if(response)
		{
			new message[256+1];
			if(listitem == 0)
			{
				format(message, 256, "A checkpoint has been placed at the Mechanic Job", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid, -2042.6096,140.3117,28.8359, 3.0);
 			}
			if(listitem == 1)
			{
				format(message, 256, "A checkpoint has been placed at the Private Investigator Job", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid, -1926.5458,556.8484,35.1719, 3.0);
 			}
			if(listitem == 2)
			{
				format(message, 256, "A checkpoint has been placed at the Arms Dealer Job", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid, -2135.8574,433.7958,35.1719, 3.0);
 			}
			if(listitem == 3)
			{
				format(message, 256, "A checkpoint has been placed at the Deliverer Job", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid,-1720.1917,-127.8648,3.5489, 3.0);
 			}
			if(listitem == 4)
			{
				format(message, 256, "A checkpoint has been placed at the Drug Smuggler Job", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid, -2104.4661,140.1358,35.0786, 3.0);
 			}
			if(listitem == 5)
			{
				format(message, 256, "A checkpoint has been placed at the Lawyer Job", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid, -1703.3636,779.6036,24.8906, 3.0);
 			}
			if(listitem == 6)
			{
				format(message, 256, "A checkpoint has been placed at the Guard Job!", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid, -1979.4202,170.3983,27.6875, 3.0);
 			}
			if(listitem == 7)
			{
				format(message, 256, "A checkpoint has been placed at the Car Dealership", listitem);
		  		SendClientMessage(playerid, 0xFFFFFFFF, message);
		  		SetPlayerCheckpoint(playerid, -1957.5217,294.6539,35.4688, 3.0);
 			}
			if(listitem == 8)
			{
	  			format(message, 256, "A checkpoint has been placed at the bank", listitem);
	  			SendClientMessage(playerid, 0xFFFFFFFF, message);
  				SetPlayerCheckpoint(playerid, -1961.2853,441.0911,35.1719, 3.0);
     			return 1;
  			}
		}
	}
	return 1;
}
Thanks in advance
Reply
#2

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <sscanf2>
#include <zcmd>

#if defined FILTERSCRIPT

#endif

CMD:findlocation(playerid,params[])
{
        ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST, "Locations List", "Mechanic Job \n Private Investigator Job \n Arms Dealer Job \n Deliverer Job \n Drug Smuggler Job \n Lawyer Job \n Guard Job \n Dealership \n Bank", "Select", "Cancel");
        return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 13)
    {
        if(response)
        {
            new message[256+1];
            if(listitem == 0)
            {
                format(message, 256, "A checkpoint has been placed at the Mechanic Job", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -2042.6096,140.3117,28.8359, 3.0);
            }
            if(listitem == 1)
            {
                format(message, 256, "A checkpoint has been placed at the Private Investigator Job", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -1926.5458,556.8484,35.1719, 3.0);
            }
            if(listitem == 2)
            {
                format(message, 256, "A checkpoint has been placed at the Arms Dealer Job", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -2135.8574,433.7958,35.1719, 3.0);
            }
            if(listitem == 3)
            {
                format(message, 256, "A checkpoint has been placed at the Deliverer Job", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid,-1720.1917,-127.8648,3.5489, 3.0);
            }
            if(listitem == 4)
            {
                format(message, 256, "A checkpoint has been placed at the Drug Smuggler Job", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -2104.4661,140.1358,35.0786, 3.0);
            }
            if(listitem == 5)
            {
                format(message, 256, "A checkpoint has been placed at the Lawyer Job", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -1703.3636,779.6036,24.8906, 3.0);
            }
            if(listitem == 6)
            {
                format(message, 256, "A checkpoint has been placed at the Guard Job!", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -1979.4202,170.3983,27.6875, 3.0);
            }
            if(listitem == 7)
            {
                format(message, 256, "A checkpoint has been placed at the Car Dealership", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -1957.5217,294.6539,35.4688, 3.0);
            }
            if(listitem == 8)
            {
                format(message, 256, "A checkpoint has been placed at the bank", listitem);
                SendClientMessage(playerid, 0xFFFFFFFF, message);
                SetPlayerCheckpoint(playerid, -1961.2853,441.0911,35.1719, 3.0);
                return 1;
            }
        }
                return 1; // i think heres the mistake
    }
    return 1;
}
Use ZCMD and when u include zcmd onplayercommandtext doesnt work ...
Reply
#3

at the end of each list item, u need 2 put return 1; and right be4 u close the function, u type: return 0;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)