CMD:entergarage(playerid, params[])
{
new done, string[128];
if(IsPlayerInRangeOfPoint(playerid, 3, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
{
new idx;
idx = GetPlayerVirtualWorld(playerid)-500;
if(!done && idx < MAX_GARAGES && GarageInfo[idx][gLevel])
{
format(string, sizeof(string), "** %s pushes the shutter up and exits the garage.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerPos(playerid, -72.5507,-20.3314,972.5516);
SetPlayerFacingAngle(playerid, 267.0980);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
done = 1;
}
}
return 1;
}
CMD:entergarage(playerid, params[])
{
new idx, vehid, string[128];
if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
{
if(!GarageInfo[idx][gStatus] && PlayerInfo[playerid][pGarage] != idx && PlayerInfo[playerid][pVGarage] != idx) return SendClientMessage(playerid, COLOR_GREY, "This garage is locked by its owner.");
format(string, sizeof(string), "** %s pushes the shutter and enters the garage.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPlayerVirtualWorld(playerid, idx+500);
SetPlayerPos(playerid, -72.5507,-20.3314,972.5516);
SetPlayerFacingAngle(playerid, 267.0980);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
if(IsPlayerInVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetPlayerVehicleID(playerid);
SetVehiclePos(vehid, -72.5507,-20.3314,972.5516);
SetPlayerFacingAngle(playerid, 267.0980);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
return 1;
}
}
return 1;
}
vehid = GetPlayerVehicleID(playerid);
CMD:entergarage(playerid, params[])
{
new idx, vehid, string[128];
if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
{
if(!GarageInfo[idx][gStatus] && PlayerInfo[playerid][pGarage] != idx && PlayerInfo[playerid][pVGarage] != idx) return SendClientMessage(playerid, COLOR_GREY, "This garage is locked by its owner.");
format(string, sizeof(string), "** %s pushes the shutter and enters the garage.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
vehid = GetPlayerVehicleID(playerid);
SetPlayerVirtualWorld(playerid, idx+500);
SetPlayerPos(playerid, -72.5507,-20.3314,972.5516);
SetPlayerFacingAngle(playerid, 267.0980);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
if(IsPlayerInVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(vehid, -72.5507,-20.3314,972.5516);
SetPlayerFacingAngle(playerid, 267.0980);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
return 1;
}
}
return 1;
}
CMD:entergarage(playerid, params[])
{
new idx, string[128], vehid = GetPlayerVehicleID(playerid);
if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
{
if(!GarageInfo[idx][gStatus] && PlayerInfo[playerid][pGarage] != idx && PlayerInfo[playerid][pVGarage] != idx) return SendClientMessage(playerid, COLOR_GREY, "This garage is locked by its owner.");
format(string, sizeof(string), "** %s pushes the shutter and enters the garage.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
SetPlayerPos(playerid, -72.5507,-20.3314,972.5516);
SetPlayerFacingAngle(playerid, 267.0980);
}
else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(vehid, -72.5507,-20.3314,972.5516);
SetPlayerFacingAngle(playerid, 267.0980);
}
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid, idx+500);
}
return 1;
}
So you want vehicles able to enter/exit the garage?
If so, You could use check points with vehicle positions attached. And use a progress bar or something to get in with the vehicle.. |