PutPlayerInVehicle spawns player on top vehicle problem
#1

It puts both players on top of vehicle, it should be putting them inside


Код:
RaceVehicle[1] = AddStaticVehicleEx(411,1460.5917,-752.2693,94.7235,5.9723,164,167,15); //
RaceVehicle[2] = AddStaticVehicleEx(411,1456.0748,-751.3248,94.7153,7.8800,164,167,15); //
PutPlayerInVehicle(playerid,RaceVehicle[1],0);
PutPlayerInVehicle(SellOffer[playerid],RaceVehicle[2],0);
							
SetVehicleVirtualWorld(RaceVehicle[1], 2);
SetVehicleVirtualWorld(RaceVehicle[2], 2);
SetPlayerVirtualWorld(SellOffer[playerid], 2);
SetPlayerVirtualWorld(playerid, 2);
TogglePlayerControllable(playerid,0);
TogglePlayerControllable(SellOffer[playerid],0);
							
							
SetTimerEx("Odbrojavanje1",1000,false, "i", playerid);
SetTimerEx("Odbrojavanje1",1000,false, "i", SellOffer[playerid]);
SetPlayerCheckpoint(playerid,1351.5682,-697.1617,91.0996,5.0);
SetPlayerCheckpoint(SellOffer[playerid],1351.5682,-697.1617,91.0996,5.0);
Reply
#2

You should position the vehicles at the destination first.

You're creating the vehicles, putting players inside them, then move the vehicles to another virtual world.
This forces the players out of the vehicle again.

PHP код:
// Create vehicles and position them in the required virtual world
RaceVehicle[1] = AddStaticVehicleEx(411,1460.5917,-752.2693,94.7235,5.9723,164,167,15); //
RaceVehicle[2] = AddStaticVehicleEx(411,1456.0748,-751.3248,94.7153,7.8800,164,167,15); //
SetVehicleVirtualWorld(RaceVehicle[1], 2);
SetVehicleVirtualWorld(RaceVehicle[2], 2);
// Vehicles in position now, proceeding to players
// Put both players in the same virtual world as the vehicles
SetPlayerVirtualWorld(SellOffer[playerid], 2);
SetPlayerVirtualWorld(playerid2);
// With both players and vehicles in position, put the players inside the vehicles
PutPlayerInVehicle(playerid,RaceVehicle[1],0);
PutPlayerInVehicle(SellOffer[playerid],RaceVehicle[2],0);
TogglePlayerControllable(playerid,0);
TogglePlayerControllable(SellOffer[playerid],0);
                            
                            
SetTimerEx("Odbrojavanje1",1000,false"i"playerid);
SetTimerEx("Odbrojavanje1",1000,false"i"SellOffer[playerid]);
SetPlayerCheckpoint(playerid,1351.5682,-697.1617,91.0996,5.0);
SetPlayerCheckpoint(SellOffer[playerid],1351.5682,-697.1617,91.0996,5.0); 
Try this instead.
Reply
#3

Players are again on top of vehicle... :/
Reply
#4

Someone? Please
Reply
#5

Im waiting few days, i really need it :S
Reply
#6

Relax please. Get a cup of tea.
Reply
#7

Why not spawn them on gamemodeinit and set them there so they are ready and waiting, and then put the players in when you actually need to after setting the players worlds.
Reply
#8

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
Relax please. Get a cup of tea.
i cant proceed with my project until i get this bug fixed, im relaxed, just looking for help


@topic, and i already try that with ongamemodeinit but the same problem..

vith /aveh command its working fine, when i spawn admin vehicle it puts player inside of it, but with this no...
Reply
#9

If you return the VehicleID that it's SUPPOSED to have spawned to you (in sendclientmessage), try making a command that teles you to it, to see if it is indeed spawned.

Something like /gotoveh [VehicleID]

There is also a method of checking that a VehicleID is actually valid, I can't remember where or how, but if you find it, and check that the ID is valid after the command has been run, it should show whether or not the vehicle actually spawned or not.
Reply
#10

i tried it but its making a problem

i offer to someone race, he go /accept race

after that, he is inside of car (put work), but me puts on top of vehicle

im messing with this few days..
Reply
#11

You should be using CreateVehicle too, not AddStaticVehicle(Ex). Just saying. Not sure if that actually makes a difference, but it's worth a shot.
Reply
#12

I tried, its like, after typing "/accept race" it reads half code, not all...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)