14.06.2014, 03:45
So I want to /park my vehicles inside an interior, I'm gonna use it as a garage for roleplay situations.
My problem is when I /park it inside the garage, my car will be disappeared. I mean the car is still there but can't see the vehicle. It's invisible.
How can I fix it up?
Here's my park command
My problem is when I /park it inside the garage, my car will be disappeared. I mean the car is still there but can't see the vehicle. It's invisible.
How can I fix it up?
Here's my park command
pawn Код:
CMD:park(playerid, params[])
{
if(PlayerInfo[playerid][pVehicleKeysFrom] != INVALID_PLAYER_ID)
{
new ownerid = PlayerInfo[playerid][pVehicleKeysFrom];
if(IsPlayerConnected(ownerid))
{
new d = PlayerInfo[playerid][pVehicleKeys];
if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[ownerid][d][pvId]))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You must be in the driver seat.");
new Float:x, Float:y, Float:z, Float:angle, Float:health;
GetVehicleHealth(PlayerVehicleInfo[ownerid][d][pvId], health);
if(health < 800) return SendClientMessage(playerid, COLOR_GREY, " Your vehicle is too damaged to park it.");
if(PlayerInfo[playerid][pLockCar] == GetPlayerVehicleID(playerid)) PlayerInfo[playerid][pLockCar] = INVALID_VEHICLE_ID;
if(IsARC(GetPlayerVehicleID(playerid))) // RC Vehicles
{
new Float:vehPos[3];
GetVehiclePos(GetPlayerVehicleID(playerid),vehPos[0], vehPos[1], vehPos[2]);
SetPlayerPos(playerid,vehPos[0], vehPos[1]+0.5, vehPos[2]+0.5);
}
GetVehiclePos(PlayerVehicleInfo[ownerid][d][pvId], x, y, z);
GetVehicleZAngle(PlayerVehicleInfo[ownerid][d][pvId], angle);
SurfingCheck(GetPlayerVehicleID(playerid));
SetVehicleVirtualWorld(pvId, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(pvId, GetPlayerInterior(playerid));
UpdatePlayerVehicleParkPosition(ownerid, d, x, y, z, angle, health);
PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
SetPlayerArmedWeapon(playerid, 0);
new string[29 + (MAX_PLAYER_NAME * 2)];
format(string, sizeof(string), "* %s has parked %s's vehicle.", GetPlayerNameEx(playerid), GetPlayerNameEx(ownerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
}