Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:enter(playerid, params[])
- {
- new string[128];
- for(new i = 0; i < sizeof(DoorInfo); i++)
- for(new b = 1; b < sizeof(BusinessInfo); b++)//Loops through all the businesses.
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 389.6382, 173.8151, 1008.2424))
- {
- SetPlayerPos(playerid, 1481.1545, -1771.3710, 18.9013);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 1481.1545, -1771.3710, 18.9013))
- {
- SetPlayerPos(playerid, 389.6382, 173.8151, 1008.2424);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.0, -2029.7515, -118.6284, 1035.4371))
- {
- SetPlayerPos(playerid, 2045.6399, -1913.1650, 13.7576);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 2045.6399, -1913.1650, 13.7576))
- {
- SetPlayerPos(playerid, -2029.7515, -118.6284, 1035.4371);
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1172.3539, -1323.5497, 15.1271))
- {
- SetPlayerPos(playerid, 1170.0100, -1355.9119, 2423.1870);
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1170.0100, -1355.9119, 2423.1870))
- {
- SetPlayerPos(playerid, 1172.3539, -1323.5497, 15.1271);
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, BusinessInfo[b][bEntranceX], BusinessInfo[b][bEntranceY], BusinessInfo[b][bEntranceZ]))//Checks if player is near the entrance.
- {
- if(BusinessInfo[b][bLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Business is locked!");//Checks it it is locked/
- SetPlayerPos(playerid, BusinessInfo[b][bExitX], BusinessInfo[b][bExitY], BusinessInfo[b][bExitZ]);
- SetPlayerFacingAngle(playerid, BusinessInfo[b][bExitA]);
- SetPlayerInterior(playerid, BusinessInfo[b][bInsideInt]);
- SetPlayerVirtualWorld(playerid, BusinessInfo[b][bInsideWorld]);
- InsideBiz[playerid] = b;
- return 1;
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, BusinessInfo[b][bExitX], BusinessInfo[b][bExitY], BusinessInfo[b][bExitZ]) && GetPlayerVirtualWorld(playerid) == BusinessInfo[b][bInsideWorld])//Checks if player is in near the exit.
- {
- SetPlayerPos(playerid, BusinessInfo[b][bEntranceX], BusinessInfo[b][bEntranceY], BusinessInfo[b][bEntranceZ]);
- SetPlayerFacingAngle(playerid, BusinessInfo[b][bEntranceA]);
- SetPlayerInterior(playerid, BusinessInfo[b][bInt]);
- SetPlayerVirtualWorld(playerid, BusinessInfo[b][bWorld]);
- InsideBiz[playerid] = 0;
- return 1;
- }
- if(IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][ddExteriorX], DoorInfo[i][ddExteriorY], DoorInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddExteriorVW])
- {
- format(string, sizeof(string), "* %s entered %s.", GetPlayerNameEx(playerid), DoorInfo[i][ddName]);
- ProxDetector(25.0, playerid, string, COLOR_PURPLE);
- SetPlayerInterior(playerid,DoorInfo[i][ddInteriorInt]);
- PlayerInfo[playerid][pInt] = DoorInfo[i][ddInteriorInt];
- PlayerInfo[playerid][pVW] = DoorInfo[i][ddInteriorVW];
- SetPlayerVirtualWorld(playerid, DoorInfo[i][ddInteriorVW]);
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER){
- SetPlayerPos(playerid,DoorInfo[i][ddInteriorX],DoorInfo[i][ddInteriorY],DoorInfo[i][ddInteriorZ]);
- }
- SetPlayerFacingAngle(playerid, DoorInfo[i][ddInteriorA]);
- SetCameraBehindPlayer(playerid);
- if(DoorInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new car;
- car = GetPlayerVehicleID(playerid);
- SetVehiclePos(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorX],DoorInfo[i][ddInteriorY],DoorInfo[i][ddInteriorZ]);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorA]);
- SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorVW]);
- PutPlayerInVehicle(playerid, car, 0);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorInt]);
- return 1;
- }
- }
- if(IsPlayerInRangeOfPoint(playerid,3,DoorInfo[i][ddInteriorX], DoorInfo[i][ddInteriorY], DoorInfo[i][ddInteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddInteriorVW])
- {
- if(DoorInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new car;
- car = GetPlayerVehicleID(playerid);
- SetVehiclePos(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorX],DoorInfo[i][ddExteriorY],DoorInfo[i][ddExteriorZ]);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorA]);
- SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorVW]);
- PutPlayerInVehicle(playerid, car, 0);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorInt]);
- }
- format(string, sizeof(string), "* %s exited %s.", GetPlayerNameEx(playerid), DoorInfo[i][ddName]);
- ProxDetector(25.0, playerid, string, COLOR_PURPLE);
- SetPlayerInterior(playerid,DoorInfo[i][ddExteriorInt]);
- PlayerInfo[playerid][pInt] = DoorInfo[i][ddExteriorInt];
- SetPlayerVirtualWorld(playerid, DoorInfo[i][ddExteriorVW]);
- PlayerInfo[playerid][pVW] = DoorInfo[i][ddExteriorVW];
- if(DoorInfo[i][ddCustomExterior])
- {
- LoadObjectsForPlayer(playerid);
- }
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER){
- SetPlayerPos(playerid,DoorInfo[i][ddExteriorX],DoorInfo[i][ddExteriorY],DoorInfo[i][ddExteriorZ]);
- SetPlayerFacingAngle(playerid, DoorInfo[i][ddExteriorA]);
- SetCameraBehindPlayer(playerid);
- }
- }
- }
- return 1;
- }
- CMD:exit(playerid, params[]) return cmd_enter(playerid, params);
Advertisement
Add Comment
Please, Sign In to add comment