Advertisement
Guest User

LAPD Door V2

a guest
Dec 1st, 2012
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 19.66 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new gate, gate1, gate2, lockers1, lockers2, gates[10], lspddoor1, lspddoor2, IsCut[MAX_PLAYERS], Pickup2, BigEar[MAX_PLAYERS], PlayerName[MAX_PLAYER_NAME];
  4.  
  5. forward GateClose(playerid);
  6. forward GateClose1(playerid);
  7. forward GateClose2(playerid);
  8. forward Bars(playerid);
  9. forward DoorRespawn(playerid);
  10. forward cuttimer(playerid);
  11. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  12.  
  13. main()
  14.     {
  15.     print("\n--------------------------------------");
  16.     print(" Los Angeles Police Departement Door v2.0");
  17.     print("         by RapidEv");
  18.     print("--------------------------------------\n");
  19.  
  20. }
  21.  
  22. public OnGameModeInit()
  23. {
  24.     gate = CreateObject(968, 1544.745605, -1630.961792, 13.177118, 0.0000, 269.7592, 270.0000);
  25.     lspddoor1 = CreateObject(1500, 245.0578,72.4314,1002.5406,0, 0.0000, 0.0000);//DoorHall(Object 1)
  26.     lspddoor2 = CreateObject(1500, 245.9478,72.4314,1002.5406,0, 0.0000, 0.0000);//DoorHall(Object 2)
  27.     lockers1 = CreateObject(1500, 252.3615,74.788352,1002.600158,0, 0.000000 , 630.0000);//Casiers(Object 1)
  28.     lockers2 = CreateObject(1500, 252.3348,74.191299,1002.560119,0, 4320.000000 , -2968.0000);//Lockers(Object 2)
  29.     gates[7] = CreateObject(2930, 266.32861328125, 88.809791564941, 1002.6759033203, 0, 0, 0);//prison1
  30.     gates[8] = CreateObject(2930, 266.34274291992, 83.932769775391, 1002.6759033203, 0, 0, 0);//prison2
  31.     gate1 = CreateObject(16773, 1591.846802, -1638.013550, 13.491905, 0.0000, 0.0000, 0.0000);
  32.     gates[2] = CreateObject(1552,1583.4399,1637.8700,13.3871,173.3021,0,0,0);
  33.     gate2 = CreateObject(987, 1563.736816, -1617.390381, 12.382813, 0.0000, 0.0000, 90.0000);
  34.     Pickup2 = CreatePickup(1239, 2, 246.3294,87.9824,1003.6406, 0);
  35.     CreateObject(1616,1583.743530,-1637.326538,17.417528,0.000000,-14.000000,251.336318);//camera1
  36.     CreateObject(1616,1540.411865,-1641.461914,18.786596,0.000000,-10.000000,298.783935);//camera2
  37.     CreateObject(1616,251.099990,91.619064,1004.695495,6.000000,-6.000000,189.532470);//camera3
  38.     CreateObject(1616,242.434860,62.707202,1006.762084,0.000000,-1.000000,276.543151);//camera4
  39.     CreateObject(994, 1544.744751, -1617.584961, 12.394474, 0.0000, 0.0000, 270.0000);
  40.     CreateObject(994, 1543.487793, -1632.711548, 12.554396, 0.0000, 0.0000, 270.0000);
  41.     CreateObject(1566, 1582.545532, -1637.891357, 13.580875, 0.0000, 0.0000, 0.0000);
  42.     CreateObject(987, 1551.911865, -1617.354736, 12.371878, 0.0000, 0.0000, 0.0000);
  43.     CreateObject(987, 1539.952759, -1617.320435, 12.382813, 0.0000, 0.0000, 0.0000);
  44.     CreateObject(987, 1540.101807, -1605.454956, 12.382813, 0.0000, 0.0000, 270.0000);
  45.     CreateObject(987, 1551.969971, -1605.532593, 12.382813, 0.0000, 0.0000, 180.0000);
  46.     CreateObject(987, 1563.874146, -1605.544678, 12.382813, 0.0000, 0.0000, 180.0000);
  47.     CreateObject(2637, 218.17625427246, 77.599830627441, 1004.4437866211, 0, 0, 90);
  48.     CreateObject(2637, 218.17463684082, 78.905792236328, 1004.4437866211, 0, 0, 90);
  49.     CreateObject(2165, 218.8737487793, 67.476577758789, 1003.987121582, 0, 0, 0);
  50.     CreateObject(1714, 219.29069519043, 66.182334899902, 1004.0053710938, 0, 0, 188);
  51.     CreateObject(2606, 219.40234375, 72.701171875, 1006.0289916992, 0, 0, 0);
  52.     CreateObject(2606, 219.40234375, 72.701171875, 1006.5289916992, 0, 0, 0);
  53.     CreateObject(2616, 220.75427246094, 74.352043151855, 1005.4221191406, 0, 0, 224);
  54.     CreateObject(1323, 220.88993835449, 74.102752685547, 1004.4486083984, 0, 340, 204);
  55.     CreateObject(1323, 221.34825134277, 74.422210693359, 1004.4486083984, 0, 214, 213.99966430664);
  56.     CreateObject(2612, 214.1424407959, 78.451622009277, 1005.6192626953, 0, 0, 92);
  57.     CreateObject(2611, 217.14782714844, 69.814361572266, 1005.7386474609, 0, 0, 88);
  58.     CreateObject(1671, 217.42932128906, 76.527778625488, 1004.4758300781, 0, 0, 111.99951171875);
  59.     CreateObject(1671, 217.33636474609, 77.503631591797, 1004.4758300781, 0, 0, 89.99462890625);
  60.     CreateObject(1671, 217.39256286621, 78.590484619141, 1004.4758300781, 0, 0, 89.994506835938);
  61.     CreateObject(1671, 217.4132232666, 79.585304260254, 1004.4758300781, 0, 0, 69.994506835938);
  62.     CreateObject(1671, 218.84306335449, 79.764114379883, 1004.4758300781, 0, 0, 297.99389648438);
  63.     CreateObject(1671, 218.82710266113, 78.766372680664, 1004.4758300781, 0, 0, 269.9931640625);
  64.     CreateObject(1671, 218.86747741699, 77.853363037109, 1004.4758300781, 0, 0, 267.98950195313);
  65.     CreateObject(1671, 218.90785217285, 76.502799987793, 1004.4758300781, 0, 0, 243.98950195313);
  66.     CreateObject(1714, 218.15818786621, 76.174606323242, 1004.2235717773, 0, 0, 182);
  67.     CreateObject(2683, 215.26861572266, 74.460540771484, 1004.7291870117, 0, 0, 0);
  68.     CreateObject(2342, 218.21464538574, 78.907531738281, 1004.9619140625, 0, 0, 0);
  69.     CreateObject(2342, 218.12196350098, 77.292541503906, 1004.9619140625, 0, 0, 0);
  70.     CreateObject(1670, 214.39797973633, 82.418312072754, 1004.6030883789, 0, 0, 0);
  71.     CreateObject(1723, 214.47021484375, 79.396476745605, 1003.9361572266, 0, 0, 90);
  72.     CreateObject(1723, 215.32395935059, 82.372634887695, 1003.9361572266, 0, 0, 0);
  73.     CreateObject(2635, 214.4331817627, 82.437164306641, 1004.1189575195, 0, 0, 0);
  74.     CreateObject(2180, 215.44734191895, 74.183799743652, 1003.8602294922, 0, 0, 180);
  75.     CreateObject(2342, 215.73345947266, 74.262489318848, 1004.7119140625, 0, 0, 0);
  76.     CreateObject(2683, 214.53450012207, 74.254745483398, 1004.7291870117, 0, 0, 0);
  77.     CreateObject(1808, 221.38925170898, 82.63240814209, 1004.0390625, 0, 0, 0);
  78.     CreateObject(1963, 219.31726074219, 82.685821533203, 1004.4418945313, 0, 0, 0);
  79.     CreateObject(2683, 219.11032104492, 82.370910644531, 1004.9791870117, 0, 0, 0);
  80.     CreateObject(2683, 219.00144958496, 82.748802185059, 1004.9791870117, 0, 0, 0);
  81.     CreateObject(2190, 220.10772705078, 82.90625, 1004.8319702148, 0, 0, 0);
  82.     CreateObject(1491, 226.318359375, 74.533203125, 1004.0390625, 0, 0, 91.994018554688);
  83.     CreateObject(1491, 226.1875, 77.125, 1004.0390625, 0, 0, 269.99401855469);
  84.     CreateObject(1491, 222.02139282227, 81.296463012695, 1004.0390625, 0, 0, 269.98901367188);
  85.     CreateObject(1491, 222.06816101074, 78.451683044434, 1004.0390625, 0, 0, 91.994018554688);
  86.     CreateObject(1491, 226.30909729004, 73.287055969238, 1004.0390625, 0, 0, 269.98901367188);
  87.     CreateObject(1491, 226.34062194824, 70.797393798828, 1004.0390625, 0, 0, 89.994018554688);
  88.     CreateObject(1491, 222.05683898926, 68.19319152832, 1004.0390625, 0, 0, 89.989013671875);
  89.     CreateObject(1491, 222.02366638184, 70.81364440918, 1004.0390625, 0, 0, 269.98904418945);
  90.     CreateObject(2008, 224.66937255859, 69.826271057129, 1003.9579467773, 0, 0, 358);
  91.     return 1;
  92. }
  93. public OnPlayerConnect(playerid)
  94. {
  95.     SendClientMessage(playerid, 0xFFFFFAA, "Initialization of 'LAPD Door V2' by RapidEv (Evann_Jallet)");
  96.     SendClientMessage(playerid, 0xFFFFFAA, "Type /helplapd for view all commands of doors");
  97.     return 1;
  98. }
  99. public GateClose(playerid)
  100. {
  101.     DestroyObject(gate);
  102.     gate = CreateObject(968, 1544.745605, -1630.961792, 13.177118, 0.0000, 269.7592, 270.0000);
  103.     return 1;
  104. }
  105. public GateClose1(playerid)
  106. {
  107.     MoveObject(gate1, 1591.846802, -1638.013550, 13.491905, 0.8);
  108.     return 1;
  109. }
  110. public GateClose2(playerid)
  111. {
  112.     MoveObject(gate2, 1563.736816, -1617.390381, 12.382813, 0.8);
  113.     return 1;
  114. }
  115. public Bars(playerid)
  116. {
  117.     DestroyObject(gates[7]);
  118.     DestroyObject(gates[8]);
  119.     SendClientMessage(playerid, 0xFFFFFAA, "The bars are cuts !");
  120.     SetTimer("DoorRespawn", 60000, 0);
  121.     return 1;
  122. }
  123. public cuttimer(playerid)
  124. {
  125.     TogglePlayerControllable(playerid, 1);
  126.     IsCut[playerid] = 0;
  127.     return 1;
  128. }
  129. public DoorRespawn(playerid)
  130. {
  131.     gates[7] = CreateObject(2930, 266.32861328125, 88.809791564941, 1002.6759033203, 0, 0, 0);
  132.     gates[8] = CreateObject(2930, 266.34274291992, 83.932769775391, 1002.6759033203, 0, 0, 0);
  133.     return 1;
  134. }
  135. public OnPlayerCommandText(playerid, cmdtext[])
  136. {
  137.     if (strcmp(cmdtext, "/og", true)==0)
  138.     {
  139.         new string[128];
  140.         if(IsPlayerInRangeOfPoint(playerid, 10.0, 1544.3615,-1627.2473,13.3828))
  141.         {
  142.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  143.             DestroyObject(gate);
  144.             gate = CreateObject(968, 1544.746704, -1630.777222, 13.160947, 0.0000, 359.1406, 270.0000);
  145.             SendClientMessage(playerid, 0xFFFFFAA, "You open the gate for 6 seconds !");
  146.             format(string, sizeof(string), "%s takes its remote control and opens the gate",PlayerName);
  147.             ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  148.             SetTimer("GateClose", 6000, 0);
  149.         }
  150.         else if(IsPlayerInRangeOfPoint(playerid, 10.0, 1588.3359,-1637.5208,13.4215))
  151.         {
  152.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  153.             MoveObject(gate1, 1591.738037, -1638.271606, -2.911936, 0.8);
  154.             SendClientMessage(playerid, 0xFFFFFAA, "You open the gate for 7 seconds !");
  155.             format(string, sizeof(string), "%s takes its remote control and opens the gate",PlayerName);
  156.             ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  157.             SetTimer("GateClose1", 7000, 0);
  158.         }
  159.         else if(IsPlayerInRangeOfPoint(playerid, 10.0, 1563.9112, -1617.3806,13.4215))
  160.         {
  161.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  162.             MoveObject(gate2, 1563.911255, -1617.380615, 4.307865, 0.8);
  163.             SendClientMessage(playerid, 0xFFFFFAA, "You open the gate nΒ°2 for 20 Seconds !");
  164.             format(string, sizeof(string), "%s takes its remote control and opens the gate (NΒ°2)",PlayerName);
  165.             ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  166.             SetTimer("GateClose2", 20000, 0);
  167.         }
  168.         else
  169.         {
  170.             SendClientMessage(playerid, 0xFFFFFFFF, "You are too far from the gate !");
  171.         }
  172.         return 1;
  173.     }
  174.     if (strcmp(cmdtext, "/od", true) == 0)
  175.     {
  176.         new string[128];
  177.         if(!IsPlayerInRangeOfPoint(playerid, 2.0, 246.2302,72.9822,1003.6406)) return SendClientMessage(playerid, 0xFFFFFFAA, "You are too far from the door");
  178.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 246.2302,72.9822,1003.6406))
  179.         {
  180.             MoveObject(lspddoor1, 244.0578,72.4314,1002.5406, 3.5000);
  181.             MoveObject(lspddoor2, 247.1478,72.4314,1002.5406, 3.5000);
  182.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  183.             SendClientMessage(playerid, 0x0D7792AA, "The doors of LAPD are open [Please close them]");
  184.             format(string, sizeof(string), "%s spends his badge in the decoder and opens the door",PlayerName);
  185.             ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  186.         }
  187.         return 1;
  188.     }
  189.     if (strcmp(cmdtext, "/cd", true) == 0)
  190.     {
  191.         new string[128];
  192.         if(!IsPlayerInRangeOfPoint(playerid, 2.0, 246.2302,72.9822,1003.6406)) return SendClientMessage(playerid, 0xFFFFFFAA, "You are too far from the door");
  193.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 246.2302,72.9822,1003.6406))
  194.         {
  195.             MoveObject(lspddoor1, 245.0578,72.4314,1002.5406, 3.5000);
  196.             MoveObject(lspddoor2, 245.9478,72.4314,1002.5406, 3.5000);
  197.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  198.             SendClientMessage(playerid, 0x0D7792AA, "Thanks for close the LAPD Door.");
  199.             format(string, sizeof(string), "%s spends his badge in the decoder and closes the door",PlayerName);
  200.             ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  201.         }
  202.         return 1;
  203.     }
  204.     if (strcmp(cmdtext, "/clockers", true) == 0)
  205.     {
  206.         new string[128];
  207.         if(!IsPlayerInRangeOfPoint(playerid, 2.0, 251.3268,73.6743,1003.6406)) return SendClientMessage(playerid, 0xFFFFFFAA, "You are too far from the door");
  208.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 251.3268,73.6743,1003.6406))
  209.         {
  210.             MoveObject(lockers1, 252.3615,74.788352,1002.600158,1);
  211.             MoveObject(lockers2, 252.3348,74.191299,1002.560119,1);
  212.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  213.             format(string, sizeof(string), "%s take its remote control and close the lockers",PlayerName);
  214.             ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  215.         }
  216.         return 1;
  217.     }
  218.     if (strcmp(cmdtext, "/olockers", true) == 0)
  219.     {
  220.         new string[128];
  221.         if(!IsPlayerInRangeOfPoint(playerid, 2.0, 251.3268,73.6743,1003.6406)) return SendClientMessage(playerid, 0xFFFFFFAA, "You are too far from the door");
  222.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 251.3268,73.6743,1003.6406))
  223.         {
  224.         MoveObject(lockers1, 252.132568,77.126708,1002.600158,1);
  225.         MoveObject(lockers2, 252.132568,72.126708,1002.560119,1);
  226.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  227.         format(string, sizeof(string), "%s take its remote control and open the lockers",PlayerName);
  228.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  229.         }
  230.         return 1;
  231.     }
  232.     if (strcmp(cmdtext, "/ccell", true) == 0)
  233.     {
  234.         new string[128];
  235.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 266.7588,87.0378,1001.0391))
  236.         {
  237.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  238.         MoveObject(gates[7], 266.32861328125, 88.809791564941, 1002.6759033203,1);
  239.         format(string, sizeof(string), "%s close the cell of custody",PlayerName);
  240.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  241.         }
  242.         else if(IsPlayerInRangeOfPoint(playerid, 2.0, 266.7140,82.7564,1001.0391))
  243.         {
  244.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  245.         MoveObject(gates[8], 266.34274291992, 83.932769775391, 1002.6759033203,1);
  246.         format(string, sizeof(string), "%s close the cell of custody",PlayerName);
  247.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  248.         }
  249.         else
  250.         {
  251.         SendClientMessage(playerid, 0xFFFFFFFF, "You are too far from cell");
  252.         }
  253.         return 1;
  254.     }
  255.     if (strcmp(cmdtext, "/ocell", true) == 0)
  256.     {
  257.         new string[128];
  258.         if(IsPlayerInRangeOfPoint(playerid, 2.0, 266.7588,87.0378,1001.0391))
  259.         {
  260.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  261.         MoveObject(gates[7], 266.259887,85.617530,1002.6759033203,1);
  262.         format(string, sizeof(string), "%s open the cell of custody",PlayerName);
  263.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  264.         }
  265.         else if(IsPlayerInRangeOfPoint(playerid, 2.0, 266.7140,82.7564,1001.0391))
  266.         {
  267.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  268.         MoveObject(gates[8], 266.226318,81.172584,1002.6759033203,1);
  269.         format(string, sizeof(string), "%s open the cell of custody",PlayerName);
  270.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  271.         }
  272.         else
  273.         {
  274.         SendClientMessage(playerid, 0xFFFFFFFF, "You are too far from cell !");
  275.         }
  276.         return 1;
  277.     }
  278.     if (strcmp(cmdtext, "/cutbars", true) == 0)
  279.     {
  280.         new string[128];
  281.         if(!IsPlayerInRangeOfPoint(playerid, 20.0, 267.0270,87.1013,1001.0391)) return SendClientMessage(playerid, 0xAA3333AA, "You are not in the prison!");
  282.         if(IsPlayerInRangeOfPoint(playerid, 20.0, 267.0270,87.1013,1001.0391))
  283.         {
  284.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  285.         SendClientMessage(playerid, 0x0D7792AA, "You cut the bars...");
  286.         TogglePlayerControllable(playerid, 0);
  287.         IsCut[playerid] = 1;
  288.         GameTextForPlayer(playerid, "20 seconds", 4000, 4);
  289.         SetTimerEx("cuttimer", 20000, false, "u", playerid);
  290.         SetTimer("Bars", 20000, 0);
  291.         format(string, sizeof(string), "%s cut the bars of the prison",PlayerName);
  292.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  293.         }
  294.         return 1;
  295.     }
  296.     if (strcmp(cmdtext, "/-1", true) == 0)
  297.     {
  298.         new string[128];
  299.         if(IsPlayerInRangeOfPoint(playerid, 5.0, 246.3294,87.9824,1003.6406))
  300.         {
  301.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  302.         SetPlayerInterior(playerid, 0);
  303.         SetPlayerPos(playerid, 1524.9023,-1677.7162,5.8906);
  304.         format(string, sizeof(string), "%s take the elevator to go in the basement",PlayerName);
  305.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  306.         }
  307.         return 1;
  308.     }
  309.     if (strcmp(cmdtext, "/+1", true) == 0)
  310.     {
  311.         new string[128];
  312.         if(IsPlayerInRangeOfPoint(playerid, 5.0, 246.3294,87.9824,1003.6406))
  313.         {
  314.         GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  315.         SetPlayerInterior(playerid, 0);
  316.         SetPlayerPos(playerid, 1557.6095,-1675.3134,28.3955);
  317.         format(string, sizeof(string), "%s take the elevator to go in the roof",PlayerName);
  318.         ProxDetector(30.0, playerid, string, 0x800080FF,0x800080FF,0x800080FF,0x800080FF,0x800080FF);
  319.         }
  320.         return 1;
  321.     }
  322.     if (strcmp(cmdtext, "/camera1", true) == 0)
  323.     {
  324.         TogglePlayerControllable(playerid, 0);
  325.         SetPlayerCameraPos(playerid, 1539.7491,-1636.6981,13.9816);
  326.         SetPlayerCameraLookAt(playerid, 1543.4221,-1626.4825,13.3828);
  327.         return 1;
  328.     }
  329.     if (strcmp(cmdtext, "/camera2", true) == 0)
  330.     {
  331.         TogglePlayerControllable(playerid, 0);
  332.         SetPlayerCameraPos(playerid, 1582.6552,-1637.4558,13.3905);
  333.         SetPlayerCameraLookAt(playerid, 1588.0464,-1628.6290,13.3828);
  334.         return 1;
  335.     }
  336.     if (strcmp(cmdtext, "/camera3", true) == 0)
  337.     {
  338.         TogglePlayerControllable(playerid, 0);
  339.         SetPlayerCameraPos(playerid, 242.9750,62.7240,1003.6406);
  340.         SetPlayerCameraLookAt(playerid, 246.4861,69.7667,1003.6406);
  341.         return 1;
  342.     }
  343.     if (strcmp(cmdtext, "/camera4", true) == 0)
  344.     {
  345.         TogglePlayerControllable(playerid, 0);
  346.         SetPlayerCameraPos(playerid, 251.4041,91.4763,1002.4453);
  347.         SetPlayerCameraLookAt(playerid, 254.8335,89.5035,1002.4453);
  348.         return 1;
  349.     }
  350.     if (strcmp(cmdtext, "/cameraoff", true) == 0)
  351.     {
  352.         SetCameraBehindPlayer(playerid);
  353.         TogglePlayerControllable(playerid, 1);
  354.         return 1;
  355.     }
  356.     if (strcmp(cmdtext, "/helplapd", true) == 0)
  357.     {
  358.         SendClientMessage(playerid, 0xFFFFFFAA, "Commands :");
  359.         SendClientMessage(playerid, 0xFFFFFAA, "/og | /olockers | /flockers | /camera(1,2,3,4&off) | /ocell | /ccell | /od(/cd)");
  360.         SendClientMessage(playerid, 0xFFFFFAA, "/camera1 | /camera2 | /camera3 | /camera4 | /cameraoff");
  361.         SendClientMessage(playerid, 0xFFFFFFAA, "Command Gangsta :");
  362.         SendClientMessage(playerid, 0xFFFFFAA, "/cutbars");
  363.         return 1;
  364.     }
  365.     return 1;
  366. }
  367. public OnPlayerPickUpPickup(playerid, pickupid)
  368. {
  369.     if(pickupid == Pickup2)
  370.     {
  371.     GameTextForPlayer(playerid, "~g~~n~~n~Elevator of LAPD~n~~w~Type /-1 for go to in the basement~n~Type /+1 for go to in the roof", 4000, 3);
  372.     }
  373.     return 1;
  374. }
  375. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  376. {
  377.     if(IsPlayerConnected(playerid))
  378.     {
  379.         new Float:posx, Float:posy, Float:posz;
  380.         new Float:oldposx, Float:oldposy, Float:oldposz;
  381.         new Float:tempposx, Float:tempposy, Float:tempposz;
  382.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  383.         for(new i = 0; i < MAX_PLAYERS; i++)
  384.         {
  385.             if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  386.             {
  387.                 if(!BigEar[i])
  388.                 {
  389.                     GetPlayerPos(i, posx, posy, posz);
  390.                     tempposx = (oldposx -posx);
  391.                     tempposy = (oldposy -posy);
  392.                     tempposz = (oldposz -posz);
  393.                     if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  394.                     {
  395.                         SendClientMessage(i, col1, string);
  396.                     }
  397.                     else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  398.                     {
  399.                         SendClientMessage(i, col2, string);
  400.                     }
  401.                     else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  402.                     {
  403.                         SendClientMessage(i, col3, string);
  404.                     }
  405.                     else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  406.                     {
  407.                         SendClientMessage(i, col4, string);
  408.                     }
  409.                     else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  410.                     {
  411.                         SendClientMessage(i, col5, string);
  412.                     }
  413.                 }
  414.                 else
  415.                 {
  416.                     SendClientMessage(i, col1, string);
  417.                 }
  418.             }
  419.         }
  420.     }
  421.     return 1;
  422. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement