Problem with FS
#1

Hello, I am using couple of FS's on my stunt server. But I have a problem! For example: If I install a vehicle owner system, the registration system fucks up! And if I install neon system, my autofix goes to shit! Why is this happening?!
Reply
#2

what is the problem?
Reply
#3

they might be using the same dialog id so that's why they get conflicted
Reply
#4

Quote:
Originally Posted by aircombat
Посмотреть сообщение
they might be using the same dialog id so that's why they get conflicted
how can I fix it?
Reply
#5

By changing the dialog ids of your filterscript(s) to an unique number.
Reply
#6

Look for the dialogid in the filterscript ur using. And check if there is any dialogid in your script that is the same. Or other filterscripts.
Reply
#7

Quote:

*/
#define VEHICLE_PARAMS_UNSET -1
#define VEHICLE_PARAMS_OFF 0
#define VEHICLE_PARAMS_ON 1
#define FILTERSCRIPT
#include <a_samp>
#define TEXT 0xFF9900AA
#if defined FILTERSCRIPT
#define CAR1 1337
#define CAR2 1338
#define CAR3 1339
#define CAR4 1400
#define CAR5 1401
#define CAR6 1402
#define CAR7 1403
new engine,lights,alarm,doors,bonnet,boot,objective;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Vehicle Control By ColdIce");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/car", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid, TEXT, " You are not the driver");
return 1;
}
ShowPlayerDialog(playerid, CAR1, DIALOG_STYLE_LIST, "Vehicle Control - By ColdIce","Engine\nLights\nTrunk\nHood\nAlarm\nLock ","Choose","Close");
}
else
{
SendClientMessage(playerid, TEXT, "You are not in a vehicle");
return 1;
}
return 1;
}
return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, TEXT, "Type /car to control your vehicle");
return 1;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

if(dialogid == CAR5)
{
if(response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,V EHICLE_PARAMS_ON,boot,objective);
SendClientMessage(playerid, TEXT, "Your hood is open");
}
if(!response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,V EHICLE_PARAMS_OFF,boot,objective);
SendClientMessage(playerid, TEXT, "Your hood is closed");
}
}
if(dialogid == CAR6)
{
if(response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAM S_ON,doors,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your alarm is on");
}
if(!response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAM S_OFF,doors,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your alarm is off");
}
}
if(dialogid == CAR7)
{
if(response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE _PARAMS_OFF,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your doors are now locked");
}
if(!response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE _PARAMS_ON,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your doors are now unlocked");
}
}
if(dialogid == CAR2)
{
if(response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,al arm,doors,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your engine is on");
}
if(!response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,a larm,doors,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your engine is off");
}
}
if(dialogid == CAR3)
{
if(response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,al arm,doors,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your lights are on");
}
if(!response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,a larm,doors,bonnet,boot,objective);
SendClientMessage(playerid, TEXT, "Your lights are off");
}
}
if(dialogid == CAR4)
{
if(response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,VEHICLE_PARAMS_ON,objective);
SendClientMessage(playerid, TEXT, "Your trunk is open");
}
if(!response)
{
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,VEHICLE_PARAMS_OFF,objective);
SendClientMessage(playerid, TEXT, "Your trunk is closed");
}
}
if(dialogid == CAR1)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, CAR2, DIALOG_STYLE_MSGBOX, "Engine","Do you wanna turn on/off your engine","On","Off");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, CAR3, DIALOG_STYLE_MSGBOX, "Lights","Do you wanna turn on/off your lights","On","Off");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, CAR4, DIALOG_STYLE_MSGBOX, "Trunk","Do you wanna open/close your trunk","Open","Close");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, CAR5, DIALOG_STYLE_MSGBOX, "Hood","Do you wanna open/close your hood","Open","Close");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, CAR6, DIALOG_STYLE_MSGBOX, "Alarm","Do you wanna turn on/off your alarm","On","Off");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid, CAR7, DIALOG_STYLE_MSGBOX, "Lock","Do you wanna lock/unlock your doors","Lock","Unlock");
}
}
}
return 1;
}

Where?
Reply
#8

OnDialogResponse should return 0;

Returns Returning 0 in this callback will pass the dialog to another script in case no matching code were found in your gamemode's callback.
pawn Код:
return 0; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).
Reply
#9

I dont get it Can u copy/paste my script with the correction?
Reply
#10

It's easy, replace the last return 1; in the callback OnPlayerDialogResponse with return 0;
Reply
#11

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
It's easy, replace the last return 1; in the callback OnPlayerDialogResponse with return 0;
U mean the one at the bottom of the script?
Reply
#12

?
Reply
#13

The one at the bottom of OnDialogResponse, we can't explain it any better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)