Disable Tune Garages
#1

Hey,

I have read somewhere that when you want to disable tune garages you need to remove the garage door and add a object infront.

I did that but as soon as I come close to one of the doors it gives opcodes.

pawn Code:
//Transfender doors
    RemoveBuildingForPlayer(playerid, 5340, 2644.8594, -2039.2344, 14.0391, 0.25);
    RemoveBuildingForPlayer(playerid, 5422, 2071.4766, -1831.4219, 14.5625, 0.25);
    RemoveBuildingForPlayer(playerid, 5856, 1024.9844, -1029.3516, 33.1953, 0.25);
    RemoveBuildingForPlayer(playerid, 5779, 1041.3516, -1025.9297, 32.6719, 0.25);
    RemoveBuildingForPlayer(playerid, 10575, -2716.3516, 217.4766, 5.3828, 0.25);
    RemoveBuildingForPlayer(playerid, 9093, 2386.6563, 1043.6016, 11.5938, 0.25);
    RemoveBuildingForPlayer(playerid, 6400, 488.2813, -1734.6953, 12.3906, 0.25);
    RemoveBuildingForPlayer(playerid, 11313, -1935.8594, 239.5313, 35.3516, 0.25);
    RemoveBuildingForPlayer(playerid, 11319, -1904.5313, 277.8984, 42.9531, 0.25);
    RemoveBuildingForPlayer(playerid, 9625, -2425.7266, 1027.9922, 52.2813, 0.25);
    RemoveBuildingForPlayer(playerid, 7891, 1968.7422, 2162.4922, 12.0938, 0.25);
    RemoveBuildingForPlayer(playerid, 3294, -1420.5469, 2591.1563, 57.7422, 0.25);
    RemoveBuildingForPlayer(playerid, 3294, -100.0000, 1111.4141, 21.6406, 0.25);

//transfender doors
    CreateDynamicObject(5856, 1024.98438, -1029.35156, 33.19530,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(5779, 1041.35156, -1026.03467, 32.67190,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(5422, 2071.47656, -1831.42188, 14.56250,   0.00000, 0.00000, 0.00000);
    CreateDynamicObject(5340, 2644.85938, -2039.23438, 14.03910,   0.00000, 0.00000, -90.00000);
    CreateDynamicObject(9093, 2386.65625, 1043.60156, 11.59380,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(10575, -2716.35156, 217.47659, 5.38280,   0.00000, 0.00000, 180.00000);
    CreateDynamicObject(3294, -1420.54688, 2591.15625, 57.74220,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(3294, -100.00000, 1111.41406, 21.64060,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(9625, -2425.72656, 1027.99219, 52.28130,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(11313, -1935.85938, 239.53130, 35.35160,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(11319, -1904.53125, 277.89841, 42.95310,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(6400, 488.28131, -1734.69531, 12.39060,   0.00000, 0.00000, 78.19448);
    CreateDynamicObject(7891, 1968.74219, 2162.49219, 12.09380,   0.00000, 0.00000, 0.00000);
How to fix this?
Reply
#2

Hmm, why don't you let him enter and remove him then?

Like, he is entering a mod shop and the callback is called

pawn Code:
public OnEnterExitModShop(playerid, enterexit, interiorid)
{
    if(enterexit == 1) // If enterexit is 1, this means they are entering
    {
        SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z); // Change the coordinates
        SetPlayerInterior(playerid, 0); // Back to the normal interior
    }
    return 1;
}
Reply
#3

Because I seen servers where its just disabled. And I dont want to make a bypass I just want to make it closed
Reply
#4

*Bump*
Reply
#5

Alright, I tested this a minute ago and it works fine. I don't get any opcode warning and it prevents it

pawn Code:
public OnGameModeInit( )
{
    CreateObject(971, -2715.97388, 217.96039, 3.80217,   0.00000, 0.00000, -90.00000); // Arch - SF
    return 1;
}

public OnPlayerConnect( playerid )
{
    RemoveBuildingForPlayer(playerid, 10575, -2716.3516, 217.4766, 5.3828, 0.25); // Arch - SF
    return 1;
}
I tested only the mod shop which is located to SF (arch) for elegy/sultan etc.

If you let players spawn vehicles, then it may fails because a player A can push playe B with forklift inside the gate and if player B spawns a vehicle, then he can tune it! You can add what I told you on my first post to prevent that kind of things.

EDIT: I had time and I removed garage doors/added gates. Have fun!
pawn Code:
/* REMOVING GARAGE DOOR - ADDING GATE :: MOD SHOPS

    CreateObject(971, -2715.9738, 217.9603, 3.8021, 0.00000, 0.00000, -90.00000); // SF - Wheel Arch Angels
    RemoveBuildingForPlayer(playerid, 10575, -2716.3516, 217.4766, 5.3828, 0.25);  // SF - Wheel Arch Angels
   
    CreateObject(971, -1935.48157, 239.04761, 33.76325, 0.00000, 0.00000, 0.00000); // SF - TransFender
    RemoveBuildingForPlayer(playerid, 11313, -1935.8594, 239.5313, 35.3516, 0.25); // SF - TransFender
   
    CreateObject(971, 2387.05225, 1043.28174, 10.06653, 0.00000, 0.00000, 0.00000); // LV - TransFender
    RemoveBuildingForPlayer(playerid, 9093, 2386.6563, 1043.6016, 11.5938, 0.25); // LV - TransFender
   
    CreateObject(971, 1042.46680, -1026.00427, 31.93635, 0.00000, 0.00000, 0.00000); // LS - TransFender
    RemoveBuildingForPlayer(playerid, 5779, 1041.3516, -1025.9297, 32.6719, 0.25); // LS - TransFender
   
    CreateObject(971, 2644.86719, -2039.28308, 11.50120, 0.00000, -90.00000, 0.00000); // LS - Loco Low Co.
    RemoveBuildingForPlayer(playerid, 5340, 2644.8594, -2039.2344, 14.0391, 0.25); // LS - Loco Low Co.
*/
PS: The last one on the Loco Low Co. was too small so I changed the rotation to vertically and the sign it has on it, it's in 90 degrees.
Reply
#6

Quote:
Originally Posted by _Zeus
View Post
Alright, I tested this a minute ago and it works fine. I don't get any opcode warning and it prevents it

pawn Code:
public OnGameModeInit( )
{
    CreateObject(971, -2715.97388, 217.96039, 3.80217,   0.00000, 0.00000, -90.00000); // Arch - SF
    return 1;
}

public OnPlayerConnect( playerid )
{
    RemoveBuildingForPlayer(playerid, 10575, -2716.3516, 217.4766, 5.3828, 0.25); // Arch - SF
    return 1;
}
I tested only the mod shop which is located to SF (arch) for elegy/sultan etc.

If you let players spawn vehicles, then it may fails because a player A can push playe B with forklift inside the gate and if player B spawns a vehicle, then he can tune it! You can add what I told you on my first post to prevent that kind of things.

EDIT: I had time and I removed garage doors/added gates. Have fun!
pawn Code:
/* REMOVING GARAGE DOOR - ADDING GATE :: MOD SHOPS

    CreateObject(971, -2715.9738, 217.9603, 3.8021, 0.00000, 0.00000, -90.00000); // SF - Wheel Arch Angels
    RemoveBuildingForPlayer(playerid, 10575, -2716.3516, 217.4766, 5.3828, 0.25);  // SF - Wheel Arch Angels
   
    CreateObject(971, -1935.48157, 239.04761, 33.76325, 0.00000, 0.00000, 0.00000); // SF - TransFender
    RemoveBuildingForPlayer(playerid, 11313, -1935.8594, 239.5313, 35.3516, 0.25); // SF - TransFender
   
    CreateObject(971, 2387.05225, 1043.28174, 10.06653, 0.00000, 0.00000, 0.00000); // LV - TransFender
    RemoveBuildingForPlayer(playerid, 9093, 2386.6563, 1043.6016, 11.5938, 0.25); // LV - TransFender
   
    CreateObject(971, 1042.46680, -1026.00427, 31.93635, 0.00000, 0.00000, 0.00000); // LS - TransFender
    RemoveBuildingForPlayer(playerid, 5779, 1041.3516, -1025.9297, 32.6719, 0.25); // LS - TransFender
   
    CreateObject(971, 2644.86719, -2039.28308, 11.50120, 0.00000, -90.00000, 0.00000); // LS - Loco Low Co.
    RemoveBuildingForPlayer(playerid, 5340, 2644.8594, -2039.2344, 14.0391, 0.25); // LS - Loco Low Co.
*/
PS: The last one on the Loco Low Co. was too small so I changed the rotation to vertically and the sign it has on it, it's in 90 degrees.
This is exactly what i did, but for me It crashed.
Reply
#7

Add the barrier, but do not remove the actual gate for it. As when you get near, it's GTAs instinct to open it, and without it being there it will bug, and most likely make you crash. So basically:
pawn Code:
// remove the 'RemoveBuilding'

//transfender doors
    CreateDynamicObject(5856, 1024.98438, -1029.35156, 33.19530,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(5779, 1041.35156, -1026.03467, 32.67190,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(5422, 2071.47656, -1831.42188, 14.56250,   0.00000, 0.00000, 0.00000);
    CreateDynamicObject(5340, 2644.85938, -2039.23438, 14.03910,   0.00000, 0.00000, -90.00000);
    CreateDynamicObject(9093, 2386.65625, 1043.60156, 11.59380,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(10575, -2716.35156, 217.47659, 5.38280,   0.00000, 0.00000, 180.00000);
    CreateDynamicObject(3294, -1420.54688, 2591.15625, 57.74220,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(3294, -100.00000, 1111.41406, 21.64060,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(9625, -2425.72656, 1027.99219, 52.28130,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(11313, -1935.85938, 239.53130, 35.35160,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(11319, -1904.53125, 277.89841, 42.95310,   0.00000, 0.00000, 90.00000);
    CreateDynamicObject(6400, 488.28131, -1734.69531, 12.39060,   0.00000, 0.00000, 78.19448);
    CreateDynamicObject(7891, 1968.74219, 2162.49219, 12.09380,   0.00000, 0.00000, 0.00000);
Reply
#8

That's really weird then. I tried all of the garage with differect vehicles (3 categories) and I didn't even give me one op code. Then, you can add the object you added or I gave you or the user above and do not remove any garage door. It will open, but it will still block it!
Reply
#9

Well I just created all those Objects and I keep crashing while coming close...
Reply
#10

Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)