14.06.2011, 07:53
Hi, here's another tutorial made by me.
I think this could be usefull to beginners, because in the beginning, I didn't know what the difference was between those functions (except that the names are different and some parameters are different).
AddStaticVehicle
This function will only work in the OnGameModeInit and OnFilterScriptInit. As the function name says: "Add Static Vehicle". You can't add vehicle (eg. a vehicle spawner) with this function.
With this function you can add trains, which is impossible with CreateVehicle. The respawn time for vehicles with this function is (as far as I know, I ever read it somewhere) 15 minutes.
AddStaticVehicleEx
This function is almost the same as AddStaticVehicle. The only difference is that you can give the respawn time yourself.
This is the most usefull for RP servers, because you can set the respawn time to '-1'. That means that it won't be respawned untill it'll die (exploded, in water etc.). [It's non-RP that it respawns o_O]
CreateVehicle
This one can be called at any time. For a vehicle spawner you must use this one, otherwise it won't work. The only bad thing of this function is that train's won't work.
Conclusion
AddStaticVehicle is usefull for trains, but can only be used in On[GameMode/FilterScript]Init. CreateVehicle can be called at any time, but doesn't support trains and trams
Well, it's short, but that doesn't matter. That's only easier to read
Regards,
Kevin
I think this could be usefull to beginners, because in the beginning, I didn't know what the difference was between those functions (except that the names are different and some parameters are different).
AddStaticVehicle
This function will only work in the OnGameModeInit and OnFilterScriptInit. As the function name says: "Add Static Vehicle". You can't add vehicle (eg. a vehicle spawner) with this function.
With this function you can add trains, which is impossible with CreateVehicle. The respawn time for vehicles with this function is (as far as I know, I ever read it somewhere) 15 minutes.
AddStaticVehicleEx
This function is almost the same as AddStaticVehicle. The only difference is that you can give the respawn time yourself.
This is the most usefull for RP servers, because you can set the respawn time to '-1'. That means that it won't be respawned untill it'll die (exploded, in water etc.). [It's non-RP that it respawns o_O]
CreateVehicle
This one can be called at any time. For a vehicle spawner you must use this one, otherwise it won't work. The only bad thing of this function is that train's won't work.
Conclusion
AddStaticVehicle is usefull for trains, but can only be used in On[GameMode/FilterScript]Init. CreateVehicle can be called at any time, but doesn't support trains and trams
Well, it's short, but that doesn't matter. That's only easier to read
Regards,
Kevin