Guest User

darren reeder

a guest
Apr 6th, 2010
1,524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 25.96 KB | None | 0 0
  1. // This script was created by DArren Reeder(mowgli) which is me. I have decided to release it so everyone can enjoy
  2. //it so please dont remove these commented lines just so everyone who edits my script knows i made it...thanks alot..
  3. //add [email protected] if you need any help or anything at all from me..
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined FILTERSCRIPT
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     print("\n--------------------------------------");
  12.     print(" Blank Filterscript by your name here");
  13.     print("--------------------------------------\n");
  14.     return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19.     return 1;
  20. }
  21.  
  22. #else
  23.  
  24. main()
  25. {
  26.     print("\n----------------------------------");
  27.     print(" CTF By Darren Reeder (Mowgli)");
  28.     print("----------------------------------\n");
  29. }
  30.  
  31. #endif
  32.  
  33. #define COLOR_GRAD1 0xB4B5B7FF
  34. #define COLOR_GRAD2 0xBFC0C2FF
  35. #define COLOR_GRAD3 0xCBCCCEFF
  36. #define COLOR_GRAD4 0xD8D8D8FF
  37. #define COLOR_GRAD5 0xE3E3E3FF
  38. #define COLOR_GRAD6 0xF0F0F0FF
  39. #define COLOR_GREY 0xAFAFAFAA
  40. #define COLOR_GREEN 0x33AA33AA
  41. #define COLOR_RED 0xAA3333AA
  42. #define COLOR_LIGHTRED 0xFF6347AA
  43. #define COLOR_LIGHTBLUE 0x33CCFFAA
  44. #define COLOR_LIGHTGREEN 0x9ACD32AA
  45. #define COLOR_YELLOW 0xFFFF00AA
  46. #define COLOR_YELLOW2 0xF5DEB3AA
  47. #define COLOR_WHITE 0xFFFFFFAA
  48. #define COLOR_MAGENTA 0xFF00FFFF
  49. #define COLOR_FADE1 0xE6E6E6E6
  50. #define COLOR_FADE2 0xC8C8C8C8
  51. #define COLOR_FADE3 0xAAAAAAAA
  52. #define COLOR_FADE4 0x8C8C8C8C
  53. #define COLOR_FADE5 0x6E6E6E6E
  54. #define COLOR_PURPLE 0xC2A2DAAA
  55. #define COLOR_DBLUE 0x2641FEAA
  56. #define COLOR_ALLDEPT 0xFF8282AA
  57. #define COLOR_NEWS 0xFFA500AA
  58. #define COLOR_OOC 0xE0FFFFAA
  59. #define OBJECTIVE_COLOR 0x64000064
  60. #define TEAM_GREEN_COLOR 0xFFFFFFAA
  61. #define TEAM_JOB_COLOR 0xFFB6C1AA
  62. #define TEAM_HIT_COLOR 0xFFFFFF00
  63. #define TEAM_BLUE_COLOR 0x8D8DFF00
  64. #define COLOR_ADD 0x63FF60AA
  65. #define TEAM_GROVE_COLOR 0x00D900C8
  66. #define TEAM_VAGOS_COLOR 0xFFC801C8
  67. #define TEAM_BALLAS_COLOR 0xD900D3C8
  68. #define TEAM_AZTECAS_COLOR 0x01FCFFC8
  69. #define TEAM_CYAN_COLOR 0xFF8282AA
  70. #define TEAM_ORANGE_COLOR 0xFF830000
  71. #define TEAM_COR_COLOR 0x39393900
  72. #define TEAM_BAR_COLOR 0x00D90000
  73. #define TEAM_TAT_COLOR 0xBDCB9200
  74. #define TEAM_CUN_COLOR 0xD900D300
  75. #define TEAM_STR_COLOR 0x01FCFF00
  76. #define TEAM_ADMIN_COLOR 0x00808000
  77. #define COLOR_INVIS 0xAFAFAF00
  78. #define COLOR_SPEC 0xBFC0C200
  79.  
  80. new Text:Textdraw0;
  81. new Text:Textdraw2;
  82.  
  83. new attachedFlagGang,attachedFlagMafia;
  84. new scoreLimit = 3; // Change to max score
  85.  
  86. new gangscore;
  87. new mafiascore;
  88.  
  89. new gangflag;
  90. new mafiaflag;
  91.  
  92. new gangflagFloor;
  93. new mafiaflagFloor;
  94.  
  95. new GangTeam;
  96. new MafiaTeam;
  97.  
  98. new GangTeamPlayer[MAX_PLAYERS];
  99. new MafiaTeamPlayer[MAX_PLAYERS];
  100.  
  101. new GangFlagHeld[MAX_PLAYERS];
  102. new MafiaFlagHeld[MAX_PLAYERS];
  103.  
  104. new Float:gRandomLsGangSniper[2][3] = {
  105. {1467.8101,-1773.6311,33.4297},
  106. {1494.6393,-1773.9219,33.4243}
  107. };
  108.  
  109. new Float:gRandomLsGang[4][3] = {
  110. {1505.2998,-1754.5624,13.5469},
  111. {1493.9961,-1771.7921,18.7958},
  112. {1468.0769,-1771.7216,18.7958},
  113. {1457.6835,-1754.7289,13.5469}
  114. };
  115.  
  116. new Float:gRandomLsMafiaSniper[2][3] = {
  117. {1467.8981,-1554.0146,23.5481},
  118. {1486.8073,-1553.9187,23.5469}
  119. };
  120.  
  121. new Float:gRandomLsMafia[2][3] = {
  122. {1454.6406,-1626.1051,14.7891},
  123. {1504.0363,-1626.4407,14.7891}
  124. };
  125.  
  126. public OnGameModeInit()
  127. {
  128.     // Don't use these lines if it's a filterscript
  129.     SetGameModeText("CTF By Darren");
  130.    
  131.     Textdraw0 = TextDrawCreate(361.000000,433.000000,"Mowgli's CTF");
  132.     Textdraw2 = TextDrawCreate(394.000000,1.000000,"Gang Team: [%s] Mafia Team: [%s]");
  133.     new string[128];
  134.     format(string, sizeof(string), "Mafia Score: %d | Gang Score: %d", mafiascore, gangscore);
  135.     TextDrawSetString(Textdraw2, string);
  136.     TextDrawAlignment(Textdraw0,0);
  137.     TextDrawAlignment(Textdraw2,0);
  138.     TextDrawBackgroundColor(Textdraw0,0xff0000cc);
  139.     TextDrawBackgroundColor(Textdraw2,0x0000ffcc);
  140.     TextDrawFont(Textdraw0,3);
  141.     TextDrawLetterSize(Textdraw0,1.000000,1.700000);
  142.     TextDrawFont(Textdraw2,3);
  143.     TextDrawLetterSize(Textdraw2,0.399999,1.100000);
  144.     TextDrawColor(Textdraw0,0xffffffff);
  145.     TextDrawColor(Textdraw2,0xffffffff);
  146.     TextDrawSetOutline(Textdraw0,1);
  147.     TextDrawSetOutline(Textdraw2,1);
  148.     TextDrawSetProportional(Textdraw2,1);
  149.     TextDrawSetShadow(Textdraw0,5);
  150.     TextDrawSetShadow(Textdraw2,1);
  151.    
  152.     gangflag = CreatePickup(2914, 23, 1481.7789,-1766.5944,18.7958,0); // LS gang flag
  153.     mafiaflag = CreatePickup(2993, 23, 1475.5999,-1586.0874,13.5469,0); // LS Mafia flag
  154.  
  155.     AddPlayerClass(108,1958.3783,1343.1572,15.3746,270.1425,34,200,29,100,0,0); // LS Gang Sniper 1
  156.     AddPlayerClass(173,1958.3783,1343.1572,15.3746,270.1425,34,200,24,300,0,0); // LS Gang Sniper 2
  157.     AddPlayerClass(115,1958.3783,1343.1572,15.3746,270.1425,31,300,24,300,0,0); // LS Gang Assult Member 1
  158.     AddPlayerClass(271,1958.3783,1343.1572,15.3746,270.1425,30,600,24,300,0,0); // LS Gang Assult Member 2
  159.     AddPlayerClass(116,1958.3783,1343.1572,15.3746,270.1425,39,20,24,300,-1,-1); // LS Gang Bomber Member 1
  160.     AddPlayerClass(102,1958.3783,1343.1572,15.3746,270.1425,39,5,29,300,-1,-1); // LS Gang Bomber Member 2
  161.  
  162.     AddPlayerClass(122,1958.3783,1343.1572,15.3746,270.1425,34,200,29,100,0,0); // LS Mafia Sniper 1
  163.     AddPlayerClass(121,1958.3783,1343.1572,15.3746,270.1425,34,200,24,100,0,0); // LS Mafia Sniper 2
  164.     AddPlayerClass(124,1958.3783,1343.1572,15.3746,270.1425,31,300,24,300,0,0); // LS Mafia Assult Member 1
  165.     AddPlayerClass(113,1958.3783,1343.1572,15.3746,270.1425,30,600,24,300,0,0); // LS Mafia Assult Member 2
  166.     AddPlayerClass(123,1958.3783,1343.1572,15.3746,270.1425,39,20,24,300,-1,-1); // LS Mafia Bomber Member 1
  167.     AddPlayerClass(127,1958.3783,1343.1572,15.3746,270.1425,39,5,29,300,-1,-1); // LS Mafia Bomber Member 2
  168.    
  169.     AddPlayerClass(167,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,0,0); // Admin
  170.    
  171.     CreateObject(5135, 1551.325317, -1703.996094, 12.635761, 0.0000, 90.2409, 179.5182);
  172.     CreateObject(5135, 1550.752808, -1683.747192, 27.756157, 0.0000, 91.1003, 180.4820);
  173.     CreateObject(5135, 1553.227539, -1653.312256, 27.737404, 0.0000, 90.9963, 176.1846);
  174.     CreateObject(5135, 1552.883545, -1629.994263, 27.652809, 0.0000, 91.1003, 179.6224);
  175.     CreateObject(5135, 1548.241943, -1599.958618, 12.860754, 0.0000, 91.1002, 187.3577);
  176.     CreateObject(5135, 1516.822876, -1583.266479, 12.746714, 0.0000, 89.3814, 232.8035);
  177.     CreateObject(5135, 1500.002075, -1571.076660, 12.471687, 0.0000, 91.1003, 233.7671);
  178.     CreateObject(5135, 1412.027344, -1596.188599, 12.568409, 0.0000, 90.2408, 299.8394);
  179.     CreateObject(5135, 1407.435303, -1613.240479, 12.121666, 0.0000, 89.3814, 318.7470);
  180.     CreateObject(5135, 1409.815308, -1669.653198, 12.646694, 0.0000, 89.3814, 0.0000);
  181.     CreateObject(5135, 1422.269043, -1737.748657, 12.046705, 0.0000, 90.2409, 17.1887);
  182.     CreateObject(5135, 1438.378052, -1766.123047, 11.196684, 0.0000, 90.2409, 27.5020);
  183.     CreateObject(5135, 1450.801025, -1788.885132, 29.168556, 0.0000, 90.2409, 27.5020);
  184.     CreateObject(5135, 1547.023315, -1749.440918, 31.743561, 0.0000, 88.5220, 141.8071);
  185.     CreateObject(5135, 1554.418213, -1733.402100, 12.178864, 0.0000, 90.2409, 149.5420);
  186.     CreateObject(5309, 1542.277588, -1760.184448, 63.306152, 0.0000, 90.2408, 148.6827);
  187.     CreateObject(5309, 1549.944702, -1742.922485, 63.046066, 0.0000, 269.7592, 336.7952);
  188.     CreateObject(5309, 1553.745972, -1725.637329, 63.070992, 0.0000, 268.8997, 0.9367);
  189.     CreateObject(5309, 1553.341553, -1695.743408, 64.939850, 0.0000, 268.8997, 0.0000);
  190.     CreateObject(5309, 1553.279785, -1712.114868, 64.432816, 0.0000, 268.8998, 0.0000);
  191.     CreateObject(5309, 1553.219604, -1668.642944, 65.558380, 0.0000, 268.8998, 355.7028);
  192.     CreateObject(5309, 1555.268188, -1639.542114, 59.830978, 0.0000, 267.1808, 4.2972);
  193.     CreateObject(5309, 1551.448120, -1613.808594, 45.114235, 0.0000, 268.8997, 6.8755);
  194.     CreateObject(5309, 1516.771973, -1582.076904, 43.940201, 0.0000, 269.7592, 54.1445);
  195.     CreateObject(5309, 1413.444092, -1601.690796, 44.519379, 0.0000, 268.8997, 141.8071);
  196.     CreateObject(5309, 1405.972412, -1620.733154, 44.193115, 0.0000, 92.8192, 0.0000);
  197.     CreateObject(5309, 1406.848633, -1654.576782, 44.547211, 0.0000, 266.3214, 183.0601);
  198.     CreateObject(5309, 1416.355469, -1725.644287, 43.971825, 0.0000, 91.1003, 19.7670);
  199.     CreateObject(5309, 1427.649536, -1750.623291, 43.280502, 0.8594, 91.1003, 25.7831);
  200.     CreateObject(5309, 1442.182983, -1774.919800, 60.964905, 359.1406, 90.2409, 23.2048);
  201.     CreateObject(944, 1465.135254, -1752.940186, 33.314476, 0.0000, 0.0000, 0.0000);
  202.     CreateObject(944, 1465.136963, -1752.934814, 34.760361, 0.0000, 0.0000, 0.0000);
  203.     CreateObject(944, 1468.076416, -1752.933350, 33.314476, 0.0000, 0.0000, 0.0000);
  204.     CreateObject(3630, 1482.040161, -1753.515869, 33.922310, 0.0000, 0.0000, 181.3411);
  205.     CreateObject(18257, 1495.142700, -1751.859863, 32.429688, 0.0000, 0.8594, 162.4335);
  206.     CreateObject(3798, 1452.956787, -1759.030640, 32.426231, 0.0000, 0.0000, 348.8273);
  207.     CreateObject(3799, 1450.340576, -1758.895752, 32.311493, 0.0000, 0.0000, 347.1084);
  208.     CreateObject(3798, 1455.140381, -1759.311523, 32.426231, 0.0000, 0.0000, 0.0000);
  209.     CreateObject(3798, 1509.802612, -1760.974365, 32.426231, 0.0000, 0.0000, 2.5783);
  210.     CreateObject(3798, 1511.922241, -1760.696777, 32.426231, 0.0000, 0.0000, 8.5944);
  211.     CreateObject(3799, 1514.664673, -1760.352539, 32.311493, 0.0000, 0.0000, 18.0482);
  212.     CreateObject(3865, 1529.599121, -1710.002686, 14.316734, 0.0000, 0.0000, 54.1445);
  213.     CreateObject(12930, 1528.353027, -1728.652222, 13.195859, 0.0000, 0.0000, 106.5702);
  214.     CreateObject(7040, 1527.257446, -1674.677124, 15.810593, 0.0000, 358.2811, 65.3172);
  215.     CreateObject(5269, 1535.031860, -1695.766357, 14.855923, 0.0000, 0.0000, 125.4778);
  216.     CreateObject(3577, 1473.054443, -1580.545410, 23.329382, 0.0000, 0.0000, 0.0000);
  217.     CreateObject(3576, 1483.840088, -1580.999268, 24.039547, 0.0000, 0.0000, 0.0000);
  218.     CreateObject(2567, 1463.168945, -1581.561279, 24.474476, 0.0000, 0.0000, 353.9839);
  219.     CreateObject(1685, 1492.581787, -1581.387085, 23.296875, 0.0000, 0.0000, 15.4699);
  220.     CreateObject(1685, 1494.691772, -1581.200073, 23.296875, 0.0000, 0.0000, 0.0000);
  221.     CreateObject(1685, 1496.784790, -1581.286011, 23.296875, 0.0000, 0.0000, 18.0482);
  222.     CreateObject(1685, 1496.722290, -1581.343384, 24.796875, 0.0000, 0.0000, 21.4859);
  223.     CreateObject(1362, 1526.097168, -1606.902222, 12.981296, 0.0000, 0.0000, 0.0000);
  224.     CreateObject(1362, 1525.026855, -1607.226440, 12.981296, 0.0000, 0.0000, 0.0000);
  225.     CreateObject(1362, 1526.438477, -1606.320679, 12.981296, 0.0000, 0.0000, 0.0000);
  226.     CreateObject(1348, 1528.537476, -1609.736816, 13.085339, 0.0000, 0.0000, 21.4859);
  227.     CreateObject(16337, 1519.823730, -1608.229126, 13.431591, 0.0000, 0.0000, 0.0000);
  228.     CreateObject(3256, 1481.738892, -1638.533936, 13.411148, 0.0000, 0.0000, 0.0000);
  229.     CreateObject(925, 1467.452759, -1600.809082, 13.608780, 0.0000, 0.0000, 336.7952);
  230.     CreateObject(925, 1483.353516, -1600.919922, 13.608780, 0.0000, 0.0000, 0.0000);
  231.     CreateObject(925, 1500.641846, -1601.117676, 13.608780, 0.0000, 0.0000, 30.0803);
  232.     CreateObject(18257, 1490.310303, -1613.954224, 13.039299, 0.0000, 0.0000, 0.0000);
  233.     CreateObject(18257, 1450.653687, -1613.140137, 13.046875, 0.0000, 0.0000, 335.0763);
  234.     CreateObject(12861, 1431.985107, -1624.739258, 12.378241, 0.0000, 0.0000, 0.0000);
  235.     CreateObject(10811, 1426.902466, -1669.323364, 8.906950, 0.0000, 0.0000, 0.0000);
  236.     CreateObject(10773, 1445.142212, -1727.211304, 15.279127, 0.0000, 0.0000, 207.8797);
  237.     CreateObject(3643, 1474.307495, -1724.393677, 17.901663, 0.0000, 0.0000, 91.9597);
  238.     CreateObject(3631, 1509.440063, -1723.559937, 13.125172, 0.0000, 0.0000, 347.1084);
  239.     CreateObject(18609, 1524.278320, -1616.326050, 13.555301, 0.0000, 0.0000, 111.7268);
  240.     CreateObject(13590, 1528.293945, -1647.481201, 13.608673, 0.0000, 0.0000, 0.0000);
  241.     return 1;
  242. }
  243.  
  244. public OnGameModeExit()
  245. {
  246.     return 1;
  247. }
  248.  
  249. public OnPlayerRequestClass(playerid, classid)
  250. {
  251.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  252.     SetPlayerCameraPos(playerid, 1961.1343,1342.7173,15.3746);
  253.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  254.    
  255.     new string[128];
  256.     if (classid == 0)
  257.     {
  258.             format(string, sizeof(string), "~y~> ~p~LS Gang Sniper(1) ~y~<!");
  259.             GameTextForPlayer(playerid,string,3500,6);
  260.     }
  261.     if (classid == 1)
  262.     {
  263.             format(string, sizeof(string), "~y~> ~p~LS Gang Sniper(2) ~y~<!");
  264.             GameTextForPlayer(playerid,string,3500,6);
  265.     }
  266.     if (classid == 2)
  267.     {
  268.             format(string, sizeof(string), "~y~> ~p~LS Gang Assult Member(1) ~y~<!");
  269.             GameTextForPlayer(playerid,string,3500,6);
  270.     }
  271.     if (classid == 3)
  272.     {
  273.             format(string, sizeof(string), "~y~> ~p~LS Gang Assult Member(2) ~y~<!");
  274.             GameTextForPlayer(playerid,string,3500,6);
  275.     }
  276.     if (classid == 4)
  277.     {
  278.             format(string, sizeof(string), "~y~> ~p~LS Gang Bomber(1) ~y~<!");
  279.             GameTextForPlayer(playerid,string,3500,6);
  280.     }
  281.     if (classid == 5)
  282.     {
  283.             format(string, sizeof(string), "~y~> ~p~LS Gang Bomber(2) ~y~<!");
  284.             GameTextForPlayer(playerid,string,3500,6);
  285.     }
  286.     if (classid == 6)
  287.     {
  288.             format(string, sizeof(string), "~y~> ~p~LS Mafia Sniper(1) ~y~<!");
  289.             GameTextForPlayer(playerid,string,3500,6);
  290.     }
  291.     if (classid == 7)
  292.     {
  293.             format(string, sizeof(string), "~y~> ~p~LS Mafia Sniper(2) ~y~<!");
  294.             GameTextForPlayer(playerid,string,3500,6);
  295.     }
  296.     if (classid == 8)
  297.     {
  298.             format(string, sizeof(string), "~y~> ~p~LS Mafia Assult Member(1) ~y~<!");
  299.             GameTextForPlayer(playerid,string,3500,6);
  300.     }
  301.     if (classid == 9)
  302.     {
  303.             format(string, sizeof(string), "~y~> ~p~LS Mafia Assult Member(2) ~y~<!");
  304.             GameTextForPlayer(playerid,string,3500,6);
  305.     }
  306.     if (classid == 10)
  307.     {
  308.             format(string, sizeof(string), "~y~> ~p~LS Mafia Bomber(1) ~y~<!");
  309.             GameTextForPlayer(playerid,string,3500,6);
  310.     }
  311.     if (classid == 11)
  312.     {
  313.             format(string, sizeof(string), "~y~> ~p~LS Mafia Bomber(2) ~y~<!");
  314.             GameTextForPlayer(playerid,string,3500,6);
  315.     }
  316.     if (classid == 12)
  317.     {
  318.             format(string, sizeof(string), "~y~> ~p~Admin Only ~y~<!");
  319.             GameTextForPlayer(playerid,string,3500,6);
  320.     }
  321.     return 1;
  322. }
  323.  
  324. public OnPlayerConnect(playerid)
  325. {
  326.     TextDrawShowForPlayer(playerid,Textdraw0);
  327.     TextDrawShowForPlayer(playerid,Textdraw2);
  328.     SendClientMessage(playerid,TEAM_BALLAS_COLOR,"Welcome to CTF by Darren Reeder(Mowgli)");
  329.     GangTeamPlayer[playerid] = 0;
  330.     MafiaTeamPlayer[playerid] = 0;
  331.     GangFlagHeld[playerid] = 0;
  332.     MafiaFlagHeld[playerid] = 0;
  333.     return 1;
  334. }
  335.  
  336. public OnPlayerDisconnect(playerid, reason)
  337. {
  338.     if(GangTeamPlayer[playerid] == 1 && MafiaTeamPlayer[playerid] == 0) // Gang team death
  339.     {
  340.         GangTeam --;
  341.         GangTeamPlayer[playerid] = 0;
  342.         MafiaTeamPlayer[playerid] = 0;
  343.     }
  344.     if(GangTeamPlayer[playerid] == 0 && MafiaTeamPlayer[playerid] == 1) // Mafia team death
  345.     {
  346.         MafiaTeam --;
  347.         GangTeamPlayer[playerid] = 0;
  348.         MafiaTeamPlayer[playerid] = 0;
  349.     }
  350.     if(GangFlagHeld[playerid] == 1)
  351.     {
  352.         new Float:x, Float:y, Float:z;
  353.         GetPlayerPos(playerid,Float:x,Float:y,Float:z);
  354.         gangflag = CreatePickup(2914, 23, x,y,z,0); // LS gang flag
  355.         gangflagFloor = 1;
  356.  
  357.         DestroyObject(attachedFlagGang);
  358.         GangFlagHeld[playerid] = 0;
  359.         MafiaFlagHeld[playerid] = 0;
  360.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You disconnected and lost the LS Gang Flag!");
  361.         SendClientMessageToAll(COLOR_LIGHTRED,"The LS Mafia flag was returned by disconnection of the holder!");
  362.     }
  363.     if(MafiaFlagHeld[playerid] == 1)
  364.     {
  365.         new Float:x, Float:y, Float:z;
  366.         GetPlayerPos(playerid,Float:x,Float:y,Float:z);
  367.         mafiaflag = CreatePickup(2993, 23, x,y,z,0); // LS mafia flag
  368.         mafiaflagFloor = 1;
  369.  
  370.         DestroyObject(attachedFlagMafia);
  371.         GangFlagHeld[playerid] = 0;
  372.         MafiaFlagHeld[playerid] = 0;
  373.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You disconnected and lost the LS Mafia Flag!");
  374.         SendClientMessageToAll(COLOR_LIGHTRED,"The LS Gang flag was returned by disconnection of the holder!");
  375.     }
  376.     return 1;
  377. }
  378.  
  379. public OnPlayerSpawn(playerid)
  380. {
  381.     if(GetPlayerSkin(playerid) == 108 || GetPlayerSkin(playerid) == 173)
  382.     {
  383.         new rand = random(sizeof(gRandomLsGangSniper));
  384.         SetPlayerPos(playerid, gRandomLsGangSniper[rand][0], gRandomLsGangSniper[rand][1], gRandomLsGangSniper[rand][2]); // Warp the player
  385.         GangTeam ++;
  386.         GangTeamPlayer[playerid] = 1;
  387.         MafiaTeamPlayer[playerid] = 0;
  388.         return 1;
  389.     }
  390.     else if(GetPlayerSkin(playerid) == 115 || GetPlayerSkin(playerid) == 271 || GetPlayerSkin(playerid) == 116 || GetPlayerSkin(playerid) == 102)
  391.     {
  392.         new rand = random(sizeof(gRandomLsGang));
  393.         SetPlayerPos(playerid, gRandomLsGang[rand][0], gRandomLsGang[rand][1], gRandomLsGang[rand][2]); // Warp the player
  394.         GangTeam ++;
  395.         GangTeamPlayer[playerid] = 1;
  396.         MafiaTeamPlayer[playerid] = 0;
  397.         return 1;
  398.     }
  399.     else if(GetPlayerSkin(playerid) == 122 || GetPlayerSkin(playerid) == 121)
  400.     {
  401.         new rand = random(sizeof(gRandomLsMafiaSniper));
  402.         SetPlayerPos(playerid, gRandomLsMafiaSniper[rand][0], gRandomLsMafiaSniper[rand][1], gRandomLsMafiaSniper[rand][2]); // Warp the player
  403.         MafiaTeam ++;
  404.         GangTeamPlayer[playerid] = 0;
  405.         MafiaTeamPlayer[playerid] = 1;
  406.         return 1;
  407.     }
  408.     else if(GetPlayerSkin(playerid) == 123 || GetPlayerSkin(playerid) == 124 || GetPlayerSkin(playerid) == 127 || GetPlayerSkin(playerid) == 113)
  409.     {
  410.         new rand = random(sizeof(gRandomLsMafia));
  411.         SetPlayerPos(playerid, gRandomLsMafia[rand][0], gRandomLsMafia[rand][1], gRandomLsMafia[rand][2]); // Warp the player
  412.         MafiaTeam ++;
  413.         GangTeamPlayer[playerid] = 0;
  414.         MafiaTeamPlayer[playerid] = 1;
  415.         return 1;
  416.     }
  417.     return 1;
  418. }
  419.  
  420. public OnPlayerDeath(playerid, killerid, reason)
  421. {
  422.     if(GangTeamPlayer[playerid] == 1 && MafiaTeamPlayer[playerid] == 0) // Gang team death
  423.     {
  424.         GangTeam --;
  425.         GangTeamPlayer[playerid] = 0;
  426.         MafiaTeamPlayer[playerid] = 0;
  427.     }
  428.     if(GangTeamPlayer[playerid] == 0 && MafiaTeamPlayer[playerid] == 1) // Mafia team death
  429.     {
  430.         MafiaTeam --;
  431.         GangTeamPlayer[playerid] = 0;
  432.         MafiaTeamPlayer[playerid] = 0;
  433.     }
  434.     if(GangFlagHeld[playerid] == 1)
  435.     {
  436.         new Float:x, Float:y, Float:z;
  437.         GetPlayerPos(playerid,Float:x,Float:y,Float:z);
  438.         gangflag = CreatePickup(2914, 23, x,y,z,0); // LS gang flag
  439.         gangflagFloor = 1;
  440.        
  441.         DestroyObject(attachedFlagGang);
  442.         GangFlagHeld[playerid] = 0;
  443.         MafiaFlagHeld[playerid] = 0;
  444.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You died and lost the LS Gang Flag!");
  445.         SendClientMessageToAll(COLOR_LIGHTRED,"The LS Mafia flag was returned by Death of the holder!");
  446.     }
  447.     if(MafiaFlagHeld[playerid] == 1)
  448.     {
  449.         new Float:x, Float:y, Float:z;
  450.         GetPlayerPos(playerid,Float:x,Float:y,Float:z);
  451.         mafiaflag = CreatePickup(2993, 23, x,y,z,0); // LS mafia flag
  452.         mafiaflagFloor = 1;
  453.        
  454.         DestroyObject(attachedFlagMafia);
  455.         GangFlagHeld[playerid] = 0;
  456.         MafiaFlagHeld[playerid] = 0;
  457.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You died and lost the LS Mafia Flag!");
  458.         SendClientMessageToAll(COLOR_LIGHTRED,"The LS Gang flag was returned by Death of the holder!");
  459.     }
  460.     return 1;
  461. }
  462.  
  463. public OnVehicleSpawn(vehicleid)
  464. {
  465.     return 1;
  466. }
  467.  
  468. public OnVehicleDeath(vehicleid, killerid)
  469. {
  470.     return 1;
  471. }
  472.  
  473. public OnPlayerText(playerid, text[])
  474. {
  475.     return 1;
  476. }
  477.  
  478. public OnPlayerCommandText(playerid, cmdtext[])
  479. {
  480.     if (strcmp("/help", cmdtext, true, 5) == 0)
  481.     {
  482.         SendClientMessage(playerid,COLOR_YELLOW,"-----------------Help-----------------");
  483.         SendClientMessage(playerid,COLOR_YELLOW,"This is Darren's CTF.");
  484.         SendClientMessage(playerid,COLOR_YELLOW,"The objective of the server is fight the oposite");
  485.         SendClientMessage(playerid,COLOR_YELLOW,"team and try to capture the flag of the oposite");
  486.         SendClientMessage(playerid,COLOR_YELLOW,"team then bring it back to your flag. Once your");
  487.         SendClientMessage(playerid,COLOR_YELLOW,"team has captured the flag 3 times, the gamemode");
  488.         SendClientMessage(playerid,COLOR_YELLOW,"restarts.");
  489.         SendClientMessage(playerid,COLOR_YELLOW,"-----------------Help-----------------");
  490.         return 1;
  491.     }
  492.     if (strcmp("/kill", cmdtext, true, 5) == 0)
  493.     {
  494.     SetPlayerHealth(playerid,0);
  495.     return 1;
  496.     }
  497.     return 0;
  498. }
  499.  
  500. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  501. {
  502.     return 1;
  503. }
  504.  
  505. public OnPlayerExitVehicle(playerid, vehicleid)
  506. {
  507.     return 1;
  508. }
  509.  
  510. public OnPlayerStateChange(playerid, newstate, oldstate)
  511. {
  512.     return 1;
  513. }
  514.  
  515. public OnPlayerEnterCheckpoint(playerid)
  516. {
  517.     return 1;
  518. }
  519.  
  520. public OnPlayerLeaveCheckpoint(playerid)
  521. {
  522.     return 1;
  523. }
  524.  
  525. public OnPlayerEnterRaceCheckpoint(playerid)
  526. {
  527.     return 1;
  528. }
  529.  
  530. public OnPlayerLeaveRaceCheckpoint(playerid)
  531. {
  532.     return 1;
  533. }
  534.  
  535. public OnRconCommand(cmd[])
  536. {
  537.     return 1;
  538. }
  539.  
  540. public OnPlayerRequestSpawn(playerid)
  541. {
  542.  
  543.     return 1;
  544. }
  545.  
  546. public OnObjectMoved(objectid)
  547. {
  548.     return 1;
  549. }
  550.  
  551. public OnPlayerObjectMoved(playerid, objectid)
  552. {
  553.     return 1;
  554. }
  555.  
  556. public OnPlayerPickUpPickup(playerid, pickupid)
  557. {
  558.     new string[128];
  559.     if(pickupid == gangflag && GangTeamPlayer[playerid] == 1 && gangflagFloor == 1){
  560.         gangflagFloor = 0;
  561.         DestroyPickup(gangflag);
  562.         gangflag = CreatePickup(2914, 23, 1481.7789,-1766.5944,18.7958,0); // LS gang flag
  563.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have succesfully returned the LS Gang flag!");
  564.         new name[MAX_PLAYER_NAME];
  565.         GetPlayerName(playerid,name,sizeof(name));
  566.         format(string,sizeof(string),"%s Has returned the LS gang flag!",name);
  567.         SendClientMessageToAll(COLOR_LIGHTRED,string);
  568.     }
  569.     if(pickupid == mafiaflag && MafiaTeamPlayer[playerid] == 1 && mafiaflagFloor == 1){
  570.         mafiaflagFloor = 0;
  571.         DestroyPickup(mafiaflag);
  572.         mafiaflag = CreatePickup(2993, 23, 1475.5999,-1586.0874,13.5469,0); // LS Mafia flag
  573.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have succesfully returned the LS Mafia flag!");
  574.         new name[MAX_PLAYER_NAME];
  575.         GetPlayerName(playerid,name,sizeof(name));
  576.         format(string,sizeof(string),"%s Has returned the LS Mafia flag!",name);
  577.         SendClientMessageToAll(COLOR_LIGHTRED,string);
  578.     }
  579.     if(pickupid == gangflag && MafiaTeamPlayer[playerid] == 1 && GangFlagHeld[playerid] == 0 && MafiaFlagHeld[playerid] == 0)
  580.     {
  581.         DestroyPickup(gangflag);
  582.         GangFlagHeld[playerid] = 1; //A Mafia member has took GAng Flag
  583.         MafiaFlagHeld[playerid] = 0;
  584.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have got the LS Gang's Flag - Get back to your Flag!");
  585.         SendClientMessageToAll(COLOR_RED,"The LS Gang Flag has been stolen!");
  586.         attachedFlagGang = CreateObject(2914, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  587.         AttachObjectToPlayer(attachedFlagGang, playerid, 0.1, -0.25, -0.25, -5.0, 315.0, 0.0);
  588.     }
  589.     if(pickupid == mafiaflag && GangTeamPlayer[playerid] == 1 && GangFlagHeld[playerid] == 0 && MafiaFlagHeld[playerid] == 0)
  590.     {
  591.         DestroyPickup(mafiaflag);
  592.         GangFlagHeld[playerid] = 0; // A Gang member has took the Mafia Flag.
  593.         MafiaFlagHeld[playerid] = 1;
  594.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have got the LS Mafia's Flag - Get back to your Flag!");
  595.         SendClientMessageToAll(COLOR_RED,"The LS Mafia Flag has been stolen!");
  596.         attachedFlagMafia = CreateObject(2993, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  597.         AttachObjectToPlayer(attachedFlagMafia, playerid, 0.1, -0.25, -0.25, -5.0, 315.0, 0.0);
  598.     }
  599.     if(pickupid == gangflag && GangTeamPlayer[playerid] == 1 && MafiaFlagHeld[playerid] == 1)
  600.     { // A Gang Member returns Mafia Flag
  601.         DestroyObject(attachedFlagMafia);
  602.         GangFlagHeld[playerid] = 0;
  603.         MafiaFlagHeld[playerid] = 0;
  604.         mafiaflag = CreatePickup(2993, 23, 1475.5999,-1586.0874,13.5469,0); // LS Mafia flag
  605.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have succesfully took the LS Mafia flag!");
  606.         SendClientMessageToAll(COLOR_LIGHTRED,"The LS Gang Got a Point!");
  607.         gangscore++;
  608.         format(string, sizeof(string), "Mafia Score: %d | Gang Score: %d", mafiascore, gangscore);
  609.         TextDrawSetString(Textdraw2, string);
  610.         for(new i=0; i<MAX_PLAYERS; i++)
  611.         {
  612.             TextDrawShowForPlayer(i,Textdraw2);
  613.         }
  614.         if(gangscore >= scoreLimit){
  615.         SendClientMessageToAll(COLOR_RED,"Game Over, The Los Santos Gang Has Won!");
  616.         GameModeExit();
  617.         }
  618.     }
  619.     if(pickupid == mafiaflag && MafiaTeamPlayer[playerid] == 1 && GangFlagHeld[playerid] == 1)
  620.     { // A Mafia MEmbers returns Gang Flag
  621.         DestroyObject(attachedFlagGang);
  622.         GangFlagHeld[playerid] = 0;
  623.         MafiaFlagHeld[playerid] = 0;
  624.         gangflag = CreatePickup(2914, 23, 1481.7789,-1766.5944,18.7958,0); // LS gang flag
  625.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have succesfully took the LS Gang flag!");
  626.         SendClientMessageToAll(COLOR_LIGHTRED,"The LS Mafia Got a Point!");
  627.         mafiascore++;
  628.         format(string, sizeof(string), "Mafia Score: %d | Gang Score: %d", mafiascore, gangscore);
  629.         TextDrawSetString(Textdraw2, string);
  630.         for(new i=0; i<MAX_PLAYERS; i++)
  631.         {
  632.             TextDrawShowForPlayer(i,Textdraw2);
  633.         }
  634.         if(mafiascore >= scoreLimit){
  635.         SendClientMessageToAll(COLOR_RED,"Game Over, The Los Santos Mafia Has Won!");
  636.         GameModeExit();
  637.         }
  638.     }
  639.     return 1;
  640. }
  641.  
  642. public OnVehicleMod(playerid, vehicleid, componentid)
  643. {
  644.     return 1;
  645. }
  646.  
  647. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  648. {
  649.     return 1;
  650. }
  651.  
  652. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  653. {
  654.     return 1;
  655. }
  656.  
  657. public OnPlayerSelectedMenuRow(playerid, row)
  658. {
  659.     return 1;
  660. }
  661.  
  662. public OnPlayerExitedMenu(playerid)
  663. {
  664.     return 1;
  665. }
  666.  
  667. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  668. {
  669.     return 1;
  670. }
  671.  
  672. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  673. {
  674.     return 1;
  675. }
  676.  
  677. public OnRconLoginAttempt(ip[], password[], success)
  678. {
  679.     return 1;
  680. }
  681.  
  682. public OnPlayerUpdate(playerid)
  683. {
  684.     return 1;
  685. }
  686.  
  687. public OnPlayerStreamIn(playerid, forplayerid)
  688. {
  689.     return 1;
  690. }
  691.  
  692. public OnPlayerStreamOut(playerid, forplayerid)
  693. {
  694.     return 1;
  695. }
  696.  
  697. public OnVehicleStreamIn(vehicleid, forplayerid)
  698. {
  699.     return 1;
  700. }
  701.  
  702. public OnVehicleStreamOut(vehicleid, forplayerid)
  703. {
  704.     return 1;
  705. }
  706.  
  707. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  708. {
  709.     return 1;
  710. }
  711.  
  712. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  713. {
  714.     return 1;
  715. }
  716. // This script was created by DArren Reeder(mowgli) which is me. I have decided to release it so everyone can enjoy
  717. //it so please dont remove these commented lines just so everyone who edits my script knows i made it...thanks alot..
  718. //add [email protected] if you need any help or anything at all from me..
Advertisement
Add Comment
Please, Sign In to add comment