Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**************************************************************************/
- // Admin House
- /*************************************************************************/
- /**************************************************************************/
- // Version 1.0 | Build 1
- /*************************************************************************/
- /**
- * Copyright (c) 2015-2016 San Andreas Playground
- *
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
- /*AUTHOR ********************
- @Yaa - SA-MP Lead Scripter
- ***************************/
- // Includes ========================================================================================
- #include <a_samp>
- #include <zcmd>
- #include <streamer>
- // Defines ========================================================================================
- #define SERVERNAME "San Andreas Playground"
- #define R "{F81414}"
- #define O "{FFAF00}"
- #define YE "{FFFF00}"
- #define GRI "{C0C0C0}"
- #define COLOR_GREEN 0x33AA33AA
- #if !defined isnull
- #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- // Variables & Forwards ============================================================================
- new Gate;
- new AHCP[4];
- new Material[2];
- new Pick[9];
- new PropTycoon[MAX_PLAYERS];
- new AudioDJ[MAX_PLAYERS];
- forward GateTimer();
- forward PropTimer(playerid);
- forward OnDJUpdate(playerid);
- // Script =========================================================================================
- public OnFilterScriptInit()
- {
- print("****************************************");
- print("----------------------------------------");
- print(" ADMIN HOUSE BY Yaa ");
- print("----------------------------------------");
- print("****************************************");
- print("----------------------------------------");
- print(" VERSION : 1.0 ");
- print("----------------------------------------");
- print("****************************************");
- print("----------------------------------------");
- print(" LOADED ! ");
- print("----------------------------------------");
- print("****************************************");
- SetTimer("PropTimer", 180000, true);
- SetTimer("OnDJUpdate", 1000, true);
- AHCP[0] = CreateDynamicCP(2286.8909, 607.1381, 10.8203, 4.0, -1, -1,-1, 100.0);
- AHCP[1] = CreateDynamicCP(2295.1748, 598.6633, 10.8871, 4.0, -1, -1,-1, 100.0);
- AHCP[2] = CreateDynamicCP(2303.3950, 568.3408, 11.4777, 5.0, -1, -1,-1, 100.0);
- AHCP[3] = CreateDynamicCP(969.3793, -48.8615, 1001.1172, 2.0, -1, -1,-1, 100.0);
- Create3DTextLabel(""R"[Open The Gate]", 0xF67E0FF, 2295.1748, 598.6633, 10.8871 + 0.75, 50.0, 0, 0);
- Create3DTextLabel(""R"[Open The Gate]", 0xF67E0FF, 2286.8909, 607.1381, 10.8203 + 0.75, 50.0, 0, 0);
- Create3DTextLabel(""R"[Some Drunk ?]", 0xF67E0FF, 2303.3950, 568.3408, 11.4777 + 0.75, 50.0, 0, 0);
- Create3DTextLabel(""R"[Some Drunk ?]", 0xF67E0FF, 969.3793, -48.8615, 1001.1172 + 0.75, 50.0, 0, 0);
- Pick[0] = CreatePickup(1318, 2, 2272.5313, 566.2311, 12.8723, -1); // In House/
- Pick[1] = CreatePickup(1273, 2, 2268.5154, 566.3914, 12.8710, -1); // prop/
- Pick[2] = CreatePickup(356, 2, 954.9329, -50.7714, 1001.1172, -1); // M4/
- Pick[3] = CreatePickup(362, 2, 951.6969, -50.7847, 1001.1172, -1); // Mini/
- Pick[4] = CreatePickup(372, 2, 944.2313, -50.7664, 1001.1172, -1); // Tec9/
- Pick[5] = CreatePickup(1240, 2, 959.2720, -53.5876, 1001.1172, -1); // HP/
- Pick[6] = CreatePickup(351, 2, 948.1009, -50.6544, 1001.1172, -1); // C-Shotgun/
- Pick[7] = CreatePickup(1318, 2, 965.3690, -53.2936, 1001.1246, -1); // Out House/
- Pick[8] = CreatePickup(1242, 2, 959.1024, -48.3749, 1001.1172, -1); // Arm/
- Create3DTextLabel(""R"[Wanna go out ?]", 0xF67E0FF, 965.3690, -53.2936, 1001.1246 + 0.75, 50.0, 0, 0);
- Create3DTextLabel(""R"[Admin House]", 0xF67E0FF, 2272.5313, 566.2311, 12.8723 + 0.75, 50.0, 0, 0);
- Create3DTextLabel(""R"[AHouse Property]", 0xF67E0FF, 2268.5154, 566.3914, 12.8710 + 0.75, 50.0, 0, 0);
- CreateObject(18769, 2287.41406, 593.49615, 9.22306, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2267.57739, 593.50885, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2247.56006, 593.48297, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2247.48901, 573.59161, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2247.39697, 553.69458, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2267.21021, 573.76227, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2287.31323, 573.77570, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2307.18140, 593.51007, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2326.93140, 593.50330, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2346.85229, 593.44965, 9.24390, 0.00000, 0.00000, -1.02000);
- CreateObject(18769, 2307.12476, 573.60931, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2326.62305, 573.94702, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2346.43091, 573.81006, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2366.22363, 573.83649, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2366.30713, 593.55310, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2386.45483, 593.62506, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2386.43335, 573.99255, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2267.35059, 553.82764, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2287.25928, 553.79565, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2306.69409, 553.71844, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2326.36157, 553.96759, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2346.28320, 554.27759, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2366.20044, 554.42090, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(18769, 2386.36060, 554.46118, 9.24390, 0.00000, 0.00000, 0.00000);
- CreateObject(16133, 2289.04785, 545.26080, -12.52072, 0.00000, 0.00000, -97.14001);
- CreateObject(16133, 2290.14087, 537.65320, -11.46871, 0.00000, 0.00000, -97.14001);
- CreateObject(16133, 2289.13818, 530.48547, -13.93207, 0.00000, 0.00000, -97.14001);
- CreateObject(16133, 2288.45386, 523.84082, -10.47248, 0.00000, 0.00000, -97.14001);
- CreateObject(16133, 2356.84961, 540.39856, -11.46871, 0.00000, 0.00000, -97.14001);
- CreateObject(16133, 2355.92285, 538.98883, -11.46871, 0.00000, 0.00000, -97.14001);
- CreateObject(16133, 2356.88354, 532.86493, -11.46871, 0.00000, 0.00000, -97.14001);
- CreateObject(16133, 2357.36182, 525.33746, -11.46871, 0.00000, 0.00000, -97.14001);
- CreateObject(19129, 2237.46753, 593.40411, 11.82611, -89.22000, -8.94001, -99.18001);
- CreateObject(19129, 2237.26758, 573.43958, 11.82611, -89.22000, -8.94001, -99.18001);
- CreateObject(19129, 2237.11548, 553.55188, 11.82611, -89.22000, -8.94001, -99.18001);
- CreateObject(19129, 2247.51001, 603.15607, 11.82611, -89.22000, -8.94001, -188.87987);
- CreateObject(19129, 2267.45361, 603.17096, 11.82611, -89.22000, -8.94001, -188.87987);
- CreateObject(19129, 2307.23340, 603.47516, 11.82611, -89.22000, -8.94001, -188.87987);
- CreateObject(19129, 2327.14648, 603.44525, 11.82611, -89.22000, -8.94001, -188.87987);
- CreateObject(19129, 2347.05151, 603.46289, 11.82611, -89.22000, -8.94001, -188.87987);
- CreateObject(19129, 2366.83154, 603.44446, 11.82611, -89.22000, -8.94001, -188.87987);
- CreateObject(19129, 2386.62305, 603.41333, 11.82611, -89.22000, -8.94001, -188.87987);
- CreateObject(19129, 2396.50635, 593.49481, 11.82611, -89.27999, 76.98002, -193.07974);
- CreateObject(19129, 2396.61450, 573.66620, 12.00707, -89.27999, 76.98002, -193.07974);
- CreateObject(19129, 2396.83203, 553.79407, 12.14508, -89.27999, 76.98002, -192.47961);
- CreateObject(5708, 2284.14307, 527.44922, 20.62795, 0.00000, 0.00000, 88.86001);
- CreateObject(3235, 2308.19531, 567.01825, 18.56862, 0.00000, 0.00000, 0.00000);
- CreateObject(3235, 2308.22192, 565.69470, 21.92703, 0.00000, 0.00000, 0.00000);
- CreateObject(19129, 2387.21436, 543.72546, 12.24355, -89.27999, 76.98002, -283.43958);
- CreateObject(19129, 2367.45435, 543.71558, 12.24355, -89.27999, 76.98002, -283.43958);
- CreateObject(19129, 2347.49219, 543.43817, 12.24355, -89.27999, 76.98002, -283.43958);
- CreateObject(19129, 2327.48340, 543.25854, 12.24355, -89.27999, 76.98002, -283.43958);
- CreateObject(3381, 2279.76636, 662.49042, 19.40916, 0.00000, 0.00000, 0.00000);
- CreateObject(18750, 2288.80493, 554.87823, 45.83255, 81.06000, -1.86000, -177.95999);
- CreateObject(2774, 2303.48608, 565.25372, 22.18055, -90.42004, -49.50004, -141.05998);
- CreateObject(4726, 2373.70825, 559.63513, 8.98374, 0.00000, 0.00000, 0.00000);
- CreateObject(19608, 2311.21655, 567.95654, 10.57095, 0.00000, 0.00000, -181.44000);
- CreateObject(2357, 2311.50684, 568.39404, 10.60618, 0.00000, 0.00000, 0.00000);
- CreateObject(14820, 2311.60669, 568.09222, 11.01249, 0.00000, 0.00000, 0.00000);
- CreateObject(16151, 2302.43262, 566.70648, 10.66941, 0.00000, 0.00000, -91.31998);
- CreateObject(19525, 2312.74634, 568.62579, 10.96932, 0.00000, 0.00000, 0.00000);
- CreateObject(19128, 2312.42139, 572.08673, 10.59662, 0.00000, 0.00000, 0.00000);
- CreateObject(19128, 2308.47168, 572.11829, 10.59662, 0.00000, 0.00000, 0.00000);
- CreateObject(19128, 2308.51733, 576.04498, 10.66716, 0.54000, 0.00000, -1.14000);
- CreateObject(19128, 2312.45605, 576.05646, 10.66716, 0.54000, 0.00000, -1.14000);
- CreateObject(19126, 2297.21143, 604.73682, 11.38630, 0.00000, 0.00000, 0.00000);
- CreateObject(19125, 2277.68774, 605.59125, 11.52202, 0.00000, 0.00000, 0.00000);
- CreateObject(3749, 2287.30615, 601.69061, 15.73635, 0.00000, 0.00000, 0.00000);
- AddStaticVehicle(400,2392.8188,596.7346,11.0004,267.3526,113,1); //
- AddStaticVehicle(411,2392.3850,592.0210,10.6350,268.1196,64,1); //
- AddStaticVehicle(411,2392.4087,585.2180,10.6350,268.5349,64,1); //
- AddStaticVehicle(411,2378.4189,599.4998,10.6350,3.5713,64,1); //
- AddStaticVehicle(411,2370.0293,599.9122,10.6351,0.1222,64,1); //
- AddStaticVehicle(411,2335.4807,577.0782,10.6350,92.4285,64,1); //
- AddStaticVehicle(411,2340.9902,558.7956,10.6351,311.3929,64,1); //
- AddStaticVehicle(411,2286.2559,570.4310,11.1275,1.4054,64,1); //
- AddStaticVehicle(411,2255.9441,569.6462,11.1232,357.0736,64,1); //
- Material[0] = CreateObject(7912, 2270.11206, 569.69958, 18.64508, 0.00000, 0.00000, -180.84007);
- Material[1] = CreateObject(7912, 2268.12622, 603.17303, 17.93111, 0.00000, 0.00000, -180.84007);
- Gate = CreateObject(19313, 2286.55200, 603.00012, 12.55811, 0.00000, 0.00000, 0.00000);
- CreateObject(19893, 2294.58667, 599.31744, 11.05213, 0.00000, 0.00000, 0.00000);
- SetObjectMaterialText(Material[0], ""R""SERVERNAME" \n"O"Admin House \n"YE" Have Fun !", 0, OBJECT_MATERIAL_SIZE_512x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- SetObjectMaterialText(Material[1], ""R""SERVERNAME" \n"O"Admin House \n"YE" STAFF Only !", 0, OBJECT_MATERIAL_SIZE_512x128, "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- AudioDJ[playerid] = 0;
- PropTycoon[playerid] = 0;
- RemoveBuildingForPlayer(playerid, 8969, 2071.6250, 702.8906, 22.0078, 0.25);
- RemoveBuildingForPlayer(playerid, 3459, 2257.3750, 623.4297, 17.2969, 0.25);
- RemoveBuildingForPlayer(playerid, 1350, 2277.2578, 627.6719, 9.8125, 0.25);
- RemoveBuildingForPlayer(playerid, 1350, 2297.5000, 638.7891, 9.7422, 0.25);
- RemoveBuildingForPlayer(playerid, 1350, 2281.8125, 643.3359, 9.7891, 0.25);
- RemoveBuildingForPlayer(playerid, 1294, 2283.2656, 653.8125, 14.3047, 0.25);
- RemoveBuildingForPlayer(playerid, 1294, 2291.5625, 692.0938, 14.3047, 0.25);
- RemoveBuildingForPlayer(playerid, 1350, 2293.0156, 703.1172, 9.7969, 0.25);
- RemoveBuildingForPlayer(playerid, 3459, 2346.6484, 623.4297, 17.2969, 0.25);
- RemoveBuildingForPlayer(playerid, 3459, 2411.7656, 623.4297, 17.2969, 0.25);
- RemoveBuildingForPlayer(playerid, 8596, 2490.4297, 703.1953, 21.9453, 0.25);
- return 1;
- }
- public OnPlayerEnterDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == AHCP[0])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""R"Error: "GRI"We are not able to open gate, You Need admin powers !");
- MoveObject(Gate, 2286.55200, 603.00012, 6.92593, 2.00);
- SendClientMessage(playerid, COLOR_GREEN, "Welcome Back Administrator !");
- SetTimer("GateTimer", 5000, false);
- }
- else if(checkpointid == AHCP[1])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""R"Error: "GRI"We are not able to open gate, You Need admin powers !");
- MoveObject(Gate, 2286.55200, 603.00012, 6.92593, 2.00);
- SendClientMessage(playerid, COLOR_GREEN, "See You later Administrator ! ");
- SetTimer("GateTimer", 5000, false);
- }
- else if(checkpointid == AHCP[2])
- {
- if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need at last 200 $ for buy a drunk !");
- ShowPlayerDialog(playerid, 2505, DIALOG_STYLE_LIST,"Drunks List","Sprunk \nCola \nBeer \nVoodka \nWhisky "R"(Danger!)","Give Up !","Exit");
- }
- else if(checkpointid == AHCP[3])
- {
- if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need at last 200 $ for buy a drunk !");
- ShowPlayerDialog(playerid, 2505, DIALOG_STYLE_LIST,"Drunks List","Sprunk \nCola \nBeer \nVoodka \nWhisky "R"(Danger!)","Give Up !","Exit");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 6475)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid) < 5000000) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 5 000 000 $ For buy this property !");
- GivePlayerMoney(playerid, -5000000);
- SendClientMessage(playerid, -1, ""R"[Admin House]: "GRI" Enjoy With You Property ! You are the Property Tycoon Now !");
- PropTycoon[playerid] = 1;
- }
- }
- if(dialogid == 2505)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
- SetPlayerDrunkLevel(playerid, 1000);
- GivePlayerMoney(playerid, -200);
- }
- if(listitem == 1)
- {
- if(GetPlayerMoney(playerid) < 600) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 300 $ For buy a Cola");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
- SetPlayerDrunkLevel(playerid, 2000);
- GivePlayerMoney(playerid, -300);
- }
- if(listitem == 2)
- {
- if(GetPlayerMoney(playerid) < 600) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 700 $ For buy a Beer");
- ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
- SetPlayerDrunkLevel(playerid, 3000);
- GivePlayerMoney(playerid, -700);
- }
- if(listitem == 3)
- {
- if(GetPlayerMoney(playerid) < 600) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 1200 $ For buy a Voodka");
- ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
- SetPlayerDrunkLevel(playerid, 4000);
- GivePlayerMoney(playerid, -1200);
- }
- if(listitem == 4)
- {
- if(GetPlayerMoney(playerid) < 600) return SendClientMessage(playerid, -1, ""R"Error: "GRI"You need 1700 $ For buy a Whisky");
- ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
- SetPlayerDrunkLevel(playerid, 5000);
- GivePlayerMoney(playerid, -1700);
- }
- }
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(Pick[0] == pickupid)
- {
- SetPlayerInterior(playerid, 3);
- SetPlayerPos(playerid, 961.4197, -53.0666, 1001.1172);
- }
- else if(Pick[1] == pickupid)
- {
- ShowPlayerDialog(playerid, 6475, DIALOG_STYLE_MSGBOX, "Admin House", "Do You want buy this property with 5 000 000 $ ? \n Earning : 500 000 $ Every 3 mins for this session !", "Select", "Cancel");
- }
- else if(Pick[2] == pickupid)
- {
- GivePlayerWeapon(playerid, 31, 9000);
- }
- else if(Pick[3] == pickupid)
- {
- GivePlayerWeapon(playerid, 38, 900000);
- }
- else if(Pick[4] == pickupid)
- {
- GivePlayerWeapon(playerid, 32, 9000);
- }
- else if(Pick[5] == pickupid)
- {
- SetPlayerHealth(playerid, 100);
- }
- else if(Pick[6] == pickupid)
- {
- GivePlayerWeapon(playerid, 27, 9000);
- }
- else if(Pick[7] == pickupid)
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, 2272.5313 + 1.0, 566.2311 + 1.0, 12.8723);
- }
- else if(Pick[8] == pickupid)
- {
- SetPlayerArmour(playerid, 100);
- }
- return 1;
- }
- public OnDJUpdate(playerid)
- {
- if (!IsPlayerInRangeOfPoint(playerid, 20.0, 2311.5251,567.3978,11.6178) && AudioDJ[playerid] == 0) return 1;
- if (IsPlayerInRangeOfPoint(playerid, 20.0, 2311.5251,567.3978,11.6178) && AudioDJ[playerid] == 1) return 1;
- if (IsPlayerInRangeOfPoint(playerid, 20.0, 2311.5251,567.3978,11.6178) && AudioDJ[playerid] == 0)
- {
- PlayAudioStreamForPlayer(playerid, "http://play.sa-mp.nl:8000/stream/1/");
- AudioDJ[playerid] = 1;
- }
- if (!IsPlayerInRangeOfPoint(playerid, 20.0, 2311.5251,567.3978,11.6178) && AudioDJ[playerid] == 1)
- {
- StopAudioStreamForPlayer(playerid);
- AudioDJ[playerid] = 0;
- }
- return 1;
- }
- public GateTimer()
- {
- MoveObject(Gate, 2286.55200, 603.00012, 12.55811, 2.00);
- return 1;
- }
- public PropTimer(playerid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PropTycoon[i] == 1)
- {
- new sZ[100];
- format(sZ, sizeof(sZ), "**%s is Now the Propertys Tycoon !, He Eearn 500 00 $ every 3 mins ! ", GetName(i));
- GivePlayerMoney(i, 500000);
- SendClientMessageToAll(COLOR_GREEN, sZ);
- }
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new szName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, szName, sizeof(szName));
- return szName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement