05.04.2015, 08:28
Okay the problem here is that the players vehicle is linked with someones playerid. So when the player disconnects and that playerid is no longer present, multiple things could happen. I am not a 100% sure what would happen, as I don't know how your script handles this, but one thing I do know is that the server won't be able to refer to the vehicle's owner if he is disconnected.
What I was thinking is to destroy the players vehicle once he joins the server and then re-create it, thus only having one.
However I am not sure if this will always work as intended. Anyways, slightly edited code:
What I was thinking is to destroy the players vehicle once he joins the server and then re-create it, thus only having one.
However I am not sure if this will always work as intended. Anyways, slightly edited code:
PHP код:
if(PlayerInfo[playerid][vModel])
{
DestroyVehicle(PlayerInfo[playerid][pVeh]);
PlayerInfo[playerid][pVeh] = CreateVehicle(PlayerInfo[playerid][vModel], PlayerInfo[playerid][vX],PlayerInfo[playerid][vY],PlayerInfo[playerid][vZ],PlayerInfo[playerid][vA],PlayerInfo[playerid][vC1],PlayerInfo[playerid][vC2],1200);
ChangeVehiclePaintjob(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vPJ]);
if(PlayerInfo[playerid][vLocked]) SetVehicleParamsEx(PlayerInfo[playerid][pVeh], 0, 0, 0, 1, 0, 0, 0);
for(new i=0; i<14; i++)
{
AddVehicleComponent(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehMod][i]);
}
}
if(PlayerInfo[playerid][vVModel])
{
PlayerInfo[playerid][pVVeh] = CreateVehicle(PlayerInfo[playerid][vVModel], PlayerInfo[playerid][vVX],PlayerInfo[playerid][vVY],PlayerInfo[playerid][vVZ],PlayerInfo[playerid][vVA],PlayerInfo[playerid][vVC1],PlayerInfo[playerid][vVC2],1200);
ChangeVehiclePaintjob(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVPJ]);
if(PlayerInfo[playerid][vVLocked]) SetVehicleParamsEx(PlayerInfo[playerid][pVVeh], 0, 0, 0, 1, 0, 0, 0);
for(new i=0; i<14; i++)
{
AddVehicleComponent(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVehMod][i]);
}
}

