SA-MP Forums Archive
Problem with FS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with FS (/showthread.php?tid=246907)



Problem with FS - ColdIce - 06.04.2011

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?!


Re: Problem with FS - Medal Of Honor team - 06.04.2011

what is the problem?


Re: Problem with FS - aircombat - 06.04.2011

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


Re: Problem with FS - ColdIce - 06.04.2011

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?


Re: Problem with FS - Biesmen - 06.04.2011

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


Re: Problem with FS - BizzyD - 06.04.2011

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.


Re: Problem with FS - ColdIce - 06.04.2011

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?


Re: Problem with FS - RoboN1X - 06.04.2011

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.).



Re: Problem with FS - ColdIce - 06.04.2011

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


Re: Problem with FS - Biesmen - 06.04.2011

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


Re: Problem with FS - ColdIce - 06.04.2011

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?


Re: Problem with FS - ColdIce - 07.04.2011

?


Re: Problem with FS - SchurmanCQC - 07.04.2011

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