Vehicles - 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)
+--- Thread: Vehicles (
/showthread.php?tid=522906)
Vehicles -
babecka - 29.06.2014
Hello everyone! I have this code under OnGameModeInit:
Код:
CreateVehicle(415, -1605.1000000, 651.4000200, 7.0000000, 0.0000000, 0, 0, -1);
CreateVehicle(415, -1594.1000000, 674.0000000, 7.0000000, 180.0000000, 0, 0, -1);
It should add 2 Cheetahs in-game, however, whenever I connect and spawn, the vehicles spawn and 1 vehicle spawn above them. So 4 vehicles spawn in total.
I'm not sure why, I checked my code and I do not have duplicate lines or anything, maybe it is a bug? Help me, please!
EDIT 0: I've added the lines to the OnPlayerSpawn public and It worked, so there must be a problem with OnGameModeInit. It probably has been called twice or something, I'm not sure. Someone got an idea why this happens?
EDIT 1: I've managed to fix the problem. There was something wrong with main() being not able to be executed.
Re : Vehicles -
Clad - 29.06.2014
This is the code to spawn a vehicle and you're using it well.
pawn Код:
(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
Make sure you don't have a filterscript which spawns vehicles, Or another file which spawns vehicles.