AddStaticVehicleEx - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AddStaticVehicleEx (
/showthread.php?tid=256370)
AddStaticVehicleEx -
JackYack13 - 20.05.2011
What's the deal with AddStaticVehicleEx? In the wiki it says it only works when used in OnGameModeInit, but I have it in a command, something like this:
pawn Код:
CMD:train(playerid, params[]){
//some code
AddStaticVehicleEx(538, x, y, z, a, -1, -1, -1);
//some other code
}
ID 538 is a train, which obviously can't be spawned with CreateVehicle. But I just used AddStaticVehicleEx in a command and it works perfectly fine. When I'm somewhere near the tracks and use /train, it spawns on the tracks and I can get in and drive it and all that. I can even get rid of it with DestroyVehicle even though I read somewhere that it wasn't possible to use that on vehicles created with AddStaticVehicleEx.
So why does the wiki tell me that AddStaticVehicleEx only works in OnGameModeInit, when it actually works fine elsewhere? Is it because I'm using ZCMD or something?
Re: AddStaticVehicleEx -
Blt950 - 21.05.2011
I don't think ZCMD is the problem here.
But as you described, it says
AddStaticVehicleEx works only in
OnGameModeInit(). And ZCMD is under
OnPlayerText().
The only way to fix this as I see is to make
AddStaticVehicleEx in the
OnGameModeInit().
So when the server starts, the train spawns. Spawning trains (that works) is not possible as I know.
Re: AddStaticVehicleEx -
JackYack13 - 21.05.2011
I know it says that. But I'm saying that on my server it actually DOES work under OnPlayerText. By that I mean I have AddStaticVehicleEx in the command and the train does spawn when I use that command, so from what I see it doesn't only work in OnGameModeInit..