2 filterscripts breaking eachother. -
persious - 08.10.2011
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.
Re: 2 filterscripts breaking eachother. -
DRIFT_HUNTER - 08.10.2011
Just change dialog ids in one of the filterscripts
Re: 2 filterscripts breaking eachother. -
persious - 08.10.2011
Okay, I will try that.
Re: 2 filterscripts breaking eachother. -
persious - 08.10.2011
I tried but it didn't do anything.
Re: 2 filterscripts breaking eachother. -
persious - 08.10.2011
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
Re: 2 filterscripts breaking eachother. -
Jafet_Macario - 08.10.2011
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;
}
Re: 2 filterscripts breaking eachother. -
persious - 08.10.2011
Thank you. I'll report back if it doesn't work.
Re: 2 filterscripts breaking eachother. -
persious - 08.10.2011
Well, the dialog shows up, but when I press like "Mount Chillad" and then press "Go" nothing happens.
Re: 2 filterscripts breaking eachother. -
Jafet_Macario - 08.10.2011
return 0; at
OnDialogResponse
Re: 2 filterscripts breaking eachother. -
Wesley221 - 08.10.2011
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
}