PDA

View Full Version : Exterior-Interior Prob.


Ritzy2K
07/02/2015, 01:30 PM
Hi. I dunno whats wrong here...

i made a simple garage system..small medium big...every 3 types got their different interiors.. but when someone /entergarage he enters garage normally..i mean theres no prob...but when someone exits it.. he start falling off the sky and later spawns at blueberry...:/ Halp. is it something wrong with virtualworld?

HazardouS
07/02/2015, 01:38 PM
What's your /exitgarage command? Or how do they exit their garages?

Ritzy2K
07/02/2015, 01:47 PM
if(strcmp(cmd, "/exitgarage", true) == 0 || strcmp(cmd, "/exitga", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Seat[MAX_PLAYERS], InCar[MAX_PLAYERS];
new i = GetPlayerVirtualWorld(playerid), vehicleid;
if(i == 0) return SendClientMessage(playerid, GREY, "You are not inside a garage.");
if(GarageInfo[i][GarageLocked]) return SendClientMessage(playerid, GREY, "You've been locked inside the garage, tough luck.");
if(IsPlayerInRangeOfPoint(playerid, 30.0, GarageInfo[i][GarageInsideX], GarageInfo[i][GarageInsideY], GarageInfo[i][GarageInsideZ]) && GetPlayerVirtualWorld(playerid) == i)
{
if(GetPlayerState(playerid) == 2)
{
vehicleid = GetPlayerVehicleID(playerid);
for(new j = 0; j < MAX_PLAYERS; j++)
{
if(IsPlayerInVehicle(j, vehicleid))
{
InCar[j] = vehicleid;
Seat[j] = GetPlayerVehicleSeat(playerid);
SetPlayerInterior(j, 0);
SetPlayerVirtualWorld(j, 0);
SetPVarInt(j, "InGarage", 0);
}
}
SetVehiclePos(vehicleid, GarageInfo[i][GarageExitX], GarageInfo[i][GarageExitY], GarageInfo[i][GarageExitZ]);
SetVehicleZAngle(vehicleid, GarageInfo[i][GarageExitA]);
SetVehicleWorld(vehicleid, 0);
SetVehicleInterior(vehicleid, 0);
}
SetPlayerPosEx(playerid, GarageInfo[i][GarageExitX], GarageInfo[i][GarageExitY], GarageInfo[i][GarageExitZ]);
SetPlayerFacingAngle(playerid, GarageInfo[i][GarageExitA]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
if(vehicleid != 0)
{
for (new j = 0; j < MAX_PLAYERS; j++)
{
if (InCar[j] == 0) continue;
if (InCar[j] == vehicleid)
{
PutPlayerInVehicle(j, vehicleid, Seat[j]);
}
}
PutPlayerInVehicle(playerid, vehicleid, 0);
}
SetPVarInt(playerid, "InGarage", 0);
return 1;
}
else
{
SendClientMessage(playerid, GREY, "You are not near a garage exit.");
return 1;
}
}
return 1;
}

Ritzy2K
07/02/2015, 05:45 PM
come on no one? ._.

HazardouS
07/02/2015, 06:12 PM
Your code looks fine, does the driver fall from the sky too?

Ritzy2K
07/02/2015, 07:56 PM
yeah anyone who enter garage :(

help pleasee... i too cant figure it out...

i hope the problem isnt with the interior m using. :3

Geso
07/02/2015, 08:25 PM
Where did you set a value for
GarageInfo[i][GarageExitX],
GarageInfo[i][GarageExitY],
GarageInfo[i][GarageExitZ]
?