05.08.2013, 07:50
When i buy the car and then park the vehicle it all works fine, when i log back in i get in the car it says you are the owner which is fine, but then if you try and park it again it disappears and you don't own any cars?
pawn Код:
if(strcmp(cmd, "/parkvehicle", true) == 0 || strcmp(cmd, "/pv", true) == 0) // Parking the car.
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
{
GetPlayerVehicleMods(playerid);
if(PlayerVehicleID1[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX1], PlayerInfo[playerid][PlayerVehiclePosY1], PlayerInfo[playerid][PlayerVehiclePosZ1]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing1]);
DestroyVehicle(PlayerVehicleID1[playerid]);
PlayerInfo[playerid][PlayerVehicle1VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle1Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,1);
PutPlayerInVehicle(playerid,PlayerVehicleID1[playerid],0);
}
else if(PlayerVehicleID2[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX2], PlayerInfo[playerid][PlayerVehiclePosY2], PlayerInfo[playerid][PlayerVehiclePosZ2]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing2]);
DestroyVehicle(PlayerVehicleID2[playerid]);
PlayerInfo[playerid][PlayerVehicle2VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle2Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,2);
PutPlayerInVehicle(playerid,PlayerVehicleID2[playerid],0);
}
else if(PlayerVehicleID3[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX3], PlayerInfo[playerid][PlayerVehiclePosY3], PlayerInfo[playerid][PlayerVehiclePosZ3]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing3]);
DestroyVehicle(PlayerVehicleID3[playerid]);
PlayerInfo[playerid][PlayerVehicle3VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle3Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,3);
PutPlayerInVehicle(playerid,PlayerVehicleID3[playerid],0);
}
else if(PlayerVehicleID4[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX4], PlayerInfo[playerid][PlayerVehiclePosY4], PlayerInfo[playerid][PlayerVehiclePosZ4]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing4]);
DestroyVehicle(PlayerVehicleID4[playerid]);
PlayerInfo[playerid][PlayerVehicle4VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle4Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,4);
PutPlayerInVehicle(playerid,PlayerVehicleID4[playerid],0);
}
else if(PlayerVehicleID5[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX5], PlayerInfo[playerid][PlayerVehiclePosY5], PlayerInfo[playerid][PlayerVehiclePosZ5]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing5]);
DestroyVehicle(PlayerVehicleID5[playerid]);
PlayerInfo[playerid][PlayerVehicle5VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle5Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,5);
PutPlayerInVehicle(playerid,PlayerVehicleID5[playerid],0);
}
else
{
SendClientMessage(playerid,COLOR_GREY," You are not in a vehicle that you own.");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY," You are not driving a vehicle.");
}
}
return 1;
}