14.06.2018, 18:56
So I'm having some some trouble with SetPlayerVirtualWorld and SetVehicleVirtualWorld.
I'm making a dealership system that sets the player's camera and creates the current vehicle they're looking at.
Everything works fine, up until I try to set the player and vehicle's virtual world, to allow multiple people to purchase vehicles at the same time.
I made two test commands, one that allows me to set the player's vw and one to set the vehicle's.
When I switch the vehicle through the virtual worlds it works fine. When I switch the vehicle to virtual world 1 it disappears, when I switch it back to 0 it reappears.
The problem comes when I try to set my own virtual world. For some reason the vehicle just disappears.
I could set both my and the vehicles virtual world to 2 and it disappears. I can reset it back to 0 and still nothing.
Not sure what code could be included to make this any easier, considering it's a simple:
I'm making a dealership system that sets the player's camera and creates the current vehicle they're looking at.
Everything works fine, up until I try to set the player and vehicle's virtual world, to allow multiple people to purchase vehicles at the same time.
I made two test commands, one that allows me to set the player's vw and one to set the vehicle's.
When I switch the vehicle through the virtual worlds it works fine. When I switch the vehicle to virtual world 1 it disappears, when I switch it back to 0 it reappears.
The problem comes when I try to set my own virtual world. For some reason the vehicle just disappears.
I could set both my and the vehicles virtual world to 2 and it disappears. I can reset it back to 0 and still nothing.
Not sure what code could be included to make this any easier, considering it's a simple:
PHP Code:
SetPlayerVirtualWorld(playerid, playerid + 1000);
new veh = CreateVehicle(...);
SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(playerid));