PDA

View Full Version : [FilterScript] [FS] Anti Spawner


Ipuvaepe
24/02/2008, 07:59 PM
Basically, this is a cheesy script that prevents banned vehicles from being spawned.


#include <a_samp>
#define FILTERSCRIPT
public OnFilterScriptInit() { return 1; }
public OnFilterScriptExit() { return 1; }
public OnVehicleSpawn(vehicleid)
{
new model = GetVehicleModel(vehicleid);
if(model==521||model==520||model==406||model==432| |model==444||model==539||model==556||model==557) { DestroyVehicle(vehicleid); return 1; }
return 1;
}


Current disallowed vehicles:
FCR-900 { 521 } - Added v0.1
Hydra { 520 } - Added v0.1
Dumper { 406 } - Added v0.1
Rhino { 432 } - Added v0.1
Monster { 444 } - Added v0.1
Monster "A" { 556 } - Added v0.1.2
Monster "B" { 557 } - Added v0.1.2


Version 0.1 Source
http://rapidshare.com/files/94613135/IpuvaepeAntiSpawnHackv0.1.pwn.html (http://rapidshare.com/files/94613135/IpuvaepeAntiSpawnHackv0.1.pwn.html)

Version 0.1 AMX
http://rapidshare.com/files/94613379/IpuvaepeAntiSpawnHackv0.1.amx.html (http://rapidshare.com/files/94613379/IpuvaepeAntiSpawnHackv0.1.amx.html)


Version 0.2 Source
http://rapidshare.com/files/94614906/IpuvaepeAntiSpawnHackv0.2.pwn.html (http://rapidshare.com/files/94614906/IpuvaepeAntiSpawnHackv0.2.pwn.html)

Version 0.2 AMX
http://rapidshare.com/files/94614898/IpuvaepeAntiSpawnHackv0.2.amx.html (http://rapidshare.com/files/94614898/IpuvaepeAntiSpawnHackv0.2.amx.html)

I in no way claim that this is advanced and/or useful, however I do believe that it could have some use, and is therefore not completely useless.

ToggleThreadFlaming(MAX_POSTERS,0);

Next is a menu with 10 spots on it, can edit the list in game. (WILL NOT SAVE)

Sinces
24/02/2008, 08:02 PM
Yes this can be useful for stopping admins to spawn Disallowed Vehicles. :)

Thanks.

Kind Regards Sinces.

FujiNNN
24/02/2008, 09:59 PM
very nice man!

weedarr
24/02/2008, 10:13 PM
Its more a snippet than a script...

WeeDarr

Noddi3
28/10/2009, 05:43 AM
Sorry about this bump but i get error when trying to compile.
ERROR: error 029: invalid expression, assumed zero
On line 8 (error line): if (model==425||model==520||model==469||model==432|) {DestroyVehicle(vehicleid); return 1;}

Sergei
28/10/2009, 07:54 AM
This would only work with CreateVehicle since only those vehicles can be later destroyed with DestroyVehicle. And start using switch instead of if in such cases because it's easier to be written and it is faster.
And yes, this isn't filterscript, but simple snippet.

#include <a_samp>
#define FILTERSCRIPT
public OnFilterScriptInit() { return 1; }
public OnFilterScriptExit() { return 1; }
public OnVehicleSpawn(vehicleid)
{
new model = GetVehicleModel(vehicleid);
switch(model)
{
case 521,520,406,432,444,539,556,557: DestroyVehicle(vehicleid);
}
return 1;
}