2 filterscripts breaking eachother.
#1

Hello, I've got my own filterscript, Teleport - And another filterscript for spawning car's trough a menu.
But on my server.cfg file, when I do this:

filterscripts Teleport CarMenu - The CarMenu breaks, but if I do this:

filterscripts CarMenu Teleport - The Teleport menu breaks.
Reply
#2

Just change dialog ids in one of the filterscripts
Reply
#3

Okay, I will try that.
Reply
#4

I tried but it didn't do anything.
Reply
#5

This is my Teleport code:

pawn Код:
#include <a_samp>

#define FILTERSCRIPT
#define DIALOGID 3700

public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/tp", cmdtext, true, 10) == 0)
        {
            ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport", "Mount Chillad\nHigh House", "Go", "Cancel");
        }
        return 1;
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
            if(listitem == 0)
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, -2317.7593,-1634.1985,483.7031);
                SendClientMessage(playerid, 0x00FFFFAA, "You've been teleported to Mount Chillad.");
            }
            if(listitem == 1)
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 1549.2537,-1353.4073,329.4670);
                SendClientMessage(playerid, 0x00FFFFAA, "You've been teleported to High House.");
            }
    }

The CarMenu addon is from: https://sampforum.blast.hk/showthread.php?tid=125683
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tp", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Teleport", "Mount Chillad\nHigh House", "Go", "Cancel");
        return 1;
    }
    return 1;
}
Reply
#7

Thank you. I'll report back if it doesn't work.
Reply
#8

Well, the dialog shows up, but when I press like "Mount Chillad" and then press "Go" nothing happens.
Reply
#9

return 0; at OnDialogResponse
Reply
#10

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
            if(listitem == 0)
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, -2317.7593,-1634.1985,483.7031);
                SendClientMessage(playerid, 0x00FFFFAA, "You've been teleported to Mount Chillad.");
            }
            if(listitem == 1)
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 1549.2537,-1353.4073,329.4670);
                SendClientMessage(playerid, 0x00FFFFAA, "You've been teleported to High House.");
            }
    }
Thats because it doesnt work
You have to check the dialogid first, before continuing.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if( dialogid == DIALOGID ) // when the dialogid is the same as 'DIALOGID'
    {
        if( response ) // if the player pressed the first button
        {
            if(listitem == 0) // first button + first listitem
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, -2317.7593,-1634.1985,483.7031);
                SendClientMessage(playerid, 0x00FFFFAA, "You've been teleported to Mount Chillad.");
            }
            if(listitem == 1)
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, 1549.2537,-1353.4073,329.4670);
                SendClientMessage(playerid, 0x00FFFFAA, "You've been teleported to High House.");
            }
        }
        else // when player presses second button
        {
       
        }
    }
    if( dialogid == DIALOGID2 ) // this will be a second dialog just for example
    {
   
    }
    return 0; // return 1; if its in your gamemode
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)