SA-MP Forums Archive
Disable Tune Garages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Disable Tune Garages (/showthread.php?tid=440380)



Disable Tune Garages - Stefand - 29.05.2013

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?


Re: Disable Tune Garages - Konstantinos - 29.05.2013

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;
}



Re: Disable Tune Garages - Stefand - 29.05.2013

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


Re: Disable Tune Garages - Stefand - 30.05.2013

*Bump*


Re: Disable Tune Garages - Konstantinos - 30.05.2013

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.


Re: Disable Tune Garages - Stefand - 31.05.2013

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.


Re: Disable Tune Garages - dubyabeast - 31.05.2013

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);



Re: Disable Tune Garages - Konstantinos - 31.05.2013

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!


Re: Disable Tune Garages - Stefand - 31.05.2013

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


Re: Disable Tune Garages - Stefand - 01.06.2013

Anyone?