I need when i teleporting , i can take the vehicle come with me in Exterior , i'm using cmd:exit but i don't understand why i can't come with my vehicle
Код:
CMD:exit(playerid, params[])
{
if(GetPVarInt(playerid, "IsInArena") >= 0) {
SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam the khi dang o dau truong");
return 1;
}
if(GetPVarType(playerid, "StreamPrep")) {
return SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam the bay gio. Wait for streaming to finish.");
}
if( PlayerCuffed[playerid] >= 1 || PlayerInfo[playerid][pBeingSentenced] != 0 ) {
SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam the bay gio.");
return 1;
}
if(Vuoting[playerid] == 1)
{
SetPlayerColor(playerid, TEAM_ORANGE_COLOR);
return 1;
}
for(new i = 0; i < sizeof(DDoorsInfo); i++) {
if (IsPlayerInRangeOfPoint(playerid,3.0,DDoorsInfo[i][ddInteriorX], DDoorsInfo[i][ddInteriorY], DDoorsInfo[i][ddInteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddInteriorVW]) {
SetPlayerInterior(playerid,DDoorsInfo[i][ddExteriorInt]);
PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddExteriorInt];
SetPlayerVirtualWorld(playerid, DDoorsInfo[i][ddExteriorVW]);
PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddExteriorVW];
SetPlayerToTeamColor(playerid);
//FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
if(DDoorsInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorX],DDoorsInfo[i][ddExteriorY],DDoorsInfo[i][ddExteriorZ]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorA]);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorVW]);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorInt]);
}
else {
SetPlayerPosEx(playerid,DDoorsInfo[i][ddExteriorX],DDoorsInfo[i][ddExteriorY],DDoorsInfo[i][ddExteriorZ]);
SetPlayerFacingAngle(playerid, DDoorsInfo[i][ddExteriorA]);
SetCameraBehindPlayer(playerid);
}
if(DDoorsInfo[i][ddCustomExterior]) Player_StreamPrep(playerid, DDoorsInfo[i][ddExteriorX],DDoorsInfo[i][ddExteriorY],DDoorsInfo[i][ddExteriorZ], FREEZE_TIME);
return 1;
}
}
for(new i = 0; i < sizeof(FamilyInfo); i++) {
if (IsPlayerInRangeOfPoint(playerid,3.0,FamilyInfo[i][FamilyExit][0], FamilyInfo[i][FamilyExit][1], FamilyInfo[i][FamilyExit][2]) && PlayerInfo[playerid][pVW] == FamilyInfo[i][FamilyVirtualWorld]) {
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid,0);
//FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
Streamer_UpdateEx(playerid, FamilyInfo[i][FamilyEntrance][0],FamilyInfo[i][FamilyEntrance][1],FamilyInfo[i][FamilyEntrance][2]);
SetPlayerPosEx(playerid,FamilyInfo[i][FamilyEntrance][0],FamilyInfo[i][FamilyEntrance][1],FamilyInfo[i][FamilyEntrance][2]);
SetPlayerFacingAngle(playerid,FamilyInfo[i][FamilyEntrance][3]);
return 1;
}
}
for(new i = 0; i < sizeof(HouseInfo); i++) {
if (IsPlayerInRangeOfPoint(playerid,3.0,HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && PlayerInfo[playerid][pVW] == i+6000) {
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerPosEx(playerid,HouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ]);
SetPlayerFacingAngle(playerid, HouseInfo[i][hExteriorA]);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
//FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
if(HouseInfo[i][hCustomExterior]) Player_StreamPrep(playerid, HouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ], FREEZE_TIME);
return 1;
}
}
if (IsPlayerInRangeOfPoint(playerid, 3.0, 1753.6423,-1586.9365,13.2424)) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), 1753.4561,-1595.1804,13.5381);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 347.7918);
}
else {
SetPlayerPosEx(playerid,1753.4561,-1595.1804,13.5381);
}
}
else if(InsidePlane[playerid] != INVALID_VEHICLE_ID)
{
new string[64];
format(string, sizeof(string), "* %s exits the airplane.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(!IsAPlane(InsidePlane[playerid])) {
PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
GivePlayerValidWeapon(playerid, 46, 60000);
SetPlayerPosEx(playerid, 0.000000, 0.000000, 420.000000); // lol nick
}
else {
new Float:X, Float:Y, Float:Z;
GetVehiclePos(InsidePlane[playerid], X, Y, Z);
SetPlayerPosEx(playerid, X-2.7912, Y+3.2304, Z);
Player_StreamPrep(playerid, X-2.7912,Y+3.2304,Z, FREEZE_TIME);
if(Z > 50.0) {
PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
GivePlayerValidWeapon(playerid, 46, 60000);
}
}
PlayerInfo[playerid][pVW] = 0;
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerInterior(playerid, 0);
InsidePlane[playerid] = INVALID_VEHICLE_ID;
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, -2045.0183,-211.6728,991.5364)) {
if(BackEntrance) {
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPosEx(playerid, -2033.7502,-154.8784,35.3203);
}
else return SendClientMessageEx(playerid, COLOR_GREY, "You don't have the keys for that door (locked) !");
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, -2091.0200,-199.8031,978.8315)) {
if(PlayerInfo[playerid][pMember] == 3) {
SetPlayerPosEx(playerid, -2088.4797,-199.6259,978.8315);
}
else return SendClientMessageEx(playerid, COLOR_GREY, "You don't have the keys for that door (DoC restricted) !");
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, 1169.67, -1356.32, 2423.04) && GetPlayerVirtualWorld(playerid) == 7) {
//Battle Carrier
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerFacingAngle(playerid, 180);
new Float:X, Float:Y, Float:Z;
GetDynamicObjectPos(Carrier[0], X, Y, Z);
SetPlayerPosEx(playerid, (X-0.377671),(Y-10.917018),11.6986);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 316.4553,-170.2923,999.5938) && GetPlayerVirtualWorld(playerid) == 1337) {
//Battle Carrier Armoury
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
new Float:X, Float:Y, Float:Z;
GetDynamicObjectPos(Carrier[0], X, Y, Z);
SetPlayerPosEx(playerid, (X-6.422671),(Y-10.898918),11.6986);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 305.6966,-159.1586,999.5938)&& GetPlayerVirtualWorld(playerid) == 1337) {
//Battle Carrier Armoury
SetPlayerPosEx(playerid, 306.4042,-159.0768,999.5938);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, -959.6347,1956.4598,9.0000) && GetPlayerVirtualWorld(playerid) == 1337) {
//Engine Room Exit
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
new Float:X, Float:Y, Float:Z;
GetDynamicObjectPos(Carrier[0], X, Y, Z);
SetPlayerPosEx(playerid, (X-5.560629),(Y-3.853518),11.6986);
PlayerInfo[playerid][pVW] = 0;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1494.3763,1303.5875,1093.2891) && GetPlayerVirtualWorld(playerid) == 1337) {
//Briefing Room Exit
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
new Float:X, Float:Y, Float:Z;
GetDynamicObjectPos(Carrier[0], X, Y, Z);
SetPlayerPosEx(playerid, (X-15.382171),(Y-2.272918),11.6986);
PlayerInfo[playerid][pVW] = 0;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 971.70568847656, 0.73652172088623, 1013.0336914063)) {
if(PlayerInfo[playerid][pFMember] == 1) {
SetPlayerPosEx(playerid, 971.75524902344, 1.949291229248, 1012.8675537109);
SetCameraBehindPlayer(playerid);
Player_StreamPrep(playerid, 971.75524902344, 1.949291229248, 1012.8675537109, FREEZE_TIME);
}
else {
SendClientMessageEx(playerid, COLOR_GREY, "Ban khong co chia khoa cua canh cua nay (Hades' Children MC Members only)!");
}
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, -265.52786254883, 1409.2824707031, -2.2975430488586)) {
if(PlayerInfo[playerid][pFMember] == 1) {
SetPlayerPosEx(playerid, -230.57353210449, 1409.3792724609, -5.2974662780762);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
Player_StreamPrep(playerid, -230.57353210449, 1409.3792724609, -5.2974662780762, FREEZE_TIME);
}
else {
SendClientMessageEx(playerid, COLOR_GREY, "Ban khong co chia khoa cua canh cua nay (Hades' Children MC Members only)!");
}
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, -270.8628,1417.2441,-2.2902)) {
if(PlayerInfo[playerid][pFMember] == 1) {
SetPlayerPosEx(playerid, 255.84442138672, -158.21658325195, 1.677818775177);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
Player_StreamPrep(playerid, 255.84442138672, -158.21658325195, 1.677818775177, FREEZE_TIME);
}
else {
SendClientMessageEx(playerid, COLOR_GREY, "Ban khong co chia khoa cua canh cua nay (Hades' Children MC Members only)!");
}
}
//Garage
else if (IsPlayerInRangeOfPoint(playerid,8.0,-1790.378295,1436.949829,7.187500)) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), 1551.8052,31.0254,24.1446);
}
else {
SetPlayerPosEx(playerid,1551.8052,31.0254,24.1446);
}
}
//VIP Garage
else if (IsPlayerInRangeOfPoint(playerid,8.0,2425.9028,-1640.0483,1015.3889)) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), 1819.3533,-1560.3534,13.5469);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 253);
}
else {
SetPlayerPosEx(playerid,1819.3533,-1560.3534,13.5469);
SetPlayerFacingAngle(playerid,253);
}
}
// Hitman HQ
else if(IsPlayerInRangeOfPoint(playerid, 2.0, -68.845336914063, 1351.3386230469, 1079.2109375 ) && (GetPlayerVirtualWorld(playerid) == 666420)) {
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) {
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerPosEx(playerid, -418.95, -1759.26, 6.22);
SetCameraBehindPlayer(playerid);
}
}
// Hitman HQ
else if(IsPlayerInRangeOfPoint(playerid, 2.0, -68.845336914063, 1351.3386230469, 1079.2109375 ) && (GetPlayerVirtualWorld(playerid) == 666421)) {
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) {
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerPosEx(playerid, 2323.3135, 7.6760, 26.5640);
SetPlayerFacingAngle(playerid, 265.11);
SetCameraBehindPlayer(playerid);
}
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, 301.228820, 191.181884, 1007.171875)) {
//SFPD Exit to garage
if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) {
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerPosEx(playerid,-1591.450195, 716.007141, -5.242187);
SetPlayerFacingAngle(playerid, 271.00);
SetCameraBehindPlayer(playerid);
}
else {
return SendClientMessageEx(playerid, COLOR_GRAD2, "Truy nhap bi tu choi.");
}
}
//SASD - Elevator
else if (IsPlayerInRangeOfPoint(playerid,3.0,612.6414,-629.8659,-4.0447)) {
if(IsACop(playerid)) {
SetPlayerFacingAngle(playerid, 268);
GameTextForPlayer(playerid, "~w~LASD HQ", 5000, 1);
SetPlayerPosEx(playerid,2530.3774,-1689.9998,562.7922);
SetPlayerVirtualWorld(playerid, 1699);
PlayerInfo[playerid][pVW] = 1699;
Player_StreamPrep(playerid, 2530.3774,-1689.9998,562.7922, FREEZE_TIME);
}
else {
return SendClientMessageEx(playerid, COLOR_GRAD2, "Truy nhap bi tu choi.");
}
}
// FBI garage exit
else if(IsPlayerInRangeOfPoint(playerid, 3,310.8672,-1484.7493,-33.5292 )) {
if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) {
SetPlayerInterior(playerid,0);
SetPlayerPosEx(playerid, 314.30,-1512.07,24.92);
SetPlayerFacingAngle(playerid, 55.76);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
}
else {
SendClientMessageEx(playerid, COLOR_GREY, "Ban khong co chia khoa cua canh cua nay (CHP restricted access)!");
}
}
else if (IsPlayerInRangeOfPoint(playerid, 3, 291.8773,-1481.0674,-33.5308)) {
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) {
SetPlayerInterior(playerid,0);
SetPlayerPosEx(playerid,298.26, -1544.53, 76.53);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
}
else {
SendClientMessageEx(playerid, COLOR_GREY, "Ban khong co chia khoa cua canh cua nay (CHP restricted access)!");
}
}
/*else if (IsPlayerInRangeOfPoint(playerid,6.0,-1404.5299,-259.0602,1043.6563)) {
SetPlayerInterior(playerid,0);
SetPlayerPosEx(playerid,2695.6235,-1704.6960,11.8438);
}
else if (IsPlayerInRangeOfPoint(playerid,8.0,-1443.0554,-581.1879,1055.0472)) {
SetPlayerInterior(playerid,0);
SetPlayerPosEx(playerid,-2111.5686,-443.9720,38.7344);
}
else if (IsPlayerInRangeOfPoint(playerid,8.0,-1464.7732,1557.5533,1052.5313)) {
SetPlayerInterior(playerid,0);
SetPlayerPosEx(playerid,-2080.3079,-406.0309,38.7344);
}*/
// NG exit
else if (IsPlayerInRangeOfPoint(playerid,4.0,-273.884765625,1875.1552734375,29.817853927612)) {
if (PlayerInfo[playerid][pJailTime] == 0) {
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
SetPlayerInterior(playerid,0);
SetPlayerPosEx(playerid,200.2569,1869.5732,13.1470);
}
else {
SetPlayerHealth(playerid, 0);
SendClientMessageEx(playerid, COLOR_WHITE, "You can not escape admin prison!");
}
}
//SASD Garage
else if (IsPlayerInRangeOfPoint(playerid,20.0,643.8234,-608.0292,-4.2479)) {
if(IsACop(playerid)) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), 624.5196,-596.8649,16.9396);
}
else {
SetPlayerPosEx(playerid,624.5196,-596.8649,16.9396);
}
}
}
//Courthouse Garage
else if (IsPlayerInRangeOfPoint(playerid,20.0,1381.7274,-1676.4248,-13.2229+1100.00)) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), 1423.0443,-1664.5244,13.5810);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 270);
}
else {
SetPlayerPosEx(playerid,1423.0443,-1664.5244,13.5810);
SetPlayerFacingAngle(playerid,270);
}
}
//Gym Garage
else if (IsPlayerInRangeOfPoint(playerid,20.0,2240.7332,-1695.9648,(-0.0826+1100.00))) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), 2273.6787,-1728.9022,13.5039);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 180);
}
else {
SetPlayerPosEx(playerid,2273.6787,-1728.9022,13.5039);
SetPlayerFacingAngle(playerid,180);
}
}
//PB Garage
else if (IsPlayerInRangeOfPoint(playerid,20.0,1218.60,-1451.69,(-46.85+1100.00))) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), 1218.6017,-1421.5887,13.9084);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 360);
}
else {
SetPlayerPosEx(playerid,1218.6017,-1421.5887,13.9084);
}
}
// Gold/Plat VIP
else if (IsPlayerInRangeOfPoint(playerid,3.0, 911.6200,1426.2729,-81.1762)) {
SetPlayerPosEx(playerid,902.2482,1419.8180,-80.9308);
SetPlayerFacingAngle(playerid, 90);
}
SetPlayerToTeamColor(playerid);
SetPVarInt(playerid, "Fading", 1);
return 1;
}