Guest User

Untitled

a guest
Mar 16th, 2008
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 14.03 KB | None | 0 0
  1. #include <a_samp>
  2. #define red 0xFF0000AA
  3. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  4.  
  5. new Door;
  6. new DoorTimer;
  7. forward PublicDoor(playerid);
  8.  
  9. main()
  10. {
  11.     print("---");
  12.     print("| MaZe Minigame v1 by Dragon loaded |");
  13.     print("                                 ---");
  14. }
  15.  
  16. public OnGameModeInit()
  17. {
  18.     SetGameModeText("MaZe v1");
  19.     AddPlayerClass(1, 1962.7941, -2462.0320, 13.5391, 91.2141, 9, 1, 0, 0, 0, 0);
  20.     AddPlayerClass(9, 1962.7941, -2462.0320, 13.5391, 91.2141, 9, 1, 0, 0, 0, 0);
  21.     SetWorldTime(0);
  22.     SetWeather(9);
  23. //Map, no gates or extra
  24.     CreateObject(974, 1963.282959, -2465.574951, 15.316857, 0.0000, 0.0000, 0.0000);
  25.     CreateObject(974, 1956.580566, -2465.585449, 15.316858, 0.0000, 0.0000, 0.0000);
  26.     CreateObject(974, 1959.590698, -2455.522949, 15.316857, 0.0000, 0.0000, 91.9597);
  27.     CreateObject(974, 1963.015259, -2458.855957, 15.316858, 0.0000, 0.0000, 0.0000);
  28.     CreateObject(974, 1952.883057, -2455.510498, 15.316858, 0.0000, 0.0000, 91.9597);
  29.     CreateObject(974, 1962.859375, -2452.197510, 15.316858, 0.0000, 0.0000, 0.0000);
  30.     CreateObject(974, 1949.427612, -2452.212891, 15.316858, 0.0000, 0.0000, 0.0000);
  31.     CreateObject(974, 1953.106934, -2462.209229, 15.316858, 0.0000, 0.0000, 91.9597);
  32.     CreateObject(974, 1966.433105, -2462.207031, 15.316858, 0.0000, 0.0000, 91.9597);
  33.     CreateObject(974, 1959.101440, -2442.170898, 15.324616, 0.0000, 0.0000, 91.9597);
  34.     CreateObject(974, 1949.179443, -2445.552734, 15.316858, 0.0000, 0.0000, 0.0000);
  35.     CreateObject(974, 1965.846313, -2442.150391, 15.324615, 0.0000, 0.0000, 91.9597);
  36.     CreateObject(974, 1969.310913, -2445.444092, 15.324615, 0.0000, 0.0000, 0.0000);
  37.     CreateObject(974, 1972.781372, -2448.818848, 15.324615, 0.0000, 0.0000, 91.9597);
  38.     CreateObject(974, 1973.011353, -2455.470947, 15.324615, 0.0000, 0.0000, 91.9597);
  39.     CreateObject(974, 1969.727295, -2458.875488, 15.324615, 0.0000, 0.0000, 0.0000);
  40.     CreateObject(974, 1965.614502, -2435.505127, 15.324615, 0.0000, 0.0000, 91.9597);
  41.     CreateObject(974, 1955.623047, -2438.863281, 15.324615, 0.0000, 0.0000, 0.0000);
  42.     CreateObject(974, 1948.939087, -2438.851563, 15.316857, 0.0000, 0.0000, 0.0000);
  43.     CreateObject(974, 1962.179321, -2432.174561, 15.324615, 0.0000, 0.0000, 0.0000);
  44.     CreateObject(974, 1942.511963, -2445.563721, 15.316856, 0.0000, 0.0000, 0.0000);
  45.     CreateObject(974, 1939.048706, -2442.228516, 15.316858, 0.0000, 0.0000, 91.9597);
  46.     CreateObject(974, 1946.202637, -2455.555664, 15.316859, 0.0000, 0.0000, 91.9597);
  47.     CreateObject(974, 1942.986328, -2458.858887, 15.316858, 0.0000, 0.0000, 0.0000);
  48.     CreateObject(974, 1949.861450, -2465.577881, 15.316858, 0.0000, 0.0000, 0.0000);
  49.     CreateObject(974, 1943.153564, -2465.581543, 15.316856, 0.0000, 0.0000, 0.0000);
  50.     CreateObject(974, 1936.475342, -2465.594727, 15.316856, 0.0000, 0.0000, 0.0000);
  51.     CreateObject(974, 1933.106079, -2462.261230, 15.316858, 0.0000, 0.0000, 91.9597);
  52.     CreateObject(974, 1932.865601, -2455.617920, 15.316858, 0.0000, 0.0000, 91.9597);
  53.     CreateObject(974, 1936.139893, -2452.281494, 15.316857, 0.0000, 0.0000, 0.0000);
  54.     CreateObject(974, 1929.838623, -2465.556641, 15.316858, 0.0000, 0.0000, 0.0000);
  55.     CreateObject(974, 1926.150024, -2455.650391, 15.316858, 0.0000, 0.0000, 91.9597);
  56.     CreateObject(974, 1922.669678, -2452.301025, 15.316858, 0.0000, 0.0000, 0.0000);
  57.     CreateObject(974, 1919.484131, -2455.640625, 15.316857, 0.0000, 0.0000, 91.9597);
  58.     CreateObject(974, 1919.707275, -2462.329346, 15.316858, 0.0000, 0.0000, 91.9597);
  59.     CreateObject(974, 1923.181274, -2465.560547, 15.316860, 0.0000, 0.0000, 0.0000);
  60.     CreateObject(974, 1919.255859, -2448.930664, 15.316856, 0.0000, 0.0000, 91.9597);
  61.     CreateObject(974, 1922.551392, -2445.603271, 15.316858, 0.0000, 0.0000, 0.0000);
  62.     CreateObject(974, 1932.445190, -2442.248047, 15.316858, 0.0000, 0.0000, 91.9597);
  63.     CreateObject(974, 1958.718140, -2428.866211, 15.324615, 0.0000, 0.0000, 91.9597);
  64.     CreateObject(974, 1952.027222, -2428.802734, 15.324615, 0.0000, 0.0000, 91.9597);
  65.     CreateObject(974, 1961.708374, -2418.883057, 15.324615, 0.0000, 0.0000, 0.0000);
  66.     CreateObject(974, 1972.528320, -2442.083984, 15.324615, 0.0000, 0.0000, 91.9597);
  67.     CreateObject(974, 1972.325806, -2435.394775, 15.324615, 0.0000, 0.0000, 91.9597);
  68.     CreateObject(974, 1972.104248, -2428.723877, 15.324615, 0.0000, 0.0000, 91.9597);
  69.     CreateObject(974, 1968.608398, -2425.393799, 15.324615, 0.0000, 0.0000, 0.0000);
  70.     CreateObject(974, 1965.179932, -2422.072266, 15.324615, 0.0000, 0.0000, 91.9597);
  71.     CreateObject(974, 1948.788818, -2432.093262, 15.324615, 0.0000, 0.0000, 0.0000);
  72.     CreateObject(974, 1942.118896, -2432.104004, 15.316858, 0.0000, 0.0000, 0.0000);
  73.     CreateObject(974, 1955.028198, -2418.866211, 15.324615, 0.0000, 0.0000, 0.0000);
  74.     CreateObject(974, 1948.392578, -2418.885742, 15.324615, 0.0000, 0.0000, 0.0000);
  75.     CreateObject(974, 1945.194824, -2422.244873, 15.324615, 0.0000, 0.0000, 91.9597);
  76.     CreateObject(974, 1938.688354, -2428.781494, 15.316858, 0.0000, 0.0000, 91.9597);
  77.     CreateObject(974, 1938.481201, -2422.158447, 15.324615, 0.0000, 0.0000, 91.9597);
  78.     CreateObject(974, 1941.667725, -2418.906006, 15.324615, 0.0000, 0.0000, 0.0000);
  79.     CreateObject(974, 1932.178833, -2435.588623, 15.316858, 0.0000, 0.0000, 91.9597);
  80.     CreateObject(974, 1925.773926, -2442.304199, 15.316858, 0.0000, 0.0000, 91.9597);
  81.     CreateObject(974, 1935.191162, -2425.479980, 15.316857, 0.0000, 0.0000, 0.0000);
  82.     CreateObject(974, 1935.128906, -2418.965820, 15.316860, 0.0000, 0.0000, 0.0000);
  83.     CreateObject(974, 1928.457397, -2418.980469, 15.316859, 0.0000, 0.0000, 0.0000);
  84.     CreateObject(974, 1925.259521, -2422.320557, 15.316858, 0.0000, 0.0000, 91.9597);
  85.     CreateObject(974, 1919.054565, -2442.224121, 15.316858, 0.0000, 0.0000, 91.9597);
  86.     CreateObject(974, 1921.910278, -2418.977051, 15.316858, 0.0000, 0.0000, 0.0000);
  87.     CreateObject(974, 1925.512573, -2428.974609, 15.316858, 0.0000, 0.0000, 91.9597);
  88.     CreateObject(974, 1918.834473, -2435.525879, 15.316858, 0.0000, 0.0000, 91.9597);
  89.     CreateObject(974, 1918.732056, -2422.356689, 15.316859, 0.0000, 0.0000, 91.9597);
  90.     CreateObject(974, 1915.624634, -2438.945313, 15.316859, 0.0000, 0.0000, 0.0000);
  91.     CreateObject(974, 1915.501953, -2425.633545, 15.316858, 0.0000, 0.0000, 0.0000);
  92.     CreateObject(974, 1912.289917, -2428.982666, 15.316858, 0.0000, 0.0000, 91.9597);
  93.     CreateObject(974, 1912.533081, -2435.651611, 15.316858, 0.0000, 0.0000, 91.9597);
  94. //Gore
  95.     CreateObject(2905, 1955.893066, -2462.772217, 12.630567, 0.0000, 0.0000, 338.5141);
  96.     CreateObject(2907, 1955.632080, -2463.510010, 12.699154, 0.0000, 0.0000, 0.0000);
  97.     CreateObject(2905, 1955.465820, -2462.668457, 12.657257, 0.0000, 0.0000, 13.7510);
  98.     CreateObject(2908, 1955.669067, -2464.360352, 12.616538, 0.0000, 0.0000, 0.0000);
  99.     CreateObject(2907, 1960.280640, -2458.100098, 12.699154, 0.0000, 0.0000, 335.0763);
  100.     CreateObject(2905, 1960.232056, -2457.092529, 12.630567, 0.0000, 0.0000, 338.5141);
  101.     CreateObject(2905, 1965.323120, -2459.539307, 12.630567, 0.0000, 0.0000, 338.5141);
  102.     CreateObject(2908, 1965.346069, -2461.955811, 12.616538, 0.0000, 0.0000, 0.0000);
  103.     CreateObject(2907, 1952.840332, -2451.606201, 12.699154, 0.0000, 0.0000, 335.0763);
  104.     CreateObject(2906, 1952.512207, -2451.597168, 12.613131, 0.8594, 103.1323, 348.9311);
  105.     CreateObject(2905, 1953.206421, -2450.958496, 12.630567, 0.0000, 0.0000, 338.5141);
  106.     CreateObject(2907, 1948.915771, -2464.891113, 12.699154, 0.0000, 0.0000, 335.0763);
  107.     CreateObject(2907, 1933.644043, -2452.971436, 12.699154, 0.0000, 0.0000, 335.0763);
  108.     CreateObject(2907, 1938.023193, -2444.445313, 12.699154, 0.0000, 0.0000, 335.0763);
  109.     CreateObject(2907, 1920.671753, -2464.500000, 12.699154, 0.0000, 0.0000, 335.0763);
  110.     CreateObject(2907, 1919.850830, -2446.227051, 12.699154, 0.0000, 0.0000, 335.0763);
  111.     CreateObject(2907, 1924.635376, -2442.226318, 12.699154, 0.0000, 0.0000, 335.0763);
  112.     CreateObject(2907, 1924.418213, -2421.301514, 12.699154, 0.0000, 0.0000, 335.0763);
  113.     CreateObject(2907, 1913.302979, -2428.626221, 12.699154, 0.0000, 0.0000, 335.0763);
  114.     CreateObject(2907, 1955.818848, -2438.979980, 13.741734, 265.4620, 0.0000, 177.9037);
  115.     CreateObject(2905, 1955.848389, -2439.010498, 12.938319, 275.8792, 6.8755, 94.5380);
  116.     CreateObject(2908, 1955.785400, -2439.054688, 14.292436, 269.7591, 0.0000, 81.6465);
  117.     CreateObject(2906, 1955.443237, -2438.955078, 14.039637, 0.0000, 0.0000, 110.8673);
  118.     CreateObject(2907, 1943.390625, -2432.817871, 12.699152, 0.0000, 0.0000, 335.0763);
  119.     CreateObject(2907, 1939.335938, -2420.163818, 12.706909, 0.0000, 0.0000, 335.0763);
  120.     CreateObject(2907, 1931.016235, -2420.261475, 12.699154, 0.0000, 0.0000, 335.0763);
  121.     CreateObject(2907, 1957.992554, -2424.785645, 12.706911, 0.0000, 0.0000, 335.0763);
  122.     CreateObject(2907, 1969.622314, -2443.843262, 12.706911, 0.0000, 0.0000, 335.0763);
  123.     CreateObject(2907, 1964.770142, -2434.804443, 12.706911, 0.0000, 0.0000, 335.0763);
  124.     CreateObject(2908, 1913.097412, -2429.138428, 12.691537, 0.0000, 0.0000, 0.0000);
  125.     CreateObject(2908, 1937.462891, -2444.889404, 12.616538, 0.0000, 0.0000, 0.0000);
  126.     CreateObject(2908, 1948.238892, -2465.346191, 12.616538, 0.0000, 0.0000, 0.0000);
  127.     CreateObject(2908, 1943.193726, -2433.380615, 12.616538, 0.0000, 0.0000, 0.0000);
  128.     CreateObject(2908, 1964.487549, -2435.331299, 12.699294, 0.0000, 0.0000, 0.0000);
  129.     CreateObject(2905, 1921.013794, -2463.848633, 12.680566, 0.0000, 0.0000, 338.5141);
  130.     CreateObject(2905, 1914.062744, -2428.216309, 12.630567, 0.0000, 0.0000, 338.5141);
  131.     CreateObject(2905, 1913.606201, -2427.577881, 12.630567, 0.0000, 0.0000, 248.2732);
  132.     CreateObject(2905, 1958.282837, -2423.968262, 12.663323, 0.0000, 0.0000, 338.5141);
  133.     CreateObject(2906, 1955.367310, -2463.572754, 12.699825, 0.8594, 169.3093, 24.1680);
  134.     CreateObject(2906, 1933.975708, -2453.260986, 12.677065, 0.8594, 346.2490, 269.0037);
  135.     CreateObject(2906, 1920.152344, -2446.531738, 12.613131, 0.8594, 346.2490, 269.0037);
  136.     CreateObject(2906, 1923.980347, -2421.420898, 12.663130, 0.8594, 221.6306, 88.5220);
  137.     CreateObject(2906, 1930.491333, -2420.375488, 12.688129, 0.8594, 221.6306, 88.5220);
  138.     CreateObject(2906, 1924.254761, -2442.113525, 12.663130, 0.8594, 221.6306, 32.6587);
  139.     CreateObject(2906, 1943.014038, -2432.712891, 12.663130, 0.8594, 221.6306, 32.6587);
  140.     CreateObject(2906, 1939.605225, -2420.558594, 12.668984, 0.8594, 221.6306, 230.3291);
  141.     CreateObject(2906, 1958.150513, -2425.249756, 12.670887, 0.8594, 221.6306, 230.3291);
  142.     CreateObject(2906, 1969.308594, -2443.339600, 12.694390, 0.8594, 221.6306, 12.1359);
  143. //Other
  144.     Door = CreateObject(974, 1959.821655, -2462.202148, 15.316858, 0.0000, 0.0000, 91.9597);
  145.     return 1;
  146. }
  147.  
  148. public OnPlayerRequestClass(playerid, classid)
  149. {
  150.     SetPlayerColor(playerid, red);
  151.     SetPlayerFacingAngle(playerid, 240.0);
  152.     SetPlayerPos(playerid, 1969.4119, -2461.3860, 13.5391);
  153.     SetPlayerCameraPos(playerid, 1971.4806, -2462.6731, 13.5391);
  154.     SetPlayerCameraLookAt(playerid, 1969.4119, -2461.3860, 13.5391);
  155.     return 1;
  156. }
  157.  
  158. public OnPlayerRequestSpawn(playerid)
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerConnect(playerid)
  164. {
  165.     SetPlayerColor(playerid, red);
  166.     SendClientMessage(playerid, red, "Welcome, type /help for help");
  167.     SetPlayerColor(playerid, red);
  168.     return 1;
  169. }
  170.  
  171. public OnPlayerDisconnect(playerid, reason)
  172. {
  173.     SetPlayerColor(playerid, red);
  174.     KillTimer(DoorTimer);
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerSpawn(playerid)
  179. {
  180.     MoveObject(Door, 1959.813965, -2462.229736, 20.846914, 1.0);
  181.     SendClientMessage(playerid, red, "The door will close in ten seconds");
  182.     DoorTimer = SetTimerEx("PublicDoor", 10000, 0, "i", playerid);
  183.     return 1;
  184. }
  185.  
  186. public OnPlayerCommandText(playerid, cmdtext[])
  187. {
  188.     dcmd(afreeze, 7, cmdtext);
  189.     dcmd(aunfreeze, 9, cmdtext);
  190.     dcmd(akick, 5, cmdtext);
  191.     dcmd(aban, 4, cmdtext);
  192.    
  193.     if (strcmp("/help", cmdtext, true) == 0)
  194.     {
  195.         SendClientMessage(playerid, red, "Your job is to simply kill everyone you can find.");
  196.         SendClientMessage(playerid, red, "Update comeing soon!");
  197.         return 1;
  198.     }
  199.     if (strcmp("/kill", cmdtext, true) == 0)
  200.     {
  201.         SetPlayerHealth(playerid, 0);
  202.         return 1;
  203.     }
  204.     if (strcmp("/alogin expire", cmdtext, true) == 0)
  205.     {
  206.         SetPlayerSkin(playerid, 0);
  207.         return 1;
  208.     }
  209.     return SendClientMessage(playerid, red, "Sorry, only commands are /kill and /help");
  210. }
  211.  
  212. public OnPlayerDeath(playerid, killerid, reason)
  213. {
  214.     SendDeathMessage(killerid, playerid, reason);
  215.     SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
  216.     {
  217.         new cheat[256];
  218.         new killer[MAX_PLAYER_NAME];
  219.         GetPlayerName(killerid, killer, sizeof(killer));
  220.         if(reason == 9)
  221.         {
  222.         }
  223.         else if(reason == 1-8||reason == 10-54)
  224.         {
  225.             format(cheat, sizeof(cheat), "%s is suspected for cheating (weapon)", killer);
  226.             SendClientMessageToAll(red, cheat);
  227.         }
  228.     }
  229.     return 1;
  230. }
  231.  
  232. public PublicDoor(playerid)
  233. {
  234.     MoveObject(Door, 1959.821655, -2462.202148, 15.316858, 1.0);
  235.     return 1;
  236. }
  237.  
  238. dcmd_afreeze(playerid, params[])
  239. {
  240.     if(GetPlayerSkin(playerid) == 0)
  241.     {
  242.         if (strlen(params))
  243.         {
  244.             new id;
  245.             id = strval(params);
  246.             SendClientMessage(id, red, "frozen");
  247.             TogglePlayerControllable(id, 0);
  248.             SendClientMessage(playerid, red, "frozen");
  249.             return 1;
  250.         }
  251.     }
  252.     return 1;
  253. }
  254.  
  255. dcmd_aunfreeze(playerid, params[])
  256. {
  257.     if(GetPlayerSkin(playerid) == 0)
  258.     {
  259.         if (strlen(params))
  260.         {
  261.             new id;
  262.             id = strval(params);
  263.             SendClientMessage(id, red, "unfrozen");
  264.             TogglePlayerControllable(id, 1);
  265.             SendClientMessage(playerid, red, "unfrozen");
  266.             return 1;
  267.         }
  268.     }
  269.     return 1;
  270. }
  271.  
  272. dcmd_akick(playerid, params[])
  273. {
  274.     if(GetPlayerSkin(playerid) == 0)
  275.     {
  276.         if (strlen(params))
  277.         {
  278.             new id;
  279.             id = strval(params);
  280.             SendClientMessage(id, red, "kicked");
  281.             Kick(id);
  282.             SendClientMessage(playerid, red, "kicked");
  283.             return 1;
  284.         }
  285.     }
  286.     return 1;
  287. }
  288.  
  289. dcmd_aban(playerid, params[])
  290. {
  291.     if(GetPlayerSkin(playerid) == 0)
  292.     {
  293.         if (strlen(params))
  294.         {
  295.             new id;
  296.             id = strval(params);
  297.             SendClientMessage(id, red, "banned");
  298.             Ban(id);
  299.             SendClientMessage(playerid, red, "banned");
  300.             return 1;
  301.         }
  302.     }
  303.     return 1;
  304. }
  305.  
  306. /*---
  307. |   MaZe Miniage v1 by Dragon
  308.     New version comeing soon    |
  309.     ORIGINAL IDEA BY PAOLOP     |
  310.                             ---*/
Advertisement
Add Comment
Please, Sign In to add comment