yeah i dont see anything wrong !
it has interiors but i think ur missing the metas thats why you cannot see it maybe thats causing it ??? try a different car and see
work fine for me idk âŚ
I have the jumping issue @SorensenDK has mentioned. Say you have two players on a server, Player 1 and Player 2. The cars spawn on each of the players screens.
If Player 1 enters a vehicle and drives around, Player 2 does not see the car Player 1 is entering. Player 2 sees Player 1 spazzing out and jumping around.
The cars are only spawning locally for each client. You need to enable the isNetwork argument to true when spawning the car. However, I did that, but now it spawns multiple cars (one for each player).
Iâm thinking (to avoid multiple cars) have a variable on the clients for something like areCarsSpawned. When the script wants to spawn the cars, it will check if that variable is true or not. Once the cars spawn once, it will trigger an event on the server and then trigger an event on all clients setting that variable to true (only causing it to spawn for the first person).
That could cause issues, however. For example, if you have two people loading at the same exact time (or if you restart the resource) the script will be run at the exact same time. So it will not have enough time to trigger the events and set the variable. Another check could possibly be added in to see if the car of that type exists at the location just to avoid the 2 people connecting at once issue.
well if you can post the fix that would be cool because idk how and yes i got the same issue for the second player jumping in the car @GanjaMonster @SorensenDK
Are you talking about this ( [Release] Simple Taxi Work [UPDATED] )?
If so, I checked the code, and that doesnât even spawn any cars. It only checked if youâre in a specific vehicle.
@Antoine, I can take a look into it. It is something I would like to do in my server as well. Just never really got around to doing it.
ok cool sound good i will be in touch
Unless he released a new script (which I canât find), that script does not spawn taxis.
in one of the first version yes whit npc but its not there anymore
To spawn car you should use this script
local carmodel = GetHashKey("taxi")
RequestModel(carmodel)
while not HasModelLoaded(carmodel) do
Citizen.Wait(0)
end
car = CreateVehicle(carmodel, x,y,z,a, true, false)
Citizen.InvokeNative(0xB736A491E64A32CF,Citizen.PointerValueIntInitialized(car))
Do not forget Citizen.InvokeNative(0xB736A491E64A32CF,Citizen.PointerValueIntInitialized(car))
, to clear memory.
@MarkViolla - The issue is, we want to have cars spawn when the resources starts, but if there are multiple players, the car will spawn multiple times. Do you have any idea for how to do a check to make sure the car does not spawn more than once?
Yes, you create an event that you can trigger with a command, donât give away the command , run it when the server is starting and thats it or add it as an admin command if you use em or if you created your own admin system
Yes. Look at mapmanager resource for information how it works.
I am from mobile,so i cant give you example.
@hbk Iâd really prefer for it to be an automated process immediately on server start.
@MarkViolla Iâve tried adding in cars using the mapmanager, but it doesnât even allow me to join the game.
ty guys for all that
Easy: only spawn the car if there isnât a car in the area already. I donât know how migration handles this (if the car will be seen as existent, even), but IS_ANY_VEHICLE_NEAR_POINT could help.