[FilterScript] Destroy Road Objects [0.3d]
#1

The script will destroy some road objects (traffic lights, poles, lanterns, fountains).

Timer: 10 seconds
Radius: 300 meter

Source:
Код:
#include <a_samp>
#define local new

local objects[] = {1211,1223,1226,1231,1232,1283,1284,1290,1294,1295,1296,1297,1298,1315,1350,1351,1352,1366,1568,3460,3463,3516,3853,3855};

public OnFilterScriptInit()
{
	SetTimer("DestroyBadObjects", 10000, 1);
	return 1;
}

forward DestroyBadObjects();
public DestroyBadObjects()
{
	for(new i=0; i<MAX_PLAYERS; i++)
 	{
  		for(local ob=0; ob<sizeof(objects);ob++)
		{
   			local Float:px,Float:py,Float:pz;
			GetPlayerPos(i, px, py, pz);
		        RemoveBuildingForPlayer(i, objects[ob], px, py, pz, 300.0);
		}
	}
	return 1;
}
Author - Soup_Mc a.k.a SeeeCa

PS - Sorry for my bad english, i'm from Russia.
Reply
#2

EDIT; GJ
Reply
#3

pawn Код:
#include <a_samp>

new objects[] = {1211,1223,1226,1231,1232,1283,1284,1290,1294,1295,1296,1297,1298,1315,1350,1351,1352,1366,1568,3460,3463,3516,3853,3855};

public OnPlayerConnect(playerid)
{
    for(new ob=0; ob<sizeof(objects);ob++)
    {
        RemoveBuildingForPlayer(playerid, objects[ob], 0.0, 0.0, 0.0, 6000.0);
    }
    return 1;
}
Reply
#4

why not ongamemodeinit?

also I'm sure there are alot more road objects
Reply
#5

Would be more at home in the usefull snippets/functions thread i think.

@kar the function must be applied each time a player connects (at least when the player is online) it won't work in OnGamemodeInit.
Reply
#6

Quote:
Originally Posted by Kar
Посмотреть сообщение
why not ongamemodeinit?

also I'm sure there are alot more road objects
this faction remove an object only for a single player,
if you will put it under ongamemodeinit.
it will not remove any object, because there is no players when the gamemode starts

btw nice & simple but can you show as what does it remove?(with SS(ScreenShot))
Reply
#7

0.3d?
Reply
#8

Why do you make a timer? It is a waste, just remove all the objects when player connects or spawns.
Reply
#9

Quote:
Originally Posted by MaTrIx4057
Посмотреть сообщение
Why do you make a timer? It is a waste, just remove all the objects when player connects or spawns.
/facepalm -.-'
xd
Reply
#10

RemoveBuildingForPlayer will remove building for specific player.
If you use these function on gamemode init you will remove building for all connected players when gamemode init is called (its mean count will be 0)

These function is best to use on player connect or on player spawn/request spawn/request class (can be used to)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)