I want when I press button make command help ;)
#1

Hello guys i need something...
I need when I press "N" it makes that command:
Код:
CMD:enter(playerid, params[])
{
    if(GetPVarInt(playerid, "IsInArena") >= 0) {
        SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in a arena!");
        return 1;
    }
	if(GetPVarType(playerid, "StreamPrep")) {
		return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now. Wait for streaming to finish.");
	}
    if( PlayerCuffed[playerid] >= 1 ) {
        SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
        return 1;
    }
	new cCar = GetClosestCar(playerid);
    for(new i = 0; i < sizeof(DDoorsInfo); i++) {
        if (IsPlayerInRangeOfPoint(playerid,3.0,DDoorsInfo[i][ddExteriorX], DDoorsInfo[i][ddExteriorY], DDoorsInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddExteriorVW]) {
            if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonateRank] < DDoorsInfo[i][ddVIP]) {
                SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, you are not a high enough VIP level.");
                return 1;
            }
            
            if(DDoorsInfo[i][ddFamed] > 0 && PlayerInfo[playerid][pFamed] < DDoorsInfo[i][ddFamed]) {
                SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, you're not a high enough famed level.");
                return 1;
            }

			if(DDoorsInfo[i][ddDPC] > 0 && PlayerInfo[playerid][pRewardHours] < 150) {
                SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, you are not a Dedicated Player.");
                return 1;
            }

            if(DDoorsInfo[i][ddFamily] > 0) {
                if(PlayerInfo[playerid][pFMember] != DDoorsInfo[i][ddFamily]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door is family restricted.");
				else if(PlayerInfo[playerid][pRank] < DDoorsInfo[i][ddRank]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are not high enough rank to enter this door.");
            }

			if(DDoorsInfo[i][ddAllegiance] > 0) {
                if(arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] != DDoorsInfo[i][ddAllegiance]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door is nation restricted.");
				else if(PlayerInfo[playerid][pRank] < DDoorsInfo[i][ddRank]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are not high enough rank to enter this door.");
            }

			if(DDoorsInfo[i][ddGroupType] > 0) {
                if(arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] != DDoorsInfo[i][ddGroupType] && arrGroupData[PlayerInfo[playerid][pMember]][g_iAllegiance] != DDoorsInfo[i][ddAllegiance]) {
					return SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door is faction restricted.");
				}
				else if(PlayerInfo[playerid][pRank] < DDoorsInfo[i][ddRank]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are not high enough rank to enter this door.");
            }

            if(DDoorsInfo[i][ddFaction] != INVALID_GROUP_ID) {
                if(PlayerInfo[playerid][pMember] != DDoorsInfo[i][ddFaction]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door is faction restricted.");
				else if(PlayerInfo[playerid][pRank] < DDoorsInfo[i][ddRank]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are not high enough rank to enter this door.");
            }

            if(DDoorsInfo[i][ddAdmin] > 0 && PlayerInfo[playerid][pAdmin] < DDoorsInfo[i][ddAdmin]) {
                SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, you are not a high enough admin level.");
                return 1;
            }

            if(DDoorsInfo[i][ddWanted] > 0 && PlayerInfo[playerid][pWantedLevel] != 0) {
                SendClientMessageEx(playerid, COLOR_GRAD2, "You can not enter, this door restricts those with wanted levels.");
                return 1;
            }

			if(DDoorsInfo[i][ddLocked] == 1) {
			    return SendClientMessageEx(playerid, COLOR_GRAD2, "This door is currently locked.");
			}
            SetPlayerInterior(playerid,DDoorsInfo[i][ddInteriorInt]);
            PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddInteriorInt];
            PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddInteriorVW];
            SetPlayerVirtualWorld(playerid, DDoorsInfo[i][ddInteriorVW]);
            if(DDoorsInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
                SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
                SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorA]);
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorVW]);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorInt]);
	            if(GetPVarInt(playerid, "tpForkliftTimer") > 0)
				{
				    SetPVarInt(playerid, "tpJustEntered", 1);
				    new Float: pX, Float: pY, Float: pZ;
					GetPlayerPos(playerid, pX, pY, pZ);
					SetPVarFloat(playerid, "tpForkliftX", pX);
			 		SetPVarFloat(playerid, "tpForkliftY", pY);
			  		SetPVarFloat(playerid, "tpForkliftZ", pZ);
				}
                if(DynVeh[GetPlayerVehicleID(playerid)] != -1)
				{
				    new vw[1];
					vw[0] = GetVehicleVirtualWorld(GetPlayerVehicleID(playerid));
				    if(DynVehicleInfo[DynVeh[GetPlayerVehicleID(playerid)]][gv_iAttachedObjectModel][0] != INVALID_OBJECT_ID)
				    {
				    	Streamer_SetArrayData(STREAMER_TYPE_OBJECT, DynVehicleInfo[DynVeh[GetPlayerVehicleID(playerid)]][gv_iAttachedObjectID][0], E_STREAMER_WORLD_ID, vw[0]);

					}
					if(DynVehicleInfo[DynVeh[GetPlayerVehicleID(playerid)]][gv_iAttachedObjectModel][1] != INVALID_OBJECT_ID)
				    {
						Streamer_SetArrayData(STREAMER_TYPE_OBJECT, DynVehicleInfo[DynVeh[GetPlayerVehicleID(playerid)]][gv_iAttachedObjectID][1], E_STREAMER_WORLD_ID, vw[0]);

					}
				}
                foreach(new passenger: Player)
                {
                    if(passenger != playerid)
                    {
	                    if(IsPlayerInVehicle(passenger, GetPlayerVehicleID(playerid)))
	                    {
		                    SetPlayerInterior(passenger,DDoorsInfo[i][ddInteriorInt]);
				            PlayerInfo[passenger][pInt] = DDoorsInfo[i][ddInteriorInt];
				            PlayerInfo[passenger][pVW] = DDoorsInfo[i][ddInteriorVW];
				            SetPlayerVirtualWorld(passenger, DDoorsInfo[i][ddInteriorVW]);
	                    }
					}
                }
            }
            else {
                SetPlayerPos(playerid,DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
                SetPlayerFacingAngle(playerid,DDoorsInfo[i][ddInteriorA]);
                SetCameraBehindPlayer(playerid);
            }
			if(DDoorsInfo[i][ddCustomInterior]) Player_StreamPrep(playerid, DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ], FREEZE_TIME);
            return 1;
        }
    }
    for(new i = 0; i < sizeof(FamilyInfo); i++) {
        if (IsPlayerInRangeOfPoint(playerid,3.0,FamilyInfo[i][FamilyEntrance][0], FamilyInfo[i][FamilyEntrance][1], FamilyInfo[i][FamilyEntrance][2])) {
            SetPlayerInterior(playerid,FamilyInfo[i][FamilyInterior]);
            PlayerInfo[playerid][pInt] = FamilyInfo[i][FamilyInterior];
            PlayerInfo[playerid][pVW] = FamilyInfo[i][FamilyVirtualWorld];
            SetPlayerVirtualWorld(playerid, FamilyInfo[i][FamilyVirtualWorld]);
            SetPlayerPos(playerid,FamilyInfo[i][FamilyExit][0],FamilyInfo[i][FamilyExit][1],FamilyInfo[i][FamilyExit][2]);
            SetPlayerFacingAngle(playerid,FamilyInfo[i][FamilyExit][3]);
			if(FamilyInfo[i][FamilyCustomMap]) Player_StreamPrep(playerid, FamilyInfo[i][FamilyExit][0],FamilyInfo[i][FamilyExit][1],FamilyInfo[i][FamilyExit][2], FREEZE_TIME);
            return 1;
        }
    }
    for(new i = 0; i < sizeof(HouseInfo); i++) {
        if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hExtVW]) {
            if(PlayerInfo[playerid][pPhousekey] == i || PlayerInfo[playerid][pPhousekey2] == i || HouseInfo[i][hLock] == 0 || PlayerInfo[playerid][pRenting] == i) {
                SetPlayerInterior(playerid,HouseInfo[i][hIntIW]);
                PlayerInfo[playerid][pInt] = HouseInfo[i][hIntIW];
                PlayerInfo[playerid][pVW] = HouseInfo[i][hIntVW];
                SetPlayerVirtualWorld(playerid,HouseInfo[i][hIntVW]);
                SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                SetPlayerFacingAngle(playerid,HouseInfo[i][hInteriorA]);
                SetCameraBehindPlayer(playerid);
                GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
				if(HouseInfo[i][hCustomInterior] == 1) Player_StreamPrep(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ], FREEZE_TIME);
            }
            else GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
            return 1;
        }
    }

    for(new i = 0; i < sizeof(Businesses); i++) {
        if (IsPlayerInRangeOfPoint(playerid,3,Businesses[i][bExtPos][0], Businesses[i][bExtPos][1], Businesses[i][bExtPos][2])) {
	        if (Businesses[i][bExtPos][1] == 0.0) return 1;
			if (Businesses[i][bStatus]) {
				if (Businesses[i][bType] == BUSINESS_TYPE_GYM)
				{
					if (Businesses[i][bGymEntryFee] > 0 && PlayerInfo[playerid][pCash] < Businesses[i][bGymEntryFee])
					{
						GameTextForPlayer(playerid, "~r~You need more money to enter this gym", 5000, 1);
						return 1;
					}
				}
				SetPVarInt(playerid, "BusinessesID", i);

				if(Businesses[i][bVW] == 0) SetPlayerVirtualWorld(playerid, BUSINESS_BASE_VW + i), PlayerInfo[playerid][pVW] = BUSINESS_BASE_VW + i;
				else SetPlayerVirtualWorld(playerid, Businesses[i][bVW]), PlayerInfo[playerid][pVW] = Businesses[i][bVW];


				SetPlayerInterior(playerid,Businesses[i][bInt]);
	            SetPlayerPos(playerid,Businesses[i][bIntPos][0],Businesses[i][bIntPos][1],Businesses[i][bIntPos][2]);
		        SetPlayerFacingAngle(playerid, Businesses[i][bIntPos][3]);
	         	SetCameraBehindPlayer(playerid);
		        PlayerInfo[playerid][pInt] = Businesses[i][bInt];
		        if(Businesses[i][bCustomInterior]) Player_StreamPrep(playerid, Businesses[i][bIntPos][0], Businesses[i][bIntPos][1], Businesses[i][bIntPos][2], FREEZE_TIME);

				if (Businesses[i][bType] == BUSINESS_TYPE_GYM)
				{
					new string[50];
					format(string, sizeof(string), "You entered a gym and were charged $%i.", Businesses[i][bGymEntryFee]);
					SendClientMessageEx(playerid, COLOR_WHITE, string);
					GivePlayerCash(playerid, -Businesses[i][bGymEntryFee]);
					Businesses[i][bSafeBalance] += Businesses[i][bGymEntryFee];

					if (Businesses[i][bGymType] == 1)
					{
						SendClientMessageEx(playerid, COLOR_WHITE, "Type /beginswimming to start using the swimming pool.");
						SendClientMessageEx(playerid, COLOR_WHITE, "Type /joinboxing to join the boxing queue.");
					}
					else if (Businesses[i][bGymType] == 2)
					{
						SendClientMessageEx(playerid, COLOR_WHITE, "Type /beginparkour to begin the bike parkour track.");
					}
				}
			}
			else GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
			return 1;
        }
    }

    new Float:X, Float:Y, Float:Z;
    GetDynamicObjectPos(Carrier[0], X, Y, Z);
    if(IsPlayerInRangeOfPoint(playerid, 2.0, (X-0.377671),(Y-10.917018),11.6986)) {
		//Battle Carrier
        SetPlayerInterior(playerid, 1);
        SetPlayerVirtualWorld(playerid, 7);
        PlayerInfo[playerid][pVW] = 7;
        Streamer_UpdateEx(playerid, 1170.0106201172,-1355.0770263672,2423.0461425781);
        //Old Hospital: 2087.4626,2806.0630,-16.1744
        SetPlayerPos(playerid,1170.0106201172,-1355.0770263672,2423.0461425781);
        PlayerInfo[playerid][pInt] = 1;
        Player_StreamPrep(playerid, 1170.0106201172,-1355.0770263672,2423.0461425781, FREEZE_TIME);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, (X-6.422671),(Y-10.898918),11.6986)) {
                                                  //Battle Carrier Armoury
        SetPlayerInterior(playerid, 6);
        SetPlayerVirtualWorld(playerid, 1337);
        SetPlayerPos(playerid, 316.4553,-170.2923,999.5938);
        PlayerInfo[playerid][pVW] = 1337;
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, 306.4042,-159.0768,999.5938)) {
                                                  //Battle Carrier Armoury
        SetPlayerPos(playerid, 305.6966,-159.1586,999.5938);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, (X-5.560629),(Y-3.860818),11.6986)) {
                                                  //Engine Room Entrance
        SetPlayerInterior(playerid, 17);
        SetPlayerVirtualWorld(playerid, 1337);
        SetPlayerPos(playerid, -959.6347,1956.4598,9.0000);
        PlayerInfo[playerid][pVW] = 1337;
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, (X-15.382171),(Y-2.272918),11.6986)) {
                                                  //Briefing Room Entrance
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 1337);
        SetPlayerPos(playerid, 1494.3763,1303.5875,1093.2891);
        PlayerInfo[playerid][pVW] = 1337;
    }
//NG/LEO Only Entrance

                                                  // Hitman HQ
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, -418.95, -1759.26, 6.22 )) {
        	if (arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == 2 || arrGroupData[PlayerInfo[playerid][pLeader]][g_iGroupType] == 2) {
            SetPlayerVirtualWorld(playerid, 666420);
            PlayerInfo[playerid][pVW] = 666420;
            SetPlayerInterior(playerid, 6);
            PlayerInfo[playerid][pInt] = 6;
            SetPlayerPos(playerid, -68.8239,1351.4331,1080.6257);
            SetPlayerFacingAngle(playerid, 160);
            SetCameraBehindPlayer(playerid);
            Player_StreamPrep(playerid, -68.8239,1351.4331,1080.6257, FREEZE_TIME);
        }
    }
                                                  // Hitman HQ
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2323.3135, 7.6760, 26.5640)) {
        	if (arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == 2 || arrGroupData[PlayerInfo[playerid][pLeader]][g_iGroupType] == 2) {
            SetPlayerVirtualWorld(playerid, 666421);
            PlayerInfo[playerid][pVW] = 666421;
            SetPlayerInterior(playerid, 6);
            PlayerInfo[playerid][pInt] = 6;
            SetPlayerPos(playerid, -68.8239,1351.4331,1080.6257);
            SetPlayerFacingAngle(playerid, 160);
            SetCameraBehindPlayer(playerid);
            Player_StreamPrep(playerid, -68.8239,1351.4331,1080.6257, FREEZE_TIME);
        }
    }
                                                  //Garage
    else if (IsPlayerInRangeOfPoint(playerid,8.0,1547.1947,29.8561,24.1406)) {
        GameTextForPlayer(playerid, "~w~GARAGE", 5000, 1);
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            SetVehiclePos(GetPlayerVehicleID(playerid), -1790.378295,1436.949829,7.187500);
        }
        else {
            SetPlayerPos(playerid,-1790.378295,1436.949829,7.187500);
        }
    }

                                                      //VIP Garage
    else if (IsPlayerInRangeOfPoint(playerid,12.0,1814.6857,-1559.2028,13.4834)) {
        if(PlayerInfo[playerid][pDonateRank] > 0) {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
                SetVehiclePos(GetPlayerVehicleID(playerid),  2425.8677,-1644.1337,1015.2882);
                SetVehicleZAngle(GetPlayerVehicleID(playerid),  180);
            }
            else {
                Streamer_UpdateEx(playerid, 2425.8677,-1644.1337,1015.2882);
                SetPlayerPos(playerid,2425.8677,-1644.1337,1015.2882);
                SetPlayerFacingAngle(playerid, 180);
            }
        }
        else {
            SendClientMessage(playerid, COLOR_WHITE, "* You are not a VIP!");
        }
	}
                                                  // LSPD Panel
    else if(IsPlayerInRangeOfPoint(playerid, 3.0, 1575.9766845703, -1636.4899902344, 13.555115699768)) {
        if(IsACop(playerid)) {
            SetPlayerInterior(playerid, 0);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerPos(playerid,1579.0098876953, -1636.2879638672, 13.554491043091);
            SetPlayerFacingAngle(playerid, 190.0520);
            SetCameraBehindPlayer(playerid);
            PlayerInfo[playerid][pVW] = 0;
        }
        else {
            SendClientMessageEx(playerid, COLOR_GREY, "You do not have the keys for that door (LSPD restricted access)!");
        }
    }
     // DoC Exterior Entrance
    else if(IsPlayerInRangeOfPoint(playerid, 3.0, -2033.7502, -154.8784, 35.3203)) {
        if(BackEntrance) {
            SetPlayerInterior(playerid, 0);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerPos(playerid,-2045.0183, -211.6728, 991.5364);
            SetCameraBehindPlayer(playerid);
            PlayerInfo[playerid][pVW] = 0;
            SetCameraBehindPlayer(playerid);
            Player_StreamPrep(playerid, -2045.0183, -211.6728, 991.5364, FREEZE_TIME);
        }
        else {
            SendClientMessageEx(playerid, COLOR_GREY, "You do not have the keys for that door (locked)!");
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 3.0, -2088.4797, -199.6259, 978.8315)) {
        if(IsACop(playerid)) {
            SetPlayerPos(playerid,-2091.0200,-199.8031,978.8315);
        }
        else {
            SendClientMessageEx(playerid, COLOR_GREY, "You do not have the keys for that door (SFPD restricted)!");
        }
    }
                                                  //SASD - Elevator
    else if (IsPlayerInRangeOfPoint(playerid,3.0,2530.3774,-1689.9998,562.7922)) {
        if(IsACop(playerid)) {
            SetPlayerFacingAngle(playerid, 359);
            GameTextForPlayer(playerid, "~w~GARAGE", 5000, 1);
            SetPlayerPos(playerid,612.6414,-629.8659,-4.0447);
            SetPlayerVirtualWorld(playerid, 0);
            PlayerInfo[playerid][pVW] = 0;
			Player_StreamPrep(playerid, 612.6414,-629.8659,-4.0447, FREEZE_TIME);
        }
        else {
            return SendClientMessageEx(playerid, COLOR_GRAD2, "Access Denied.");
        }
    }                                                //Gym Garage
    else if (IsPlayerInRangeOfPoint(playerid,8.0,2273.6787,-1728.9022,13.5039)) {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            SetVehiclePos(GetPlayerVehicleID(playerid),  2240.7332,-1695.9648,-0.0826 + 1100);
            SetVehicleZAngle(GetPlayerVehicleID(playerid),  180);
        }
        else {
            Streamer_UpdateEx(playerid, 2240.7332,-1695.9648,-0.0826 + 1100);
            SetPlayerPos(playerid,2240.7332,-1695.9648,-0.0826 + 1100);
            SetPlayerFacingAngle(playerid, 180);
        }
    }
                                                  //Courthouse Garage
    else if (IsPlayerInRangeOfPoint(playerid,8.0,1423.0443,-1664.5244,13.5810)) {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            SetVehiclePos(GetPlayerVehicleID(playerid),  1381.7274,-1676.4248,-13.2229 + 1100);
            SetVehicleZAngle(GetPlayerVehicleID(playerid),  90);
        }
        else {
            Streamer_UpdateEx(playerid,1381.7274,-1676.4248,-13.2229 + 1100);
            SetPlayerPos(playerid,1381.7274,-1676.4248,-13.2229 + 1100);
            SetPlayerFacingAngle(playerid, 90);
        }
    }
                                                  //PB Garage
    else if (IsPlayerInRangeOfPoint(playerid,8.0,1218.69,-1425.01,13.15)) {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            SetVehiclePos(GetPlayerVehicleID(playerid),  1218.8041,-1449.8579,-46.2308 + 1100);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), 360 + 1100);
        }
        else {
            Streamer_UpdateEx(playerid, 1218.8041,-1449.8579,-46.2308 + 1100);
            SetPlayerPos(playerid,1218.8041,-1449.8579,-46.2308 + 1100);
            SetPlayerFacingAngle(playerid, 90);
        }
    }
                                                  // LAOfficeBuilding Roof Entrance
    else if (IsPlayerInRangeOfPoint(playerid,3.0,1779.0928,-1302.7775,131.7344)) {
        SetPlayerPos(playerid, 1771.0253,-1302.8596,125.7209);
        SetPlayerFacingAngle(playerid, 280);
    }
                                                  // LAOfficeBuilding Roof Entrance
    else if (IsPlayerInRangeOfPoint(playerid,3.0,1771.0253,-1302.8596,125.7209)) {
        SetPlayerPos(playerid,1779.0928,-1302.7775,131.7344);
        SetPlayerFacingAngle(playerid, 280);
    }
                                                  // Gold/Plat VIP
    else if (IsPlayerInRangeOfPoint(playerid,3.0,902.2482,1419.8180,-80.9308)) {
        if(PlayerInfo[playerid][pDonateRank] < 3) {
            SendClientMessageEx(playerid, COLOR_WHITE, "* You are not Gold or Platinum VIP!");
        }
        else {
            SetPlayerPos(playerid,911.6200,1426.2729,-81.1762);
            SetPlayerFacingAngle(playerid, 270);
        }
    }

	else if (cCar != INVALID_VEHICLE_ID && (GetVehicleModel(cCar) == 519 || GetVehicleModel(cCar) == 553) && IsPlayerInRangeOfVehicle(playerid, cCar, 5.0) && GetPlayerVehicleID(playerid) != cCar)
	{
	    if(VehicleStatus{cCar} == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not allowed to enter this plane as it's been damaged!");
	    new string[47 + MAX_PLAYER_NAME];
   		format(string, sizeof(string), "* %s enters the airplane as a passenger.", GetPlayerNameEx(playerid));
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

		switch(GetVehicleModel(cCar)) {
			case 519: { // Shamal
				SetPlayerPos(playerid, 2.509036, 23.118730, 1199.593750);
				SetPlayerFacingAngle(playerid, 82.14);
				PlayerInfo[playerid][pInt] = 1;
				SetPlayerInterior(playerid, 1);
			}
			case 553: { // Nevada
				SetPlayerPos(playerid, 315.9396, 973.2628, 1961.5985);
				SetPlayerFacingAngle(playerid, 2.7);
				PlayerInfo[playerid][pInt] = 9;
				SetPlayerInterior(playerid, 9);
			}
		}


        SetCameraBehindPlayer(playerid);
		PlayerInfo[playerid][pVW] = cCar;
		SetPlayerVirtualWorld(playerid, cCar);
		InsidePlane[playerid] = cCar;
		SendClientMessageEx(playerid, COLOR_WHITE, "Type /exit near the door to exit the vehicle, or /window to look outside.");
	}
    return 1;
}
and When I press "Y" it uses this command:
Код:
	if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
		vehicleid = GetPlayerVehicleID(playerid);
		if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510 || DynVeh[vehicleid] != -1 && DynVehicleInfo[DynVeh[vehicleid]][gv_iType] == 1 && GetVehicleModel(vehicleid) == 592) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_ON)
		{
			SetVehicleEngine(vehicleid, playerid);
			format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid, 1));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
		{
			if (GetPVarInt(playerid, "Refueling")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while refueling.");
			format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine starts.", GetPlayerNameEx(playerid, 1));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
			SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
		}
	}
Reply
#2

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == 131072)//CONVERSATION_NO - "N Key"
    
{
        
OnPlayerCommandText(playerid"/enter");
    }
    else if(
newkeys == 65536)//CONVERSATION_YES - "Y Key"
    
{
        
OnPlayerCommandText(playerid"/engine");
    }

I think this will describe itselfs. Hopefully it will work with your CMD-Version.
Reply
#3

If you want to do a cmd by pressing any button you make it in "OnPlayerKeyStateChange".
Also visit this for more info about what button is wich key: https://sampwiki.blast.hk/wiki/Keys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)