07.07.2014, 12:30
(
Последний раз редактировалось BroZeus; 26.11.2017 в 13:04.
)
Extra Iterators for foreach
+Some useful functions
+Some useful functions
Current Version : v1.0
This include provides some very useful extra iterator for foreach which can be found HERE
The Iterators
The Iterator provided by this include and there description is as belowVehicles [Contains all vehicle id's create via function CreateVehicle/AddStaticVehicle/AddStaticVehicleEx]
StaticVehicle [Contains all vehicle id's create via function AddStaticVehicle/AddStaticVehicleEx on GameModeInit]
Objects [Contains all objects id's create via function CreateObject]
DynamicObjects [Contains all objects id's create via function CreateDynamicObject]
Example Usage-
here are some example of how to use them
pawn Код:
foreach(new o : Objects)
{
}
pawn Код:
foreach(new v : Vehicles)
{
}
The Functions
This include also provides some useful functions.The list of function and there description is given below-
GetTotalObjects() -- Returns the total number of objects in server
GetTotalVehicles() -- Return the total number of vehicles in server
GetTotalStaticVehicles() -- Return the total number of static vehicle in server [Note this is same as the number of vehicle models created that appear on server console when server is started]
GetTotalDynamicObjects() -- Returns the total number of Dynamic objects in server
IsStaticVehicle(vehicleid) -- Retruns true if vehicleid was created via function AddStaticVehicle/AddStaticVehicleEx on GameModeInit and false if it was not
NOTES
-->Use it in GM script only DONT use this in an FS
-->If the vehicles/objects are created via a Filter Script the this may not work according to your needs caz this keeps a track of script in which it is use-->Use it in GM script only DONT use this in an FS
Recommend Usage! Do not use FS for creating or destroing any objects/vehicles while using this include
-->Do not write "#include streamer" after writing the the include line for this[ will caz bug]
Recommend Usage!Write this include line at last of other include lines
-->If there is any include which creates Objects/Vehicles then the line of that include should be placed after the include of this line and make sure the include that are been placed after the include line of this include shouldn't have "#include <streamer>" in them if they have just simpley remove the line from them.
-->Currently the iter size of Dynamic Object is 20,000 if you have more object in server you can edit its size. Just find the line "#define MAX_DYNAMIC 20000" and edit it
Download The Script
The script can be found here -- http://pastebin.com/WZkEGQdmCredits
****** for foreach
and maybe me too?