08.06.2014, 03:35
Hey, tried to make a command to enter a player or player along with their car inside their garage, doesnt seem to work.
How ever i am in a vehicle when i attempt the command , all it does is tp's only me in the garage and i cant see my vehicle, also i can see the minimap means it also sets my interior to 0. There's the command.
How ever i am in a vehicle when i attempt the command , all it does is tp's only me in the garage and i cant see my vehicle, also i can see the minimap means it also sets my interior to 0. There's the command.
pawn Код:
CMD:entergarage(playerid, params[])
{
for (new idx = 0; idx < sizeof (GarageInfo); idx++)
{
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.");
new string[128], seat;
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(GarageInfo[idx][gLevel] == 1 && !IsPlayerInAnyVehicle(playerid))
{
SetPlayerPos(playerid, -73.0052,-18.5942,972.5516);
SetPlayerFacingAngle(playerid, 6.7155);
SetPlayerInterior(playerid, 14);
SetPlayerVirtualWorld(playerid, idx+500);
}
else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new carid = GetPlayerVehicleID(playerid);
SetVehiclePos(carid, -73.0052,-18.5942,972.5516);
SetVehicleZAngle(carid, 6.7155);
LinkVehicleToInterior(carid, 14);
PutPlayerInVehicle(playerid, carid, seat);
SetVehicleVirtualWorld(carid, idx+500);
}
SetCameraBehindPlayer(playerid);
break;
}
}
return 1;
}