Destroy Road Objects [0.3d] -
seeeca - 13.09.2011
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.
Re: Destroy Road Objects [0.3d] -
Rapgangsta - 13.09.2011
EDIT; GJ
Re: Destroy Road Objects [0.3d] -
wouter0100 - 13.09.2011
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;
}
Re: Destroy Road Objects [0.3d] -
Kar - 13.09.2011
why not ongamemodeinit?
also I'm sure there are alot more road objects
Re: Destroy Road Objects [0.3d] -
iggy1 - 13.09.2011
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.
Re: Destroy Road Objects [0.3d] -
Kaperstone - 14.09.2011
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))
AW: Destroy Road Objects [0.3d] -
Pablo Borsellino - 14.09.2011
0.3d?
Re: Destroy Road Objects [0.3d] -
MaTrIx4057 - 14.09.2011
Why do you make a timer? It is a waste, just remove all the objects when player connects or spawns.
Re: Destroy Road Objects [0.3d] -
|_ⒾⓇⓄN_ⒹⓄG_| - 14.09.2011
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
Re: Destroy Road Objects [0.3d] -
DRIFT_HUNTER - 14.09.2011
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)