Advertisement
Guest User

Basic CVT Script by Kapersky

a guest
Mar 1st, 2015
783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.26 KB | None | 0 0
  1. /*
  2. Cops vs Terrorists [BASE GM FOR BEGINNERS] [MySQL] - Brought to you by Kapersky.
  3. This script is created by Kapersky
  4.  
  5. SCRIPTING NOTES:
  6. - Script uses MySQL latest libraries.
  7. - Team '1' is Cops - Team '2' is Terrorists - Team '0' is none.
  8. - Variables declared with a 'char' at the end saves more memory, and should be accessed with curly brackets ' { } ', as defined in Slice tutorial. EX: gIsNewHere { playerid } = false;
  9. - Do not add air-killing vehicles such as Hunter or Sparrows. They provide extra power over killing.
  10. - Anticheat Settings:
  11. ALWAYS use SetPlayerHealthEx / SetPlayerArmourEx to set the players health/armour, or else the script will detect the player as hacking!*/
  12.  
  13. #include <a_samp>
  14. #include <a_mysql>
  15. #include <ZCMD>
  16. #include <colors>
  17. #include <foreach>
  18. #include <mSelection>
  19. #include <streamer>
  20. #include <ZCMD>
  21. #include <sscanf2>
  22.  
  23. #undef MAX_PLAYERS
  24. #define MAX_PLAYERS 50
  25.  
  26. #define HOST "localhost"
  27. #define DB "tdm"
  28. #define USER "root"
  29. #define PASS ""
  30.  
  31. #define D_REG (1)
  32. #define D_LOG (2)
  33. #define D_TEAM (3)
  34. #define D_ACMDLIST (4)
  35.  
  36. #define TEAM_COPS 1
  37. #define TEAM_TERRORISTS 2
  38.  
  39. #define CUSTOM_SKIN_ARMY_MENU 3
  40. #define CUSTOM_SKIN_TERROR_MENU 4
  41.  
  42. #define SERVER_NAME "[BASE] Cops vs Terrorists"
  43. #define SERVER_VERSION "CVT 0.1a"
  44.  
  45. #define AdminOnly "You are not authourized to use this command!");
  46. #define SCM SendClientMessage
  47. #define SCMTA SendClientMessageToAll
  48.  
  49. static
  50. mysql,
  51. Name[MAX_PLAYERS][24],
  52. IP[MAX_PLAYERS][16]
  53. ;
  54.  
  55. native WP_Hash(buffer[], len, const str[]);
  56.  
  57. enum E_PLAYER_DATA
  58. {
  59. ID,
  60. Password[129],
  61. Money,
  62. Admin,
  63. VIP,
  64. Team
  65. }
  66.  
  67. new pInfo[MAX_PLAYERS][E_PLAYER_DATA];
  68.  
  69. new gLoginAttempts[MAX_PLAYERS];
  70. new bool:gIsNewHere[MAX_PLAYERS char];
  71. new bool:gAntiSpawnProtected[MAX_PLAYERS char];
  72. new gHealth[MAX_PLAYERS];
  73. new gArmour[MAX_PLAYERS];
  74. new gIsLogged[MAX_PLAYERS char];
  75. new IsPMEnabled[MAX_PLAYERS char];
  76. new Float:SpecX[MAX_PLAYERS], Float:SpecY[MAX_PLAYERS], Float:SpecZ[MAX_PLAYERS], vWorld[MAX_PLAYERS], Inter[MAX_PLAYERS];
  77. new IsSpecing[MAX_PLAYERS], IsBeingSpeced[MAX_PLAYERS],spectatorid[MAX_PLAYERS];
  78.  
  79. //TDs
  80. new PlayerText:CVTIntro_TD[MAX_PLAYERS][10];
  81. new Text:randommsg;
  82.  
  83. //Arrays:
  84. new Float:RandomArmySpawn[][] =
  85. {
  86. {191.0500, 1931.2633, 17.6406, 87.7332},
  87. {225.1407, 1867.3564, 13.1406, 87.4198},
  88. {211.0664, 1810.9338, 21.8672, 99.3032},
  89. {349.1653, 2029.8040, 22.6406, 85.2495}
  90. };
  91.  
  92. new Float:RandomTerroristSpawn[][] =
  93. {
  94. {-1503.8159, 2618.3647, 55.8359, 267.9561},
  95. {-1451.6556, 2589.7002, 59.7459, 2.2938},
  96. {-1389.8231, 2638.2393, 55.9844, 174.4604},
  97. {-1466.4821, 2686.5588, 55.8359, 170.2186}
  98. };
  99.  
  100. new RandomMessages[][] =
  101. {
  102. "~y~[CVT] RM: ~w~Ever spotted a ~r~hacker?~w~ ~g~/report~w~ him to the administrators!",
  103. "~y~[CVT] RM: ~w~Want to suggest something or report a bug? ~g~Visit our forums!",
  104. "~y~[CVT] RM: ~w~Make sure you register at our ~g~forums~w~ and register to our newsletter!",
  105. "~y~[CVT] RM: ~w~Just ~g~chill~w~, and ~r~kill!"
  106. };
  107.  
  108.  
  109. //Functions forwards
  110. forward OnPlayerAccountCheck(playerid);
  111. forward OnPlayerAccountRegister(playerid);
  112. forward OnPlayerAccountLoad(playerid);
  113. forward RandomMessage();
  114.  
  115. //Timers
  116. forward KickPlayer(playerid);
  117. forward SaveAccountsPerMinute(playerid);
  118. forward AntiSpawnTimer(playerid);
  119. forward Anticheat(playerid);
  120.  
  121. main()
  122. {
  123. print("\n [CVT] Cops vs Terrorists.");
  124. print(" Created by Kapersky");
  125. print(" Now loading.\n");
  126. }
  127.  
  128. public OnGameModeInit()
  129. {
  130. SetGameModeText(""SERVER_VERSION"");
  131.  
  132. //Server settings:
  133. ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
  134. ShowNameTags(1);
  135. SetNameTagDrawDistance(10.0);
  136. EnableStuntBonusForAll(0);
  137. DisableInteriorEnterExits();
  138.  
  139. //MySQL Connection:
  140. mysql_log( LOG_ERROR | LOG_WARNING | LOG_DEBUG );
  141. mysql = mysql_connect( HOST , USER , DB , PASS );
  142.  
  143. if(mysql_errno(mysql) != 0)
  144. {
  145. printf("ERROR: MySQL could not connect to mysql. Console quiting.");
  146. SendRconCommand("exit");
  147. }
  148. /////////
  149.  
  150. //We will not use player classes.
  151. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  152.  
  153. foreach(Player,i)
  154. {
  155. SetTimerEx("SaveAccountsPerMinute", 60000, true, "u", i);
  156. }
  157.  
  158. SetTimer("RandomMessage",8000,1); //We define the random messages per 8 seconds.
  159.  
  160. //Global Textdraws Creation:
  161. randommsg = TextDrawCreate(7.000000, 427.000000, "You don't need to add any text here");
  162. TextDrawBackgroundColor(randommsg, 255);
  163. TextDrawFont(randommsg, 1);
  164. TextDrawLetterSize(randommsg, 0.379999, 1.499999);
  165. TextDrawColor(randommsg, -1);
  166. TextDrawSetOutline(randommsg, 1);
  167. TextDrawSetProportional(randommsg, 1);
  168.  
  169. //Objects and vehicles
  170. AddStaticVehicle(476,308.6000100,2055.2000000,18.8000000,180.0000000,105,88); //Rustler
  171. AddStaticVehicle(476,320.0996100,2055.2998000,18.8000000,180.0000000,105,88); //Rustler
  172. AddStaticVehicle(476,296.7000100,2055.3000000,18.8000000,180.0000000,105,88); //Rustler
  173. AddStaticVehicle(476,297.2000100,2065.8000000,18.8000000,180.0000000,105,88); //Rustler
  174. AddStaticVehicle(476,319.8999900,2065.5000000,18.8000000,180.0000000,105,88); //Rustler
  175. AddStaticVehicle(476,308.5000000,2065.7002000,18.8000000,180.0000000,105,88); //Rustler
  176. AddStaticVehicle(476,287.3999900,2059.3999000,18.8000000,180.0000000,105,88); //Rustler
  177. AddStaticVehicle(476,329.8999900,2059.7000000,18.8000000,180.0000000,105,88); //Rustler
  178. AddStaticVehicle(476,314.8999900,2043.6000000,18.8000000,180.0000000,105,88); //Rustler
  179. AddStaticVehicle(476,291.5996100,2043.7002000,18.8000000,180.0000000,105,88); //Rustler
  180. AddStaticVehicle(476,303.2998000,2043.5996000,18.8000000,180.0000000,105,88); //Rustler
  181. AddStaticVehicle(476,327.1000100,2043.9000000,19.1000000,180.0000000,105,88); //Rustler
  182. AddStaticVehicle(432,272.0000000,2014.5000000,17.7000000,270.0000000,95,10); //Rhino
  183. AddStaticVehicle(432,271.8999900,2021.0000000,17.7000000,270.0000000,95,10); //Rhino
  184. AddStaticVehicle(432,271.9003900,2026.7998000,17.7000000,270.0000000,95,10); //Rhino
  185. AddStaticVehicle(432,271.7000100,2032.3000000,17.7000000,270.0000000,95,10); //Rhino
  186. AddStaticVehicle(432,282.8999900,2025.1000000,17.7000000,270.0000000,95,10); //Rhino
  187. AddStaticVehicle(433,280.7000100,1983.4000000,18.2000000,270.0000000,95,10); //Barracks
  188. AddStaticVehicle(433,280.7000100,1989.0000000,18.2000000,270.0000000,95,10); //Barracks
  189. AddStaticVehicle(433,280.5000000,1994.6000000,18.2000000,270.0000000,95,10); //Barracks
  190. AddStaticVehicle(470,282.2000100,1953.0000000,17.8000000,270.0000000,95,10); //Patriot
  191. AddStaticVehicle(470,282.4003900,1948.7998000,17.8000000,270.0000000,95,10); //Patriot
  192. AddStaticVehicle(470,282.0000000,1959.5000000,17.8000000,270.0000000,95,10); //Patriot
  193. AddStaticVehicle(470,282.1000100,1956.3000000,17.8000000,270.0000000,95,10); //Patriot
  194. AddStaticVehicle(470,281.8999900,1962.8000000,17.8000000,270.0000000,95,10); //Patriot
  195. AddStaticVehicle(470,235.3000000,1917.3000000,17.8000000,145.0000000,95,10); //Patriot
  196. AddStaticVehicle(470,235.1000100,1911.3000000,17.8000000,144.9980000,95,10); //Patriot
  197. AddStaticVehicle(470,235.1000100,1905.3000000,17.8000000,144.9980000,95,10); //Patriot
  198. AddStaticVehicle(470,234.7000000,1899.5000000,17.8000000,144.9980000,95,10); //Patriot
  199. AddStaticVehicle(470,234.5000000,1888.0000000,17.8000000,144.9980000,95,10); //Patriot
  200. AddStaticVehicle(470,235.0000000,1893.9004000,17.8000000,144.9980000,95,10); //Patriot
  201. AddStaticVehicle(470,234.3000000,1876.7000000,17.8000000,144.9980000,95,10); //Patriot
  202. AddStaticVehicle(470,234.2002000,1882.2002000,17.8000000,144.9980000,95,10); //Patriot
  203. AddStaticVehicle(497,208.3999900,1931.4000000,23.5000000,0.0000000,-1,-1); //Police Maverick
  204. AddStaticVehicle(497,223.5996100,1886.7998000,17.9000000,0.0000000,-1,-1); //Police Maverick
  205. AddStaticVehicle(497,205.2002000,1886.5996000,17.9000000,0.0000000,-1,-1); //Police Maverick
  206. AddStaticVehicle(497,196.0000000,1931.2002000,23.5000000,0.0000000,-1,-1); //Police Maverick
  207. AddStaticVehicle(497,220.8999900,1931.5000000,23.5000000,0.0000000,-1,-1); //Police Maverick
  208. AddStaticVehicle(482,222.8000000,1866.3000000,13.3000000,90.0000000,102,28); //Burrito
  209. AddStaticVehicle(482,222.5000000,1863.5000000,13.4000000,90.0000000,102,28); //Burrito
  210. AddStaticVehicle(482,222.6000100,1860.6000000,13.4000000,90.0000000,102,28); //Burrito
  211. AddStaticVehicle(599,213.8999900,1860.4000000,13.5000000,0.0000000,-1,-1); //Police Ranger
  212. AddStaticVehicle(599,210.8000000,1860.4000000,13.5000000,0.0000000,-1,-1); //Police Ranger
  213. AddStaticVehicle(599,207.0000000,1860.7000000,13.5000000,0.0000000,-1,-1); //Police Ranger
  214. AddStaticVehicle(599,203.2000000,1861.1000000,13.5000000,0.0000000,-1,-1); //Police Ranger
  215. AddStaticVehicle(522,153.3000000,1914.2000000,18.5000000,0.0000000,76,117); //NRG-500
  216. AddStaticVehicle(522,152.2000000,1914.2000000,18.5000000,0.0000000,76,117); //NRG-500
  217. AddStaticVehicle(522,154.2000000,1914.1000000,18.5000000,0.0000000,76,117); //NRG-500
  218. AddStaticVehicle(522,153.2998000,1914.2002000,18.5000000,0.0000000,76,117); //NRG-500
  219. AddStaticVehicle(522,151.2000000,1914.2000000,18.5000000,0.0000000,76,117); //NRG-500
  220. AddStaticVehicle(522,150.2000000,1914.2000000,18.5000000,0.0000000,76,117); //NRG-500
  221. AddStaticVehicle(522,149.2000000,1914.2000000,18.5000000,0.0000000,76,117); //NRG-500
  222. AddStaticVehicle(522,148.2000000,1914.3000000,18.5000000,0.0000000,76,117); //NRG-500
  223. AddStaticVehicle(598,158.5000000,1908.2000000,18.6000000,0.0000000,-1,-1); //Police Car (LVPD)
  224. AddStaticVehicle(598,161.2000000,1908.2000000,18.5000000,0.0000000,-1,-1); //Police Car (LVPD)
  225. AddStaticVehicle(598,164.0000000,1908.2000000,18.4000000,0.0000000,-1,-1); //Police Car (LVPD)
  226. AddStaticVehicle(598,169.2000000,1908.2000000,18.3000000,0.0000000,-1,-1); //Police Car (LVPD)
  227. AddStaticVehicle(598,166.5996100,1908.2002000,18.3000000,0.0000000,-1,-1); //Police Car (LVPD)
  228. AddStaticVehicle(598,174.8999900,1908.3000000,18.1000000,0.0000000,-1,-1); //Police Car (LVPD)
  229. AddStaticVehicle(598,172.0000000,1908.2002000,18.2000000,0.0000000,-1,-1); //Police Car (LVPD)
  230. AddStaticVehicle(598,177.8999900,1908.4000000,17.9000000,0.0000000,-1,-1); //Police Car (LVPD)
  231. AddStaticVehicle(490,130.1000100,1915.2000000,19.2000000,0.0000000,-1,-1); //FBI Rancher
  232. AddStaticVehicle(490,137.7002000,1915.2002000,19.2000000,0.0000000,-1,-1); //FBI Rancher
  233. AddStaticVehicle(490,133.9003900,1915.0996000,19.2000000,0.0000000,-1,-1); //FBI Rancher
  234. AddStaticVehicle(490,125.3000000,1914.3000000,19.2000000,45.0000000,-1,-1); //FBI Rancher
  235. AddStaticVehicle(490,124.3000000,1911.0000000,19.1000000,45.0000000,-1,-1); //FBI Rancher
  236. AddStaticVehicle(490,123.7000000,1902.3000000,18.9000000,45.0000000,-1,-1); //FBI Rancher
  237. AddStaticVehicle(490,123.7998000,1906.5996000,19.0000000,45.0000000,-1,-1); //FBI Rancher
  238. AddStaticVehicle(490,124.0000000,1893.9000000,18.7000000,45.0000000,-1,-1); //FBI Rancher
  239. AddStaticVehicle(490,123.7998000,1898.2002000,18.8000000,45.0000000,-1,-1); //FBI Rancher
  240. AddStaticVehicle(427,149.3999900,1869.5000000,18.1000000,270.0000000,-1,-1); //Enforcer
  241. AddStaticVehicle(427,149.2000000,1878.8000000,18.2000000,270.0000000,-1,-1); //Enforcer
  242. AddStaticVehicle(427,149.3999900,1872.7000000,18.1000000,270.0000000,-1,-1); //Enforcer
  243. AddStaticVehicle(427,149.2998000,1875.5996000,18.1000000,270.0000000,-1,-1); //Enforcer
  244. AddStaticVehicle(427,149.2000000,1881.9000000,18.3000000,270.0000000,-1,-1); //Enforcer
  245. AddStaticVehicle(417,349.3999900,1941.1000000,18.0000000,0.0000000,-1,-1); //Leviathan
  246. AddStaticVehicle(561,113.9000000,1864.2000000,17.7000000,0.0000000,63,62); //Stratum
  247. AddStaticVehicle(561,123.7000000,1864.1000000,17.7000000,0.0000000,63,62); //Stratum
  248. AddStaticVehicle(561,117.5996100,1864.2002000,17.7000000,0.0000000,63,62); //Stratum
  249. AddStaticVehicle(561,120.7998000,1864.0996000,17.7000000,0.0000000,63,62); //Stratum
  250. AddStaticVehicle(469,116.9000000,1840.5000000,17.7000000,0.0000000,245,245); //Sparrow
  251. AddStaticVehicle(469,117.5000000,1827.4004000,17.7000000,0.0000000,245,245); //Sparrow
  252. AddStaticVehicle(469,129.7998000,1827.9004000,17.7000000,0.0000000,245,245); //Sparrow
  253. AddStaticVehicle(469,129.7998000,1840.4004000,17.7000000,0.0000000,245,245); //Sparrow
  254. AddStaticVehicle(565,-1561.9000000,2661.1001000,55.5000000,0.0000000,76,117); //Flash
  255. AddStaticVehicle(565,-1564.5000000,2661.0000000,55.5000000,0.0000000,76,117); //Flash
  256. AddStaticVehicle(565,-1567.1000000,2661.0000000,55.5000000,0.0000000,76,117); //Flash
  257. AddStaticVehicle(565,-1572.2000000,2661.0000000,55.5000000,0.0000000,76,117); //Flash
  258. AddStaticVehicle(565,-1569.5996000,2661.0000000,55.5000000,0.0000000,76,117); //Flash
  259. AddStaticVehicle(559,-1520.3000000,2630.3000000,55.6000000,0.0000000,109,24); //Jester
  260. AddStaticVehicle(559,-1517.0996000,2630.2002000,55.6000000,0.0000000,109,24); //Jester
  261. AddStaticVehicle(559,-1523.4000000,2630.2000000,55.6000000,0.0000000,109,24); //Jester
  262. AddStaticVehicle(559,-1532.7000000,2627.0000000,55.6000000,0.0000000,109,24); //Jester
  263. AddStaticVehicle(559,-1526.5000000,2630.3000000,55.6000000,0.0000000,109,24); //Jester
  264. AddStaticVehicle(559,-1529.2002000,2627.0000000,55.6000000,0.0000000,109,24); //Jester
  265. AddStaticVehicle(555,-1540.9000000,2586.3000000,55.6000000,0.0000000,48,79); //Windsor
  266. AddStaticVehicle(555,-1541.0000000,2579.3999000,55.5000000,0.0000000,48,79); //Windsor
  267. AddStaticVehicle(555,-1551.0000000,2569.5000000,55.6000000,0.0000000,48,79); //Windsor
  268. AddStaticVehicle(555,-1541.0996000,2571.7002000,55.5000000,0.0000000,48,79); //Windsor
  269. AddStaticVehicle(555,-1541.0996000,2563.2002000,55.5000000,0.0000000,48,79); //Windsor
  270. AddStaticVehicle(555,-1551.0000000,2577.0000000,55.6000000,0.0000000,48,79); //Windsor
  271. AddStaticVehicle(555,-1551.0000000,2584.2000000,55.6000000,0.0000000,48,79); //Windsor
  272. AddStaticVehicle(555,-1551.0000000,2590.8999000,55.6000000,0.0000000,48,79); //Windsor
  273. AddStaticVehicle(480,-1431.1000000,2614.0000000,55.7000000,0.0000000,42,119); //Comet
  274. AddStaticVehicle(480,-1431.0000000,2620.3999000,55.7000000,0.0000000,42,119); //Comet
  275. AddStaticVehicle(480,-1420.9000000,2619.5000000,55.7000000,0.0000000,42,119); //Comet
  276. AddStaticVehicle(480,-1431.0000000,2626.6006000,55.7000000,0.0000000,42,119); //Comet
  277. AddStaticVehicle(480,-1430.9004000,2633.7002000,55.5000000,0.0000000,42,119); //Comet
  278. AddStaticVehicle(480,-1421.0000000,2613.6006000,55.5000000,0.0000000,42,119); //Comet
  279. AddStaticVehicle(480,-1420.8000000,2633.3999000,55.7000000,0.0000000,42,119); //Comet
  280. AddStaticVehicle(480,-1420.7002000,2626.1006000,55.7000000,0.0000000,42,119); //Comet
  281. AddStaticVehicle(417,-1447.3000000,2616.7000000,60.8000000,0.0000000,-1,-1); //Leviathan
  282. AddStaticVehicle(417,-1465.4000000,2620.7000000,61.1000000,0.0000000,-1,-1); //Leviathan
  283. AddStaticVehicle(447,-1509.9000000,2532.2000000,55.8000000,0.0000000,32,32); //Seasparrow
  284. AddStaticVehicle(447,-1498.5000000,2532.2998000,55.8000000,0.0000000,32,32); //Seasparrow
  285. AddStaticVehicle(447,-1520.6000000,2532.3999000,55.8000000,0.0000000,32,32); //Seasparrow
  286. AddStaticVehicle(447,-1531.6000000,2532.3000000,55.8000000,0.0000000,32,32); //Seasparrow
  287. AddStaticVehicle(563,-1530.7000000,2583.8000000,61.5000000,0.0000000,245,245); //Raindance
  288. AddStaticVehicle(563,-1481.0996000,2582.7002000,61.5000000,0.0000000,245,245); //Raindance
  289. AddStaticVehicle(563,-1512.5000000,2584.4004000,61.9000000,0.0000000,245,245); //Raindance
  290. AddStaticVehicle(476,-1542.1000000,2483.2000000,57.6000000,180.0000000,111,130); //Rustler
  291. AddStaticVehicle(476,-1529.4000000,2483.1001000,57.6000000,180.0000000,111,130); //Rustler
  292. AddStaticVehicle(476,-1517.0000000,2483.2000000,57.6000000,180.0000000,111,130); //Rustler
  293. AddStaticVehicle(476,-1517.0000000,2472.6001000,57.6000000,180.0000000,111,130); //Rustler
  294. AddStaticVehicle(476,-1529.2000000,2472.8000000,57.6000000,180.0000000,111,130); //Rustler
  295. AddStaticVehicle(476,-1541.3000000,2473.0000000,57.6000000,180.0000000,111,130); //Rustler
  296. AddStaticVehicle(476,-1541.0000000,2462.5000000,57.6000000,180.0000000,111,130); //Rustler
  297. AddStaticVehicle(476,-1528.9000000,2462.6001000,57.6000000,180.0000000,111,130); //Rustler
  298. AddStaticVehicle(476,-1517.1000000,2462.7000000,57.6000000,180.0000000,111,130); //Rustler
  299. AddStaticVehicle(553,-1490.7000000,2473.6001000,58.6000000,180.0000000,125,98); //Nevada
  300. AddStaticVehicle(553,-1490.9000000,2447.6001000,58.6000000,180.0000000,125,98); //Nevada
  301. AddStaticVehicle(447,-1529.8000000,2617.3000000,59.7000000,0.0000000,32,32); //Seasparrow
  302. AddStaticVehicle(447,-1509.2000000,2616.5000000,59.6000000,0.0000000,32,32); //Seasparrow
  303. AddStaticVehicle(447,-1519.7002000,2617.1006000,59.8000000,0.0000000,32,32); //Seasparrow
  304. AddStaticVehicle(422,-1406.9000000,2658.2000000,55.8000000,0.0000000,30,46); //Bobcat
  305. AddStaticVehicle(422,-1412.3000000,2658.3000000,55.8000000,0.0000000,30,46); //Bobcat
  306. AddStaticVehicle(422,-1409.7998000,2658.2002000,55.8000000,0.0000000,30,46); //Bobcat
  307. AddStaticVehicle(428,-1400.4000000,2659.7000000,55.9000000,90.0000000,38,55); //Securicar
  308. AddStaticVehicle(428,-1400.5000000,2650.2000000,55.9000000,90.0000000,38,55); //Securicar
  309. AddStaticVehicle(428,-1400.5996000,2656.5000000,55.9000000,90.0000000,38,55); //Securicar
  310. AddStaticVehicle(428,-1400.5996000,2653.4004000,55.9000000,90.0000000,38,55); //Securicar
  311. AddStaticVehicle(600,-1400.7000000,2643.8000000,55.5000000,90.0000000,189,190); //Picador
  312. AddStaticVehicle(600,-1400.7000000,2637.7000000,55.5000000,90.0000000,189,190); //Picador
  313. AddStaticVehicle(600,-1400.7998000,2640.7998000,55.5000000,90.0000000,189,190); //Picador
  314. AddStaticVehicle(600,-1400.8000000,2631.7000000,55.6000000,90.0000000,189,190); //Picador
  315. AddStaticVehicle(600,-1400.7998000,2634.6006000,55.6000000,90.0000000,189,190); //Picador
  316. AddStaticVehicle(522,-1452.3000000,2658.7000000,55.5000000,0.0000000,109,122); //NRG-500
  317. AddStaticVehicle(522,-1457.4004000,2658.7002000,55.5000000,0.0000000,109,122); //NRG-500
  318. AddStaticVehicle(522,-1456.2002000,2658.7998000,55.5000000,0.0000000,109,122); //NRG-500
  319. AddStaticVehicle(522,-1455.2002000,2658.7998000,55.5000000,0.0000000,109,122); //NRG-500
  320. AddStaticVehicle(522,-1454.2002000,2658.7998000,55.5000000,0.0000000,109,122); //NRG-500
  321. AddStaticVehicle(522,-1450.3000000,2658.7000000,55.5000000,0.0000000,109,122); //NRG-500
  322. AddStaticVehicle(522,-1451.3000000,2658.6001000,55.5000000,0.0000000,109,122); //NRG-500
  323. AddStaticVehicle(522,-1453.3000000,2658.8000000,55.5000000,0.0000000,109,122); //NRG-500
  324. AddStaticVehicle(580,-1478.0000000,2663.1001000,55.7000000,0.0000000,109,108); //Stafford
  325. AddStaticVehicle(580,-1474.3000000,2663.1001000,55.7000000,0.0000000,109,108); //Stafford
  326. AddStaticVehicle(580,-1462.6000000,2663.0000000,55.7000000,0.0000000,109,108); //Stafford
  327. AddStaticVehicle(580,-1470.7002000,2663.1006000,55.7000000,0.0000000,109,108); //Stafford
  328. AddStaticVehicle(580,-1467.9004000,2663.0000000,55.7000000,0.0000000,109,108); //Stafford
  329. AddStaticVehicle(580,-1465.2002000,2663.0000000,55.7000000,0.0000000,109,108); //Stafford
  330. AddStaticVehicle(584,-1303.4000000,2702.3999000,51.2000000,6.0000000,245,245); //Trailer 3
  331. AddStaticVehicle(584,-1311.2000000,2699.7000000,51.2000000,4.0000000,245,245); //Trailer 3
  332. AddStaticVehicle(584,-1307.0996000,2701.2998000,51.2000000,6.0000000,245,245); //Trailer 3
  333. CreateDynamicObject(3399,284.3999900,1832.3000000,18.0000000,0.0000000,0.0000000,90.0000000); //object(cxrf_a51_stairs) (1)
  334. CreateDynamicObject(3399,284.3999900,1844.0000000,22.5000000,0.0000000,0.0000000,90.0000000); //object(cxrf_a51_stairs) (2)
  335. CreateDynamicObject(3399,286.7002000,1855.5996000,22.5000000,0.0000000,0.0000000,270.0000000); //object(cxrf_a51_stairs) (3)
  336. CreateDynamicObject(3399,286.6000100,1867.2000000,17.8000000,0.0000000,0.0000000,270.0000000); //object(cxrf_a51_stairs) (4)
  337. CreateDynamicObject(13647,164.0000000,1964.8000000,17.7000000,0.0000000,0.0000000,0.0000000); //object(wall1) (1)
  338. CreateDynamicObject(13647,107.5000000,1964.4000000,17.8000000,0.0000000,0.0000000,0.0000000); //object(wall1) (2)
  339. CreateDynamicObject(4724,148.3999900,1929.5000000,20.1000000,0.0000000,0.0000000,0.0000000); //object(librarywall_lan2) (1)
  340. CreateDynamicObject(4724,176.8999900,1921.4000000,19.1000000,0.0000000,0.0000000,180.0000000); //object(librarywall_lan2) (2)
  341. CreateDynamicObject(4603,87.6000000,2011.9000000,22.7000000,0.0000000,0.0000000,90.0000000); //object(sky4plaz2_lan) (1)
  342. CreateDynamicObject(4726,348.2000100,1937.0000000,15.4000000,0.0000000,0.0000000,0.0000000); //object(libtwrhelipd_lan2) (1)
  343. CreateDynamicObject(3095,268.2000100,1883.6000000,15.9000000,0.0000000,0.0000000,0.0000000); //object(a51_jetdoor) (1)
  344. CreateDynamicObject(3271,217.5000000,1985.8000000,16.6000000,0.0000000,0.0000000,0.0000000); //object(bonyrd_block3_) (1)
  345. CreateDynamicObject(3271,246.5000000,2010.9000000,16.8000000,0.0000000,0.0000000,0.0000000); //object(bonyrd_block3_) (2)
  346. CreateDynamicObject(3271,244.9003900,1964.5996000,16.6000000,0.0000000,0.0000000,0.0000000); //object(bonyrd_block3_) (3)
  347. CreateDynamicObject(12911,165.7000000,1993.6000000,17.6000000,0.0000000,0.0000000,0.0000000); //object(sw_silo02) (1)
  348. CreateDynamicObject(12911,178.7998000,1989.5996000,17.1000000,0.0000000,0.0000000,0.0000000); //object(sw_silo02) (2)
  349. CreateDynamicObject(3934,129.8999900,1841.1000000,16.7000000,0.0000000,0.0000000,0.0000000); //object(helipad01) (1)
  350. CreateDynamicObject(3934,116.9000000,1841.1000000,16.7000000,0.0000000,0.0000000,0.0000000); //object(helipad01) (2)
  351. CreateDynamicObject(3934,117.4000000,1828.4000000,16.7000000,0.0000000,0.0000000,0.0000000); //object(helipad01) (3)
  352. CreateDynamicObject(3934,129.8999900,1828.7000000,16.7000000,0.0000000,0.0000000,0.0000000); //object(helipad01) (4)
  353. CreateDynamicObject(8171,-1490.1000000,2419.1001000,55.4000000,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (1)
  354. CreateDynamicObject(8171,-1529.9004000,2419.1006000,55.4000000,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (2)
  355. CreateDynamicObject(1337,-1474.9258000,2388.9805000,50.5988000,0.0000000,0.0000000,0.0000000); //object(binnt07_la) (4)
  356. CreateDynamicObject(7191,-1470.3000000,2376.7000000,53.3000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (1)
  357. CreateDynamicObject(7191,-1470.4000000,2421.3000000,53.3000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (3)
  358. CreateDynamicObject(7191,-1470.3000000,2466.1001000,53.3000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (4)
  359. CreateDynamicObject(7191,-1492.8000000,2488.0000000,53.3000000,0.0000000,0.0000000,90.0000000); //object(vegasnnewfence2b) (5)
  360. CreateDynamicObject(7191,-1527.5996000,2488.0000000,53.3000000,0.0000000,0.0000000,90.0000000); //object(vegasnnewfence2b) (6)
  361. CreateDynamicObject(7191,-1549.9004000,2466.0000000,53.3000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (8)
  362. CreateDynamicObject(7191,-1549.8000000,2421.5000000,53.3000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (2)
  363. CreateDynamicObject(7191,-1549.9000000,2376.6001000,53.3000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (7)
  364. CreateDynamicObject(7191,-1549.9000000,2376.6001000,49.8000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (9)
  365. CreateDynamicObject(7191,-1549.9000000,2376.6001000,46.0000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (10)
  366. CreateDynamicObject(7191,-1549.9000000,2376.6001000,42.0000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (11)
  367. CreateDynamicObject(7191,-1549.8000000,2421.5000000,49.5000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (12)
  368. CreateDynamicObject(7191,-1549.8000000,2421.5000000,45.8000000,0.0000000,0.0000000,0.0000000); //object(vegasnnewfence2b) (13)
  369. CreateDynamicObject(7191,-1527.8000000,2350.1001000,53.3000000,0.0000000,0.0000000,90.0000000); //object(vegasnnewfence2b) (14)
  370. CreateDynamicObject(7191,-1527.8000000,2350.1001000,49.4000000,0.0000000,0.0000000,90.0000000); //object(vegasnnewfence2b) (15)
  371. CreateDynamicObject(7191,-1527.8000000,2350.1001000,46.2000000,0.0000000,0.0000000,90.0000000); //object(vegasnnewfence2b) (16)
  372. CreateDynamicObject(7191,-1492.9000000,2350.3000000,53.3000000,0.0000000,0.0000000,90.0000000); //object(vegasnnewfence2b) (17)
  373. CreateDynamicObject(7191,-1492.9000000,2350.3000000,49.8000000,0.0000000,0.0000000,90.0000000); //object(vegasnnewfence2b) (18)
  374. CreateDynamicObject(3279,-1545.2000000,2354.5000000,55.4000000,0.0000000,0.0000000,0.0000000); //object(a51_spottower) (1)
  375. CreateDynamicObject(3279,-1473.9000000,2354.8000000,55.4000000,0.0000000,0.0000000,180.0000000); //object(a51_spottower) (2)
  376.  
  377. return 1;
  378. }
  379.  
  380. public OnGameModeExit()
  381. {
  382. return 1;
  383. }
  384.  
  385. public OnPlayerRequestClass(playerid, classid)
  386. {
  387. SpawnPlayer(playerid);
  388. return 1;
  389. }
  390.  
  391. public OnPlayerConnect(playerid)
  392. {
  393. //Reseting Vars
  394. gIsNewHere { playerid } = false;
  395. gLoginAttempts[ playerid ] = 0;
  396. gAntiSpawnProtected{ playerid } = false;
  397. gHealth[playerid] = 0;
  398. gHealth[playerid] = 0;
  399. IsPMEnabled{ playerid } = 1;
  400. gIsLogged{ playerid } = 0;
  401. for(new E_PLAYER_DATA:e; e < E_PLAYER_DATA; ++e)
  402. pInfo[playerid][e] = 0;
  403. ///////////////////
  404. new query[128];
  405. GetPlayerName(playerid, Name[playerid], sizeof(Name));
  406. GetPlayerIp(playerid, IP[playerid], sizeof(IP));
  407. mysql_format(mysql, query, sizeof(query), "SELECT `Password`, `IP` FROM `players` WHERE `Username`='%e' LIMIT 1", Name[playerid]);
  408. mysql_tquery(mysql, query, "OnPlayerAccountCheck", "i", playerid);
  409. SetTimerEx("Anticheat", 1000, true, "u", playerid);
  410. CreateUsefulTextdraws(playerid);
  411. ShowServerIntroTextdraws(playerid);
  412. SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
  413. return 1;
  414. }
  415.  
  416. public OnPlayerDisconnect(playerid, reason)
  417. {
  418. SaveAccounts(playerid);
  419. if(IsBeingSpeced[playerid] == 1)
  420. {
  421. foreach(Player,i)
  422. {
  423. if(spectatorid[i] == playerid)
  424. {
  425. TogglePlayerSpectating(i,false);
  426. }
  427. }
  428. }
  429. return 1;
  430. }
  431.  
  432.  
  433. public OnPlayerSpawn(playerid)
  434. {
  435. if(IsSpecing[playerid] == 1)
  436. {
  437. SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// Remember earlier we stored the positions in these variables, now we're gonna get them from the variables.
  438. SetPlayerInterior(playerid,Inter[playerid]);//Setting the player's interior to when they typed '/spec'
  439. SetPlayerVirtualWorld(playerid,vWorld[playerid]);//Setting the player's virtual world to when they typed '/spec'
  440. IsSpecing[playerid] = 0;//Just saying you're free to use '/spec' again YAY :D
  441. IsBeingSpeced[spectatorid[playerid]] = 0;//Just saying that the player who was being spectated, is not free from your stalking >:D
  442. }
  443. gIsLogged{ playerid } = 1;
  444. HideServerIntroTextdraws(playerid);
  445. TextDrawShowForPlayer(playerid, randommsg);
  446. if( pInfo[playerid][Team] >= 1 )
  447. {
  448. switch( pInfo[playerid][Team] )
  449. {
  450. case 1:
  451. {
  452. SendClientMessage( playerid, COLOR_BLUE, "You have spawned as a cop. You have an anti-spawn protection for ten seconds!");
  453. GameTextForPlayer( playerid, "~b~Cops", 3000, 3 );
  454. new Random = random(sizeof(RandomArmySpawn));
  455. SetPlayerPos( playerid, RandomArmySpawn[Random][0], RandomArmySpawn[Random][1], RandomArmySpawn[Random][2]);
  456. SetPlayerFacingAngle( playerid, RandomArmySpawn[Random][3]);
  457. SkinSelectionPerTeam(playerid);
  458. SetPlayerColor(playerid, COLOR_BLUE);
  459. }
  460. case 2:
  461. {
  462. SendClientMessage( playerid, COLOR_RED, "You have spawned as a terrorist. You have an anti-spawn protection for ten seconds!");
  463. GameTextForPlayer( playerid, "~b~Terrorists", 3000, 3 );
  464. new Random = random(sizeof(RandomTerroristSpawn));
  465. SetPlayerPos( playerid, RandomTerroristSpawn[Random][0], RandomTerroristSpawn[Random][1], RandomTerroristSpawn[Random][2]);
  466. SetPlayerFacingAngle( playerid, RandomTerroristSpawn[Random][3]);
  467. SkinSelectionPerTeam(playerid);
  468. SetPlayerColor(playerid, COLOR_RED);
  469. }
  470. }
  471. }
  472. else if( pInfo[playerid][Team] <= 0)
  473. {
  474. ShowPlayerDialog(playerid, D_TEAM, DIALOG_STYLE_MSGBOX, "Team Selection", "Please choose your respective team.\nYou can always change your respective team with $10.", "Cops", "Terrorists");
  475. }
  476. SetTimerEx("AntiSpawnTimer", 10000, false, "u", playerid);
  477. SetPlayerHealthEx(playerid, 999999999);
  478. gAntiSpawnProtected{ playerid } = true;
  479. return 1;
  480. }
  481.  
  482. public OnPlayerDeath(playerid, killerid, reason)
  483. {
  484. gHealth[playerid] = 0;
  485. if(IsBeingSpeced[playerid] == 1)
  486. {
  487. foreach(Player,i)
  488. {
  489. if(spectatorid[i] == playerid)
  490. {
  491. TogglePlayerSpectating(i,false);
  492. }
  493. }
  494. }
  495. return 1;
  496. }
  497.  
  498. public OnVehicleSpawn(vehicleid)
  499. {
  500. return 1;
  501. }
  502.  
  503. public OnVehicleDeath(vehicleid, killerid)
  504. {
  505. return 1;
  506. }
  507.  
  508. public OnPlayerText(playerid, text[])
  509. {
  510. return 1;
  511. }
  512.  
  513. public OnPlayerCommandText(playerid, cmdtext[])
  514. {
  515. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  516. {
  517. // Do something here
  518. return 1;
  519. }
  520. return 0;
  521. }
  522.  
  523. //Commands
  524. //Level 7:
  525. CMD:setadmin(playerid, params[])
  526. {
  527. if(pInfo[playerid][Admin] >= 7)
  528. {
  529. new msg[180], target, level;
  530. if(!sscanf(params,"ui", target, level))
  531. {
  532. if(IsPlayerConnected(target))
  533. {
  534. if(level > 0)
  535. {
  536. format(msg, sizeof(msg), "Administrator %s promoted %s to admin level %d! Congratulations!", Name[playerid], Name[target], level);
  537. SendClientMessageToAll(COLOR_GREEN, msg);
  538. pInfo[playerid][Admin] = level;
  539. SendClientMessage(target, COLOR_GREEN, "* Use /ah for your new commands' list!");
  540. }
  541. else SendClientMessage(playerid, COLOR_RED, "Invalid Administrator Level Specified.");
  542. }
  543. else SendClientMessage(playerid, COLOR_RED, "Target unavailible.");
  544. }
  545. else SendClientMessage(playerid, COLOR_ORANGE, "SYNTAX: /setadmin [playerid] [level]"); SendClientMessage(playerid, COLOR_ORANGE, "Admin levels: 1 - Helper | 2 - Moderator | \
  546. 3 - Trial Admin | 4 - Basic Admin | 5 - General Admin | 6 - Lead Admin | 7 - Executive");
  547. }
  548. else SendClientMessage(playerid, COLOR_RED, "You are not authourized to use this command!");
  549. return 1;
  550. }
  551.  
  552. //Level 2:
  553. CMD:a(playerid, params[])
  554. {
  555. if(pInfo[playerid][Admin] >= 2)
  556. {
  557. new msg[128];
  558. if(!sscanf(params, "s[128]", msg))
  559. {
  560. format(msg, sizeof(msg), "[A] %s: %s", Name[playerid], msg);
  561. SendClientMessageToAdmins(COLOR_PINK, msg);
  562. }
  563. else SCM(playerid, COLOR_RED, "SYNTAX: /a [text]");
  564. }
  565. else SCM(playerid, COLOR_RED, "You are not authourized to use this command!");
  566. return 1;
  567. }
  568.  
  569. CMD:spec(playerid, params[])
  570. {
  571. new id;
  572. if(pInfo[playerid][Admin] <= 1)return SCM(playerid, COLOR_RED, "Invalid permissions!");
  573. if(sscanf(params,"u", id))return SendClientMessage(playerid, COLOR_RED, "Usage: /spec [id]");
  574. if(id == playerid)return SendClientMessage(playerid,COLOR_RED,"You cannot spec yourself.");
  575. if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_RED, "Player not found!");
  576. if(IsSpecing[playerid] == 1)return SendClientMessage(playerid,COLOR_RED,"You are already specing someone.");
  577. GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
  578. Inter[playerid] = GetPlayerInterior(playerid);
  579. vWorld[playerid] = GetPlayerVirtualWorld(playerid);
  580. TogglePlayerSpectating(playerid, true);
  581. if(IsPlayerInAnyVehicle(id))
  582. {
  583. if(GetPlayerInterior(id) > 0)
  584. {
  585. SetPlayerInterior(playerid,GetPlayerInterior(id));
  586. }
  587. if(GetPlayerVirtualWorld(id) > 0)
  588. {
  589. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  590. }
  591. PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));
  592. }
  593. else
  594. {
  595. if(GetPlayerInterior(id) > 0)
  596. {
  597. SetPlayerInterior(playerid,GetPlayerInterior(id));
  598. }
  599. if(GetPlayerVirtualWorld(id) > 0)
  600. {
  601. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  602. }
  603. PlayerSpectatePlayer(playerid,id);
  604. }
  605. new String[128];
  606. format(String, sizeof(String),"[SPEC]:You have started to spectate %s.",Name[id]);
  607. SendClientMessage(playerid,0x0080C0FF,String);
  608. IsSpecing[playerid] = 1;
  609. IsBeingSpeced[id] = 1;
  610. spectatorid[playerid] = id;
  611. return 1;
  612. }
  613.  
  614. CMD:specoff(playerid, params[])
  615. {
  616. if(pInfo[playerid][Admin] <= 1)return SCM(playerid, COLOR_RED, "Insufficient permissions!");
  617. if(IsSpecing[playerid] == 0)return SendClientMessage(playerid,COLOR_ORANGE,"You are not spectating anyone.");
  618. TogglePlayerSpectating(playerid, 0);
  619. return 1;
  620. }
  621.  
  622. //Level 1:
  623. CMD:respond(playerid, params[])
  624. {
  625. if(pInfo[playerid][Admin] == 1)
  626. {
  627. new id, text[64];
  628. if(!sscanf(params, "us[128]", id, text))
  629. {
  630. if(IsPlayerConnected(id))
  631. {
  632. new msg[128];
  633. format(msg, sizeof(msg), "[Admin %s]: %s", Name[playerid], text);
  634. SendClientMessage(id, COLOR_YELLOW, msg);
  635. SendClientMessage(playerid, COLOR_YELLOW, "Your reply has been sent.");
  636. }
  637. else SCM(playerid, COLOR_RED, "Invalid target specified.");
  638. }
  639. else SCM(playerid, COLOR_RED, "SYNTAX: /respond [id] [text]");
  640. }
  641. else SCM(playerid, COLOR_RED, "Insufficient permissions!");
  642. return 1;
  643. }
  644.  
  645. CMD:ah(playerid, params[])
  646. {
  647. new str[1024];
  648. if(pInfo[playerid][Admin] >= 1)
  649. {
  650. strcat(str, "/a - Admin Chat\n", sizeof(str));
  651. strcat(str, "/respond - Responds a player's question.\n", sizeof(str));
  652. }
  653. if(pInfo[playerid][Admin] >= 2)
  654. {
  655. strcat(str, "/spec(off) - Spectates a player.\n", sizeof(str));
  656. }
  657. if(pInfo[playerid][Admin] >= 3)
  658. {
  659. }
  660. if(pInfo[playerid][Admin] >= 4)
  661. {
  662. }
  663. if(pInfo[playerid][Admin] >= 5)
  664. {
  665. }
  666. if(pInfo[playerid][Admin] >= 6)
  667. {
  668. }
  669. if(pInfo[playerid][Admin] >= 7)
  670. {
  671. strcat(str, "/setadmin - \n", sizeof(str));
  672. }
  673. ShowPlayerDialog(playerid, D_ACMDLIST, DIALOG_STYLE_MSGBOX, "Admin commands:", str, "Done", "");
  674. return 1;
  675. }
  676.  
  677. //Players"
  678.  
  679. CMD:cmds(playerid, params[])
  680. {
  681. return cmd_help(playerid, params);
  682. }
  683.  
  684. CMD:help(playerid, params[])
  685. {
  686. SCM(playerid, -1, "[COMMANDS]: /help - /ask - /report - /pm - /togpm");
  687. return 1;
  688. }
  689.  
  690. CMD:ask(playerid, params[])
  691. {
  692. new text[64];
  693. if(!sscanf(params, "s[64]", text))
  694. {
  695. foreach(Player,i)
  696. {
  697. if(pInfo[playerid][Admin] >= 1)
  698. {
  699. new str[128];
  700. format(str, sizeof(str), "[ASK]: %s (%d): %s", Name[playerid], playerid, text);
  701. SendClientMessage(i, COLOR_LIGHTBLUE, str);
  702. SendClientMessage(i, COLOR_LIGHTBLUE, "[ASK]: Use /respond to respond to the player.");
  703. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You request has been send to online administrators.");
  704. }
  705. }
  706. }
  707. else SCM(playerid, COLOR_RED, "SYNTAX: /ask [text]");
  708. return 1;
  709. }
  710.  
  711. CMD:pm(playerid, params[])
  712. {
  713. new id, text[64];
  714. if(!sscanf(params, "us[64]", id, text))
  715. {
  716. if(IsPlayerConnected(id))
  717. {
  718. if(IsPMEnabled{ id } == 1)
  719. {
  720. new msg[128];
  721. format(msg, sizeof(msg), "[PM from %s (%d)]: %s", Name[playerid], playerid, text);
  722. SCM(id, COLOR_YELLOW, msg);
  723. format(msg, sizeof(msg), "[PM to %s (%d)]: %s", Name[id], id, text);
  724. SCM(playerid, COLOR_YELLOW, msg);
  725. }
  726. else SCM(playerid, COLOR_RED, "!- That player has his PM's disabled.");
  727. }
  728. else SCM(playerid, COLOR_RED, "!- Specified target is not connected.");
  729. }
  730. else SCM(playerid, COLOR_RED, "SYNTAX: /pm [id] [text]");
  731. return 1;
  732. }
  733.  
  734. CMD:togpm(playerid, params[])
  735. {
  736. if(IsPMEnabled{ playerid } == 0)
  737. {
  738. IsPMEnabled{playerid} = 1;
  739. SCM(playerid, COLOR_YELLOW, "!- PMs enabled. Use /togpm again to disable PMs.");
  740. }
  741. else if(IsPMEnabled{ playerid } == 1)
  742. {
  743. IsPMEnabled{playerid} = 0;
  744. SCM(playerid, COLOR_YELLOW, "!- PMs disabled. Use /togpm again to enable PMs.");
  745. }
  746. return 1;
  747. }
  748.  
  749. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  750. {
  751. foreach(Player,i)
  752. {
  753. if(GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) == 1 && GetPlayerTeamEx(i) == GetPlayerTeamEx(playerid))
  754. {
  755. SendClientMessage(playerid, COLOR_RED, "!- Stop car jacking your team-mate!");
  756. ClearAnimations(playerid);
  757. return 0;
  758. }
  759. }
  760. return 1;
  761. }
  762.  
  763. public OnPlayerExitVehicle(playerid, vehicleid)
  764. {
  765. return 1;
  766. }
  767.  
  768. public OnPlayerStateChange(playerid, newstate, oldstate)
  769. {
  770. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)// If the player's state changes to a vehicle state we'll have to spec the vehicle.
  771. {
  772. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, enters a vehicle, then let the spectator spectate the vehicle.
  773. {
  774. foreach(Player,i)
  775. {
  776. if(spectatorid[i] == playerid)
  777. {
  778. PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));// Letting the spectator, spectate the vehicle of the player being spectated (I hope you understand this xD)
  779. }
  780. }
  781. }
  782. }
  783. if(newstate == PLAYER_STATE_ONFOOT)
  784. {
  785. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, exists a vehicle, then let the spectator spectate the player.
  786. {
  787. foreach(Player,i)
  788. {
  789. if(spectatorid[i] == playerid)
  790. {
  791. PlayerSpectatePlayer(i, playerid);// Letting the spectator, spectate the player who exited the vehicle.
  792. }
  793. }
  794. }
  795. }
  796. return 1;
  797. }
  798.  
  799. public OnPlayerEnterCheckpoint(playerid)
  800. {
  801. return 1;
  802. }
  803.  
  804. public OnPlayerLeaveCheckpoint(playerid)
  805. {
  806. return 1;
  807. }
  808.  
  809. public OnPlayerEnterRaceCheckpoint(playerid)
  810. {
  811. return 1;
  812. }
  813.  
  814. public OnPlayerLeaveRaceCheckpoint(playerid)
  815. {
  816. return 1;
  817. }
  818.  
  819. public OnRconCommand(cmd[])
  820. {
  821. return 1;
  822. }
  823.  
  824. public OnPlayerRequestSpawn(playerid)
  825. {
  826. return 1;
  827. }
  828.  
  829. public OnObjectMoved(objectid)
  830. {
  831. return 1;
  832. }
  833.  
  834. public OnPlayerObjectMoved(playerid, objectid)
  835. {
  836. return 1;
  837. }
  838.  
  839. public OnPlayerPickUpPickup(playerid, pickupid)
  840. {
  841. return 1;
  842. }
  843.  
  844. public OnVehicleMod(playerid, vehicleid, componentid)
  845. {
  846. return 1;
  847. }
  848.  
  849. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  850. {
  851. return 1;
  852. }
  853.  
  854. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  855. {
  856. return 1;
  857. }
  858.  
  859. public OnPlayerSelectedMenuRow(playerid, row)
  860. {
  861. return 1;
  862. }
  863.  
  864. public OnPlayerExitedMenu(playerid)
  865. {
  866. return 1;
  867. }
  868.  
  869. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  870. {
  871. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, changes an interior, then update the interior and virtualword for the spectator.
  872. {
  873. foreach(Player,i)
  874. {
  875. if(spectatorid[i] == playerid)
  876. {
  877. SetPlayerInterior(i,GetPlayerInterior(playerid));
  878. SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
  879. }
  880. }
  881. }
  882. return 1;
  883. }
  884.  
  885. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  886. {
  887. return 1;
  888. }
  889.  
  890. public OnRconLoginAttempt(ip[], password[], success)
  891. {
  892. return 1;
  893. }
  894.  
  895. public OnPlayerUpdate(playerid)
  896. {
  897. return 1;
  898. }
  899.  
  900. public OnPlayerStreamIn(playerid, forplayerid)
  901. {
  902. return 1;
  903. }
  904.  
  905. public OnPlayerStreamOut(playerid, forplayerid)
  906. {
  907. return 1;
  908. }
  909.  
  910. public OnVehicleStreamIn(vehicleid, forplayerid)
  911. {
  912. return 1;
  913. }
  914.  
  915. public OnVehicleStreamOut(vehicleid, forplayerid)
  916. {
  917. return 1;
  918. }
  919.  
  920. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  921. {
  922. switch( dialogid )
  923. {
  924. case D_LOG:
  925. {
  926. if(!response) return Kick(playerid);
  927. new hpass[129], query[300];
  928. WP_Hash( hpass, 129, inputtext );
  929. if(!strcmp(hpass, pInfo[playerid][Password]))
  930. {
  931. mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
  932. mysql_tquery(mysql, query, "OnPlayerAccountLoad", "i", playerid);
  933. }
  934. else
  935. {
  936. gLoginAttempts[playerid] ++;
  937. ShowPlayerDialog(playerid, D_LOG, DIALOG_STYLE_PASSWORD, "Welcome back to CVT!", "ERROR: Incorrect password! \nPlease enter your password to login!", "Login", "Quit");
  938. }
  939. if(gLoginAttempts[playerid] >= 3)
  940. {
  941. SendClientMessage(playerid, COLOR_RED, "[ERROR]: You have reached the max login limit. You have been kicked.");
  942. KickEx(playerid);
  943. }
  944. }
  945. case D_REG:
  946. {
  947. if(!response) return Kick(playerid);
  948. if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, D_REG, DIALOG_STYLE_PASSWORD, "Welcome to CVT!", "{FF0000}Error: You have entered an invalid password.\n{FFFFFF}Your password must be at least 6 characters long!", "Register", "Quit");
  949. new query[300];
  950. WP_Hash(pInfo[playerid][Password], 129, inputtext);
  951. mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `Team`) VALUES ('%e', '%s', '%s', 0, 0, 0, 0)", Name[playerid], pInfo[playerid][Password], IP[playerid]);
  952. mysql_tquery(mysql, query, "OnPlayerAccountRegister", "i", playerid);
  953. ShowPlayerDialog(playerid, D_TEAM, DIALOG_STYLE_MSGBOX, "Team Selection", "Please choose your respective team, after this you will spawn. \nNOTE: You will not be able to change your team again, unless \nyou buy a 'Team Change' pass for $10.", \
  954. "Cops", "Terrorists");
  955. }
  956. case D_TEAM:
  957. {
  958. if(!response) //If choosen 'Terrorists'
  959. {
  960. pInfo[playerid][Team] = 2;
  961. SendClientMessage( playerid, COLOR_RED, "You have spawned as a terrorist. You have an anti-spawn protection for ten seconds!");
  962. GameTextForPlayer( playerid, "~b~Terrorists", 3000, 3 );
  963. new Random = random(sizeof(RandomTerroristSpawn));
  964. SetPlayerPos( playerid, RandomTerroristSpawn[Random][0], RandomTerroristSpawn[Random][1], RandomTerroristSpawn[Random][2]);
  965. SetPlayerFacingAngle( playerid, RandomTerroristSpawn[Random][3]);
  966. SetPlayerColor(playerid, COLOR_RED);
  967. }
  968. if(response) //If choosen 'Cops'
  969. {
  970. pInfo[playerid][Team] = 1;
  971. SendClientMessage( playerid, COLOR_BLUE, "You have spawned as a cop. You have an anti-spawn protection for ten seconds!");
  972. GameTextForPlayer( playerid, "~b~Cops", 3000, 3 );
  973. new Random = random(sizeof(RandomArmySpawn));
  974. SetPlayerPos( playerid, RandomArmySpawn[Random][0], RandomArmySpawn[Random][1], RandomArmySpawn[Random][2]);
  975. SetPlayerFacingAngle( playerid, RandomArmySpawn[Random][3]);
  976. SetPlayerColor(playerid, COLOR_BLUE);
  977. }
  978. SkinSelectionPerTeam(playerid);
  979. }
  980. }
  981.  
  982. return 1;
  983. }
  984.  
  985. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  986. {
  987. return 1;
  988. }
  989.  
  990. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  991. {
  992. if(issuerid != INVALID_PLAYER_ID)
  993. {
  994. if(GetPlayerTeamEx(playerid) == GetPlayerTeamEx(issuerid))
  995. {
  996. gHealth[playerid] -= amount;
  997. SendClientMessage(issuerid, COLOR_RED, "!- Stop teamkilling! You have been given the same damage recieved by the player!");
  998. return 0;
  999. }
  1000. }
  1001. gHealth[playerid] -= amount;
  1002. return 1;
  1003. }
  1004.  
  1005. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  1006. {
  1007. if(playerid != INVALID_PLAYER_ID)
  1008. {
  1009. if(gAntiSpawnProtected { damagedid } == true)
  1010. {
  1011. SendClientMessage(playerid, COLOR_RED, "[MSG]: The player you are trying to kill is on anti-spawn kill protection.");
  1012. return 0;
  1013. }
  1014. }
  1015. return 1;
  1016. }
  1017.  
  1018. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  1019. {
  1020. if(hittype == BULLET_HIT_TYPE_VEHICLE)
  1021. {
  1022. foreach(Player,i)
  1023. {
  1024. if(GetPlayerVehicleID(i) == hitid && GetPlayerVehicleSeat(i) == 1 && GetPlayerTeamEx(i) == GetPlayerTeamEx(playerid))
  1025. {
  1026. SendClientMessage(playerid, COLOR_RED, "!- Stop shooting your team-mate's vehicle!");
  1027. return 0;
  1028. }
  1029. }
  1030. }
  1031. return 1;
  1032. }
  1033.  
  1034. public OnPlayerCommandReceived(playerid, cmdtext[])
  1035. {
  1036. return 1;
  1037. }
  1038.  
  1039. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  1040. {
  1041. if(gIsLogged{ playerid } == 0)
  1042. {
  1043. SendClientMessage(playerid, COLOR_RED, "You are not logged in!");
  1044. return 0;
  1045. }
  1046. if(!success)
  1047. {
  1048. new msg[200];
  1049. format(msg, sizeof(msg), "!- The command [%s] was not found on our database. Try using /cmds.", cmdtext);
  1050. SendClientMessage(playerid, COLOR_RED, msg);
  1051. }
  1052. return 1;
  1053. }
  1054.  
  1055. /* Custom Functions */
  1056. public OnPlayerAccountCheck(playerid)
  1057. {
  1058. new rows, fields;
  1059. new dialogstring[300];
  1060. cache_get_data( rows, fields, mysql );
  1061. if( rows )
  1062. {
  1063. cache_get_field_content(0, "Password", pInfo[playerid][Password], mysql, 129);
  1064. pInfo[playerid][ID] = cache_get_field_content_int(0, "ID");
  1065. format( dialogstring, sizeof( dialogstring ), "Welcome back to "SERVER_NAME", {00FF00}%s!\nPlease enter your password below to login.", Name[playerid]);
  1066. ShowPlayerDialog(playerid, D_LOG, DIALOG_STYLE_PASSWORD, "Welcome back to CVT!", dialogstring, "Login", "Quit");
  1067. }
  1068. else
  1069. {
  1070. format( dialogstring, sizeof( dialogstring ), "Welcome to "SERVER_NAME", {00FF00}%s!\nPlease enter a password below to register.", Name[playerid]);
  1071. ShowPlayerDialog(playerid, D_REG, DIALOG_STYLE_PASSWORD, "Welcome to CVT!", dialogstring, "Register", "Quit");
  1072. }
  1073. return 1;
  1074. }
  1075.  
  1076. public OnPlayerAccountRegister(playerid)
  1077. {
  1078. pInfo[playerid][ID] = cache_insert_id();
  1079. gIsNewHere { playerid } = true;
  1080. SpawnPlayer(playerid);
  1081. return 1;
  1082. }
  1083.  
  1084. public OnPlayerAccountLoad(playerid)
  1085. {
  1086. pInfo[playerid][Admin] = cache_get_field_content_int(0, "Admin");
  1087. pInfo[playerid][VIP] = cache_get_field_content_int(0, "VIP");
  1088. pInfo[playerid][Money] = cache_get_field_content_int(0, "Money");
  1089. pInfo[playerid][Team] = cache_get_field_content_int(0, "Team");
  1090.  
  1091. GivePlayerMoney(playerid, pInfo[playerid][Money]);
  1092. SendClientMessage(playerid, -1, "Successfully logged in!");
  1093. return 1;
  1094. }
  1095.  
  1096. stock KickEx(playerid)
  1097. {
  1098. SetTimerEx("KickPlayer", 1000, false, "i", playerid);
  1099. return 1;
  1100. }
  1101.  
  1102. public KickPlayer(playerid)
  1103. {
  1104. Kick(playerid);
  1105. return 1;
  1106. }
  1107.  
  1108. public SaveAccountsPerMinute(playerid)
  1109. {
  1110. SaveAccounts(playerid);
  1111. return 1;
  1112. }
  1113.  
  1114. SaveAccounts(playerid)
  1115. {
  1116. new query[300];
  1117. mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Admin`='%d', `Money`='%d', `VIP`='%d', `Team`='%d' WHERE `ID`='%d'", \
  1118. pInfo[playerid][Admin],
  1119. pInfo[playerid][Money],
  1120. pInfo[playerid][VIP],
  1121. pInfo[playerid][Team],
  1122. pInfo[playerid][ID]);
  1123. mysql_tquery(mysql, query, "", "");
  1124. return 1;
  1125. }
  1126.  
  1127. stock SkinSelectionPerTeam(playerid)
  1128. {
  1129. if(pInfo[playerid][Team] == 1) //Is a cop
  1130. {
  1131. new SkinArray[9];
  1132. SkinArray[0] = 287;
  1133. SkinArray[1] = 280;
  1134. SkinArray[2] = 282;
  1135. SkinArray[3] = 285;
  1136. SkinArray[4] = 284;
  1137. SkinArray[5] = 267;
  1138. SkinArray[6] = 266;
  1139. SkinArray[7] = 265;
  1140. ShowModelSelectionMenuEx(playerid, SkinArray, 8, "Select Skin", CUSTOM_SKIN_ARMY_MENU, 16.0, 0.0, -55.0, 1, 0x464646FF, 0x88888899 , 0xFFFF00AA);
  1141. return 1;
  1142. }
  1143. else if(pInfo[playerid][Team] == 2) //Is a terrorist
  1144. {
  1145. new SkinArray[9];
  1146. SkinArray[0] = 254;
  1147. SkinArray[1] = 248;
  1148. SkinArray[2] = 241;
  1149. SkinArray[3] = 217;
  1150. SkinArray[4] = 179;
  1151. SkinArray[5] = 176;
  1152. ShowModelSelectionMenuEx(playerid, SkinArray, 6, "Select Skin", CUSTOM_SKIN_TERROR_MENU, 16.0, 0.0, -55.0, 1, 0x464646FF, 0x88888899 , 0xFFFF00AA);
  1153. return 1;
  1154. }
  1155. return 1;
  1156. }
  1157.  
  1158. public AntiSpawnTimer(playerid)
  1159. {
  1160. SetPlayerHealthEx(playerid, 80);
  1161. gAntiSpawnProtected{ playerid } = false;
  1162. SendClientMessage(playerid, COLOR_RED, "* Your anti spawn-kill protection has been ended.");
  1163. return 1;
  1164. }
  1165.  
  1166. public Anticheat(playerid)
  1167. {
  1168. if(GetPlayerHealthEx(playerid) != gHealth[playerid])
  1169. {
  1170. SetPlayerHealthEx(playerid, gHealth[playerid]);
  1171. }
  1172. if(GetPlayerArmourEx(playerid) != gArmour[playerid])
  1173. {
  1174. SetPlayerHealthEx(playerid, gArmour[playerid]);
  1175. }
  1176. return 1;
  1177. }
  1178.  
  1179. public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
  1180. {
  1181. if(extraid == CUSTOM_SKIN_ARMY_MENU || CUSTOM_SKIN_TERROR_MENU)
  1182. {
  1183. if(response)
  1184. {
  1185. SendClientMessage(playerid, COLOR_RED, "Skin selected. You are ready for the war!");
  1186. SetPlayerSkin(playerid, modelid);
  1187. GivePlayerWeapon(playerid, WEAPON_DEAGLE, 150);
  1188. GivePlayerWeapon(playerid, WEAPON_SHOTGUN, random(150));
  1189. GivePlayerWeapon(playerid, WEAPON_AK47, random(500));
  1190. GivePlayerWeapon(playerid, WEAPON_MP5, random(500));
  1191. GivePlayerWeapon(playerid, WEAPON_RIFLE, random(200));
  1192. SendClientMessage(playerid, COLOR_ORANGE, "-> You have recieved random amount of ammo for each of your weapons.");
  1193. }
  1194. else SkinSelectionPerTeam(playerid);
  1195. }
  1196. return 1;
  1197. }
  1198.  
  1199. CreateUsefulTextdraws(playerid)
  1200. {
  1201. //CVTIntro_TD
  1202. CVTIntro_TD[playerid][0] = CreatePlayerTextDraw(playerid, 675.000000, 460.666625, "box");
  1203. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][0], 0.000000, -31.437500);
  1204. PlayerTextDrawTextSize(playerid, CVTIntro_TD[playerid][0], -43.750000, 0.000000);
  1205. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][0], 1);
  1206. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][0], -1);
  1207. PlayerTextDrawUseBox(playerid, CVTIntro_TD[playerid][0], 1);
  1208. PlayerTextDrawBoxColor(playerid, CVTIntro_TD[playerid][0], 153);
  1209. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][0], 0);
  1210. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][0], 0);
  1211. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][0], 255);
  1212. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][0], 1);
  1213. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][0], 1);
  1214. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][0], 0);
  1215.  
  1216. CVTIntro_TD[playerid][1] = CreatePlayerTextDraw(playerid, 95.625000, 54.666683, "Cops_vs~n~________Terrorists");
  1217. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][1], 0.658125, 3.291667);
  1218. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][1], 1);
  1219. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][1], 255);
  1220. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][1], 0);
  1221. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][1], 0);
  1222. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][1], 255);
  1223. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][1], 3);
  1224. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][1], 1);
  1225. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][1], 0);
  1226.  
  1227. CVTIntro_TD[playerid][2] = CreatePlayerTextDraw(playerid, 281.250000, 155.000030, "A_TDM_project_brought_to_you_by~n~______________________________________");
  1228. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][2], 0.336249, 1.162499);
  1229. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][2], 1);
  1230. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][2], 1499027967);
  1231. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][2], 0);
  1232. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][2], 0);
  1233. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][2], 255);
  1234. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][2], 2);
  1235. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][2], 1);
  1236. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][2], 0);
  1237.  
  1238. CVTIntro_TD[playerid][3] = CreatePlayerTextDraw(playerid, 438.125000, 165.500000, "Kapersky");
  1239. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][3], 0.392499, 1.244166);
  1240. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][3], 1);
  1241. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][3], -2139094785);
  1242. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][3], 0);
  1243. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][3], 0);
  1244. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][3], 255);
  1245. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][3], 2);
  1246. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][3], 1);
  1247. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][3], 0);
  1248.  
  1249. CVTIntro_TD[playerid][4] = CreatePlayerTextDraw(playerid, 2.500000, 179.500076, "box");
  1250. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][4], 0.000000, 0.000000);
  1251. PlayerTextDrawTextSize(playerid, CVTIntro_TD[playerid][4], 648.750000, 0.000000);
  1252. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][4], 1);
  1253. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][4], -1);
  1254. PlayerTextDrawUseBox(playerid, CVTIntro_TD[playerid][4], 1);
  1255. PlayerTextDrawBoxColor(playerid, CVTIntro_TD[playerid][4], -2139062017);
  1256. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][4], 0);
  1257. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][4], 0);
  1258. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][4], 255);
  1259. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][4], 1);
  1260. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][4], 1);
  1261. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][4], 0);
  1262.  
  1263. CVTIntro_TD[playerid][5] = CreatePlayerTextDraw(playerid, 27.500000, 194.083419, "");
  1264. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][5], 0.000000, 0.000000);
  1265. PlayerTextDrawTextSize(playerid, CVTIntro_TD[playerid][5], 90.000000, 90.000000);
  1266. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][5], 1);
  1267. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][5], -1);
  1268. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][5], 0);
  1269. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][5], 0);
  1270. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][5], 1);
  1271. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][5], 5);
  1272. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][5], 1);
  1273. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][5], 0);
  1274. PlayerTextDrawSetPreviewModel(playerid, CVTIntro_TD[playerid][5], 348);
  1275. PlayerTextDrawSetPreviewRot(playerid, CVTIntro_TD[playerid][5], 0.000000, -45.000000, 1.100000, 1.500000);
  1276.  
  1277. CVTIntro_TD[playerid][6] = CreatePlayerTextDraw(playerid, 40.000000, 205.166702, "box");
  1278. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][6], 0.000000, 22.312500);
  1279. PlayerTextDrawTextSize(playerid, CVTIntro_TD[playerid][6], 296.250000, 0.000000);
  1280. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][6], 1);
  1281. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][6], -1);
  1282. PlayerTextDrawUseBox(playerid, CVTIntro_TD[playerid][6], 1);
  1283. PlayerTextDrawBoxColor(playerid, CVTIntro_TD[playerid][6], 96);
  1284. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][6], 0);
  1285. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][6], 0);
  1286. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][6], 255);
  1287. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][6], 1);
  1288. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][6], 1);
  1289. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][6], 0);
  1290.  
  1291. CVTIntro_TD[playerid][7] = CreatePlayerTextDraw(playerid, 99.375000, 112.999992, "'Where_the_battle_begins'");
  1292. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][7], 0.499374, 1.279167);
  1293. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][7], 1);
  1294. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][7], -2139062017);
  1295. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][7], 0);
  1296. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][7], 0);
  1297. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][7], 255);
  1298. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][7], 0);
  1299. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][7], 1);
  1300. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][7], 0);
  1301.  
  1302. CVTIntro_TD[playerid][8] = CreatePlayerTextDraw(playerid, 92.500000, 205.166717, "Cops vs Terrorist (also known as CvT) is a server based ~n~ over war. ~n~This server is based on the wars and battles between~n~to factions; \
  1303. Cops and Terrorist. Your duty is to serve ~n~your team the best and prevent~n~it to be exploited by your rivals. You \
  1304. must prove your~n~ abilities before you are handed over~n~the rank of Supreme. You may also find roleplay...");
  1305. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][8], 0.214999, 1.296666);
  1306. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][8], 1);
  1307. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][8], -1);
  1308. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][8], 0);
  1309. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][8], 0);
  1310. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][8], 255);
  1311. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][8], 1);
  1312. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][8], 1);
  1313. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][8], 0);
  1314.  
  1315. CVTIntro_TD[playerid][9] = CreatePlayerTextDraw(playerid, 92.500000, 368.499969, "________________________or_even_RP_events_going_on_here_'n~n~there._So_what_are_you_waiting_for?_Get_your_gear_up_and_~n~get_ready_for_the_ultimate_war!");
  1316. PlayerTextDrawLetterSize(playerid, CVTIntro_TD[playerid][9], 0.214999, 1.296666);
  1317. PlayerTextDrawAlignment(playerid, CVTIntro_TD[playerid][9], 1);
  1318. PlayerTextDrawColor(playerid, CVTIntro_TD[playerid][9], -1);
  1319. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][9], 0);
  1320. PlayerTextDrawSetOutline(playerid, CVTIntro_TD[playerid][9], 0);
  1321. PlayerTextDrawBackgroundColor(playerid, CVTIntro_TD[playerid][9], 255);
  1322. PlayerTextDrawFont(playerid, CVTIntro_TD[playerid][9], 1);
  1323. PlayerTextDrawSetProportional(playerid, CVTIntro_TD[playerid][9], 1);
  1324. PlayerTextDrawSetShadow(playerid, CVTIntro_TD[playerid][9], 0);
  1325. return 1;
  1326. }
  1327.  
  1328. ShowServerIntroTextdraws(playerid)
  1329. {
  1330. for(new i = 0; i < 10; i++)
  1331. {
  1332. PlayerTextDrawShow(playerid, CVTIntro_TD[playerid][i]);
  1333. }
  1334. return 1;
  1335. }
  1336.  
  1337. HideServerIntroTextdraws(playerid)
  1338. {
  1339. for(new i = 0; i < 10; i++)
  1340. {
  1341. PlayerTextDrawHide(playerid, CVTIntro_TD[playerid][i]);
  1342. }
  1343. return 1;
  1344. }
  1345.  
  1346. public RandomMessage()
  1347. {
  1348. TextDrawSetString(randommsg, RandomMessages[random(sizeof(RandomMessages))]); // We need this to make the timer working
  1349. return 1;
  1350. }
  1351.  
  1352. stock GetPlayerTeamEx(playerid)
  1353. {
  1354. return pInfo[playerid][Team];
  1355. }
  1356.  
  1357. stock SendClientMessageForTeam(team, color, message[])
  1358. {
  1359. foreach(Player,i)
  1360. {
  1361. if(GetPlayerTeamEx(i) == team)
  1362. {
  1363. SendClientMessage(i, COLOR_YELLOW, message);
  1364. }
  1365. }
  1366. return 1;
  1367. }
  1368.  
  1369. stock SetPlayerHealthEx(playerid, amount)
  1370. {
  1371. gHealth[playerid] = amount;
  1372. return 1;
  1373. }
  1374.  
  1375. stock GetPlayerHealthEx(playerid)
  1376. {
  1377. new Float:hp;
  1378. return GetPlayerHealth(playerid, hp);
  1379. }
  1380.  
  1381. stock SetPlayerArmourEx(playerid, amount)
  1382. {
  1383. gArmour[playerid] = amount;
  1384. return 1;
  1385. }
  1386.  
  1387. stock GetPlayerArmourEx(playerid)
  1388. {
  1389. new Float:armour;
  1390. return GetPlayerArmour(playerid, armour);
  1391. }
  1392.  
  1393. stock SendClientMessageToAdmins(color, message[])
  1394. {
  1395. foreach(Player,i)
  1396. {
  1397. if(pInfo[i][Admin] >= 2)
  1398. {
  1399. SendClientMessage(i, color, message);
  1400. }
  1401. }
  1402. return 1;
  1403. }
  1404.  
  1405. stock AdminRank(playerid)
  1406. {
  1407. new admin[40];
  1408. switch(pInfo[playerid][Admin])
  1409. {
  1410. case 1: format(admin,sizeof(admin),"Helper");
  1411. case 2: format(admin,sizeof(admin),"Moderator");
  1412. case 3: format(admin,sizeof(admin),"Trial Admin");
  1413. case 4: format(admin,sizeof(admin),"Basic Admin");
  1414. case 5: format(admin,sizeof(admin),"General Admin");
  1415. case 6: format(admin,sizeof(admin),"Lead Admin");
  1416. case 7: format(admin,sizeof(admin),"Executive Director");
  1417. }
  1418. return admin;
  1419. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement