Filterscript won't work? -
lsrgta - 07.05.2011
Hi!
I made a filterscript for some vehicles to spawn and I don't understand why it isn't working when I use the filterscript,
this is what it looks like:
pawn Код:
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
AddStaticVehicle(522,2796.0242,-1571.8405,10.4870,271.8347,1,1);
AddStaticVehicle(522,2796.1746,-1575.8713,10.4694,270.9300,1,1);
AddStaticVehicle(461,2796.1514,-1584.9053,10.5263,272.2281,1,1);
AddStaticVehicle(461,2796.1655,-1588.9225,10.5099,268.0545,1,1);
AddStaticVehicle(562,2795.9612,-1580.4926,10.5866,269.7886,0,0);
}
return 1;
}
AddStaticPickup(modelid,type,2795.5496,-1619.3833,10.9219,259.2963,0);
}
return 1;
}
if(strcmp(cmdtext,"/enter",true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,x,y,z))
{
SetPlayerPos(playerid,x,y,z);
}
}
if(strcmp(cmdtext,"/enter",true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,x,y,z))
{
SetPlayerPos(playerid,x,y,z);
}
else if (IsPlayerInRangeOfPoint(playerid,3,2795.5496,-1619.3833,10.9219,259.2963))
{
SetPlayerPos(playerid,774.213989,-48.924297,1000.585937);
SetPlayerInterior(playerid,6);
}
}
if(strcmp(cmdtext,"/exit",true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,x,y,z))
{
SetPlayerPos(playerid,x,y,z);
}
else if (IsPlayerInRangeOfPoint(playerid,3,774.213989,-48.924297,1000.585937))
{
SetPlayerPos(playerid,2795.5496,-1619.3833,10.9219,259.2963);
SetPlayerInterior(playerid,0);
}
I get no errors when compiling, but when I load it.. nothing happens
Re: Filterscript won't work? -
Ash. - 07.05.2011
Does it really compile? It shouldn't...
Re: Filterscript won't work? -
lsrgta - 07.05.2011
Yeah it does, why shouldn't it?
Re: Filterscript won't work? -
SchurmanCQC - 07.05.2011
x y z isn't defined.
Re: Filterscript won't work? -
Ash. - 07.05.2011
Well, because from what i'm looking at (it is poorly indented and so i could be wrong) after a quick glance, you are missing several brackets; and your if statements aren't even in a callback.
Re: Filterscript won't work? -
Markx - 07.05.2011
pawn Код:
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
AddStaticVehicle(522,2796.0242,-1571.8405,10.4870,271.8347,1,1);
AddStaticVehicle(522,2796.1746,-1575.8713,10.4694,270.9300,1,1);
AddStaticVehicle(461,2796.1514,-1584.9053,10.5263,272.2281,1,1);
AddStaticVehicle(461,2796.1655,-1588.9225,10.5099,268.0545,1,1);
AddStaticVehicle(562,2795.9612,-1580.4926,10.5866,269.7886,0,0);
AddStaticPickup(modelid,type,2795.5496,-1619.3833,10.9219,259.2963,0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/enter",true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,x,y,z)) // put your coordinates here! Not x, y, z!
{
SetPlayerPos(playerid,x,y,z); // same here!
}
}
if(strcmp(cmdtext,"/enter",true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,x,y,z)) //same!
{
SetPlayerPos(playerid,x,y,z); //same!
}
else if (IsPlayerInRangeOfPoint(playerid,3,2795.5496,-1619.3833,10.9219,259.2963))
{
SetPlayerPos(playerid,774.213989,-48.924297,1000.585937);
SetPlayerInterior(playerid,6);
}
}
if(strcmp(cmdtext,"/exit",true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,x,y,z)) //same!
{
SetPlayerPos(playerid,x,y,z); //same!
}
else if (IsPlayerInRangeOfPoint(playerid,3,774.213989,-48.924297,1000.585937))
{
SetPlayerPos(playerid,2795.5496,-1619.3833,10.9219,259.2963);
SetPlayerInterior(playerid,0);
}
}
return 1;
}
#endif
Change x, y,z to your coordinates!
Re: Filterscript won't work? -
lsrgta - 07.05.2011

Can someone remake it so it works?
Re: Filterscript won't work? -
lsrgta - 07.05.2011
This is what needs to be in the filterscript:
AddStaticVehicle(522,2796.0242,-1571.8405,10.4870,271.8347,1,1); // - this vehicle will be a PCJ-600(461) and colour ID 1 (white)
AddStaticVehicle(522,2796.1746,-1575.8713,10.4694,270.9300,1,1); // - this vehicle will be an FCR-900(521) and colour id 1 (white)
AddStaticVehicle(461,2796.1514,-1584.9053,10.5263,272.2281,1,1); // - this vehicle will be an FCR-900(521) and colour id 1 (white)
AddStaticVehicle(461,2796.1655,-1588.9225,10.5099,268.0545,1,1); // - this vehicle will be a PCJ-600(461) and colour ID 1 (white)
AddStaticVehicle(562,2795.9612,-1580.4926,10.5866,269.7886,0,0); // - this vehicle will be a bullet(541) and colour id 0 1 (black with white stripe)
Then also, an interior with a marker (to enter the interior) at this point:
AddPlayerClass(165,2795.5496,-1619.3833,10.9219,259.2963,0,0,0,0,0,0); //
and the interior should be:
SF gym 6 774.213989,-48.924297,1000.585937
Re: Filterscript won't work? -
Markx - 07.05.2011
Umm but it is there?
Re: Filterscript won't work? -
lsrgta - 07.05.2011
Quote:
Originally Posted by Markx
Umm but it is there?
|
can you fix it for me

?