How would I make the /enter & /exit work with vehicles?
#1

Код:
CMD:enter(playerid, params[])
{
	new string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
	    {
	        if(DoorInfo[idx][dIInt] == 83 && DoorInfo[idx][dIVW] == 8473 && BankBlock)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "You can't enter the bank as it is being robbed at the moment.");
	            return 1;
	        }
	        if(DoorInfo[idx][dCInt])
	        {
	            GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
				TogglePlayerControllable(playerid, 0);
	            SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
	            PlayerInfo[playerid][pSpawnFreeze] = 1;
	        }
	        PlayerInfo[playerid][pSpawnFreeze] = 0;
	        SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
	        SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
	        SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
	        SetCameraBehindPlayer(playerid);
	        SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
	        return 1;
	    }
 }
Код:
CMD:exit(playerid, params[])
{
	new done, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
	{
	    if(!done && IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]) && GetPlayerVirtualWorld(playerid) == DoorInfo[idx][dIVW] && GetPlayerInterior(playerid) == DoorInfo[idx][dIInt])
	    {
	        if(BankRobber[playerid] && BankBlock && GetPlayerInterior(playerid) == 83 && GetPlayerVirtualWorld(playerid) == 8473)
	        {
	       	    new Rob = BankRobber[playerid]-1;
			    DisablePlayerCheckpoint(playerid);
				BankRobbersCount --;
				format(BankRobbers[Rob], MAX_PLAYER_NAME, "");
				DeliverMoney[playerid] = 0;
				//
				foreach(Player, i)
				{
				    if(BankRobber[i] || PlayerInfo[i][pFac] == 1)
				    {
						if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1);
						else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2);
						else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3);
						else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4);
						else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5);
					}
				}
				format(string, sizeof(string), "** %s has went out of the bank before loading money and has failed the robbery. **", RPN(playerid));
				SendRobberyMessage(COLOR_LIGHTRED, string);
				SendCopMessage(COLOR_LIGHTRED, string);
				BankRobber[playerid] = 0;
				if(BankRobbersCount == 0)
				{
					TextDrawHideForAll(Textdraw0);
					TextDrawHideForAll(Textdraw1);
					TextDrawHideForAll(Textdraw2);
					TextDrawHideForAll(Textdraw3);
					TextDrawHideForAll(Textdraw4);
					TextDrawHideForAll(Textdraw5);
					BankRobbery = 0;
					RobberyStarted = 0;
					format(string, sizeof(string), "** The bank robbery has ended, $%d were stolen and $%d were saved. **", TotalStolen*10000, (TotalRobbers*10000-(TotalStolen*10000)));
					SendClientMessageToAll(COLOR_YELLOW, string);
					TotalRobbers = 0;
					new copsonline;
					foreach(Player, i)
					{
					    if(IsACop(i)) copsonline++;
					}
					foreach(Player, i)
					{
					    if(IsACop(i))
					    {
							new Saved = (TotalRobbers*10000-(TotalStolen*10000));
							GiveDavidMoney(i, Saved/copsonline);
							format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
							SendClientMessage(i, COLOR_LIME, string);
					    }
					}
				}
	            return 1;
	        }
	        if(DoorInfo[idx][dCExt])
	        {
	            GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 3);
				TogglePlayerControllable(playerid, 0);
	            SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
	            PlayerInfo[playerid][pSpawnFreeze] = 1;
	        }
	        PlayerInfo[playerid][pSpawnFreeze] = 0;
	        SetPlayerInterior(playerid, DoorInfo[idx][dOInt]);
	        SetPlayerVirtualWorld(playerid, DoorInfo[idx][dOVW]);
	        SetPlayerFacingAngle(playerid, DoorInfo[idx][dOA]);
	        SetCameraBehindPlayer(playerid);
	        SetPlayerPos(playerid, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]);
	        done = 1;
	    }
	}
	if(IsPlayerInRangeOfPoint(playerid, 2, 243.9951,304.9418,999.1484) || IsPlayerInRangeOfPoint(playerid, 2, 2259.6702,-1135.8542,1050.6328) || IsPlayerInRangeOfPoint(playerid, 2, 2308.8254,-1212.8070,1049.0234) || IsPlayerInRangeOfPoint(playerid, 2, 260.7436,1237.5563,1084.2578)
	|| IsPlayerInRangeOfPoint(playerid, 2, -42.5742,1405.6521,1084.4297) || IsPlayerInRangeOfPoint(playerid, 2, 2468.6787,-1698.2617,1013.5078) || IsPlayerInRangeOfPoint(playerid, 2, 2365.2183,-1135.4014,1050.8750) || IsPlayerInRangeOfPoint(playerid, 2, 2270.1270,-1210.4855,1047.5625)
	|| IsPlayerInRangeOfPoint(playerid, 2, 2324.4424,-1149.2057,1050.7101) || IsPlayerInRangeOfPoint(playerid, 2, 83.0863,1322.3020,1083.8662)) // Houses
	{
	    new idx;
		idx = GetPlayerVirtualWorld(playerid)-500;
		if(!done && idx < MAX_HOUSES && HouseInfo[idx][hLevel])
		{
			format(string, sizeof(string), "* %s pushes the door and exits the house.", RPN(playerid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	        SetPlayerPos(playerid, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]);
	        SetPlayerInterior(playerid, 0);
	        SetPlayerVirtualWorld(playerid, 0);
	        done = 1;
        }
	}
    if(IsPlayerInRangeOfPoint(playerid, 2, -27.3025,-57.6649,1003.5469) || IsPlayerInRangeOfPoint(playerid, 2, 207.0638,-139.9965,1003.5078) || IsPlayerInRangeOfPoint(playerid, 2, 285.8044,-85.9956,1001.5229) || IsPlayerInRangeOfPoint(playerid, 2, 493.4252,-24.3061,1000.6797) || IsPlayerInRangeOfPoint(playerid, 2, 834.1631,7.4883,1004.1797) || IsPlayerInRangeOfPoint(playerid, 2, 372.3830,-133.2579,1001.4922)) // 24/7 || Clothes Shop || Ammunation || Club || Advertisement Agency || FastFood
	{
	    new idx;
		idx = GetPlayerVirtualWorld(playerid)-100;
		if(!done && idx < MAX_BIZ && BizInfo[idx][bType])
		{
			format(string, sizeof(string), "* %s pushes the door and exits the shop.", RPN(playerid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	        SetPlayerPos(playerid, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]);
	        SetPlayerInterior(playerid, 0);
	        SetPlayerVirtualWorld(playerid, 0);
        }
        done = 1;
	}
	return 1;
}
Reply
#2

you need an if in car get carid and seat id tp the car and place player in their seat id in the car id
Reply
#3

No clue how to do that tbh :L
Reply
#4

in any car at all?
car id?
seat #?
link to int(if going in an int)
set the pos
and set vw
Reply
#5

I just want it so when I type /enter at a door, it will allow me to take my car through it
Reply
#6

Also, is it even possible?
Reply
#7

bump
Reply
#8

lol...correct me if im wrong...but isnt button "enter" for that?? lol :P
Reply
#9

No I mean like see if you type /enter it will load you to a different pos with different int etc, I want it so that the car will go with it not just the person.
Reply
#10

Quote:
Originally Posted by Raximax
Посмотреть сообщение
No I mean like see if you type /enter it will load you to a different pos with different int etc, I want it so that the car will go with it not just the person.
ohh sorry then i misunderstood it
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)