Advertisement
Guest User

Untitled

a guest
Jun 11th, 2011
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.31 KB | None | 0 0
  1. //========================================================================================================//
  2. //========================================================================================================//
  3. //============================================ Grove Vs Vagos ============================================//
  4. //============================================ Gamemode ==================================================//
  5. //============================================ by WarF ===================================================//
  6. //========================================================================================================//
  7. //========================================================================================================//
  8. /*
  9.  
  10. ----------------- Version 0.1 ----------------- ----------------- ----------------- ----------------- ----------------- -----------------
  11. - 2 Teams ( Grove Street & Vagos )
  12. - Beide Teams besitzen eine eigene Base mit Fahrzeugen
  13. - Score/Punktezähler!
  14. - Server Textdraw unten Links!
  15. - Connect und Disconnect Nachrichten
  16. - Gangfight TIME --> Dauer 15 Minuten!
  17. - Waffenspawn beider Teams jeweils eine Deagle und M4
  18. - Bei KILL [ GANGZONEKILL] Funktion
  19. - Wetter System (verschiedenes Wetter in LS/SF/LV) mit Wechsel!
  20. - 1 nicht Offiziele Gangfight Zone! mit TeleportBefehl /gangfight
  21. Grove Spawn unv Vagos Gebiet Spawn ist Unterschiedlich!
  22. - GANGZONEKILLS sind überall machbar, nicht nur im Gebiet, das Gebiet dient dazu damit das ganze Schneller geht!
  23. - Die ersten Gang die 30 Kills erreicht gewinnt das Gangfight und der Server wird neu gestartet!
  24. ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------
  25.  
  26. In der Version 0.2 (bald)
  27. - Kills nur in der Zone machbar
  28. - Ammunations
  29. - Farzeuge nur durch eigene Member fahrbar
  30. - Leadersystem
  31. - Adminsystem
  32. - Login/Register System
  33. - CTF System!
  34. - Mehrere Gebiete zum einnehmen!
  35.  
  36.  
  37. ----------------- ----------------- ----------------- ----------------- ----------------- ----------------- -----------------*/
  38.  
  39. #include <a_samp>
  40.  
  41. // FARBEN DEFINIERUNG //
  42. #define COLOR_LIGHTGREEN 0x9ACD32AA
  43. #define COLOR_YELLOW 0xFFFF00AA
  44. #define GREEN 0x21DD00FF
  45. #define GROVE_COLOR 0x00D900C8
  46. #define VAGOS_COLOR 0xFFC801C8
  47. #define COLOR_GREEN 0x008000FF
  48.  
  49.  
  50. // TEAM / GANGS //
  51. static gTeam[MAX_PLAYERS];
  52. #define TEAM_GROVE 0
  53. #define TEAM_VAGOS 1
  54.  
  55. // VARIABLEN //
  56. new Grovescore;
  57. new Vagosscore;
  58.  
  59. // NEWS //
  60. new Text:Textdraw;
  61. new Text:scores;
  62. new DasWetter[3];
  63. new WetterRandomLS[] = { 1,2,3,15 };
  64. new WetterRandomSF[] = { 5,6,16 };
  65. new WetterRandomLV[] = { 1,2,3,4,5,18 };
  66.  
  67. // GAMEMODE ZEIT --> Restart! //
  68. #define MAX_GM_TIME 900000 // 15 Minuten
  69.  
  70.  
  71. // FORWARDS //
  72. forward PunkteUpdate();
  73. forward PunkteCheck(playerid);
  74. forward SetupPlayerForClassSelection(playerid);
  75. forward KillUpdate(playerid);
  76. forward GameTime();
  77. forward Finish();
  78. forward Wetter();
  79. forward SetWetter();
  80.  
  81.  
  82. // STOCKS //
  83. stock Grove(playerid)
  84. {
  85. SetPlayerColor(playerid,GROVE_COLOR);
  86. }
  87. stock Vagos(playerid)
  88. {
  89. SetPlayerColor(playerid,VAGOS_COLOR);
  90. }
  91.  
  92. stock strget(strx[], pos, search = ' ') {
  93. new arg, ret[128], idxx;
  94. for (new i = 0; i < strlen(strx); i++) {
  95. if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
  96. arg++;
  97. if (arg == pos + 1){
  98. ret[i-idxx] = EOS;
  99. return ret;
  100. } else if (arg == pos)
  101. idxx= i+1;
  102. }
  103. else if (arg == pos)
  104. ret[i - idxx] = strx[i];
  105. }
  106. return ret;
  107. }
  108.  
  109. //==========================================================================================================================================================
  110. //==========================================================================================================================================================
  111. //==========================================================================================================================================================
  112. //==========================================================================================================================================================
  113. //==========================================================================================================================================================
  114. //==========================================================================================================================================================
  115.  
  116.  
  117.  
  118.  
  119. public OnGameModeInit()
  120. {
  121. SetGameModeText("Grove Vs Vagos");
  122. AddPlayerClass(271,2495.4700,-1691.1353,14.7656,88.7245,24,999,31,1000,0,0); // Groveskin
  123. AddPlayerClass(108,2526.5800,-1033.9400,69.5800,255.1027,24,999,31,1000,0,0); // Vagosskin
  124.  
  125. // TIMER //
  126. SetTimer("Finish",600000,true);
  127. SetTimer("KillUpdate", 1000, true);
  128. SetTimer("PunkteUpdate", 1000, true);
  129. SetTimer("PunkteCheck", 1000, true);
  130. SetTimer("Wetter",900000, 1);
  131. SetTimer("SetWetter",1000, 1);
  132.  
  133. // SONSTIGES //
  134. ShowNameTags(1);
  135. SetWorldTime(0);
  136. UsePlayerPedAnims();
  137. ShowPlayerMarkers(0);
  138.  
  139. // TEXTDRAWS //
  140. Textdraw = TextDrawCreate(86.000000,427.000000,"Gangfight Version 0.1");
  141. TextDrawAlignment(Textdraw,2);
  142. TextDrawBackgroundColor(Textdraw,0x000000AA);
  143. TextDrawFont(Textdraw,2);
  144. TextDrawLetterSize(Textdraw,0.3000000,1.500000);
  145. TextDrawColor(Textdraw,0xffffffff);
  146. TextDrawSetOutline(Textdraw,1);
  147. TextDrawSetProportional(Textdraw,1);
  148. TextDrawSetShadow(Textdraw,1);
  149.  
  150.  
  151. // AUTOS //
  152. //-------------------------------------[Groove Autos]--------------------------------------------
  153. CreateVehicle(567,2499.7290,-1654.8717,13.3254,71.0974,86,86,600);
  154. CreateVehicle(521,2516.6213,-1662.9662,13.7545,90.7617,86,86,600);
  155. CreateVehicle(521,2516.5188,-1666.5355,13.7126,83.6155,86,86,600);
  156. CreateVehicle(521,2516.2712,-1672.2604,13.6695,63.1034,86,86,600);
  157. CreateVehicle(480,2508.1079,-1676.7578,13.3137,332.5577,86,86,600);
  158. CreateVehicle(560,2510.8142,-1686.6290,13.3836,46.0711,86,86,600);
  159. CreateVehicle(560,2490.7900,-1683.3960,13.2661,267.7853,86,86,600);
  160. CreateVehicle(560,2474.8696,-1691.6924,13.3387,358.5612,86,86,600);
  161. CreateVehicle(581,2528.3508,-1669.9441,14.7634,90.3716,86,86,600);
  162. CreateVehicle(581,2528.5940,-1669.9423,14.7675,90.3665,86,86,600);
  163. CreateVehicle(581,2528.4438,-1665.1663,14.7650,89.4413,86,86,600);
  164. CreateVehicle(581,2528.5955,-1667.4940,14.7663,91.0834,86,86,600);
  165.  
  166. //-------------------------------------[Vagos Autos]--------------------------------------------
  167. CreateVehicle(560,2530.3804,-1060.4600,69.2794,1.1289,6,6,600);
  168. CreateVehicle(560,2542.5305,-1033.3461,69.2811,179.9033,6,6,600);
  169. CreateVehicle(560,2551.0547,-1033.8213,69.2879,178.7793,6,6,600);
  170. CreateVehicle(480,2535.2632,-1035.0022,69.3542,178.9464,6,6,600);
  171. CreateVehicle(567,2543.4131,-1059.4493,69.4406,0.5185,6,6,600);
  172. CreateVehicle(461,2523.4219,-1036.8049,69.1395,181.9150,6,6,600);
  173. CreateVehicle(461,2521.9907,-1036.8163,69.1395,183.8141,6,6,600);
  174. CreateVehicle(461,2520.6208,-1036.8464,69.1593,183.9953,6,6,600);
  175. CreateVehicle(461,2519.1287,-1036.9431,69.1559,177.9429,6,6,600);
  176. CreateVehicle(461,2517.6431,-1036.8402,69.1237,175.1526,6,6,600);
  177. return 1;
  178. }
  179.  
  180.  
  181.  
  182.  
  183.  
  184. public OnPlayerRequestClass(playerid, classid)
  185. {
  186. SetupPlayerForClassSelection(playerid);
  187. switch (classid)
  188. {
  189. case 0:
  190. {
  191. GameTextForPlayer(playerid, "~g~Groves", 1200, 3);
  192. }
  193. case 1:
  194. {
  195. GameTextForPlayer(playerid, "~COLOR_YELLOW~Vagos", 1200, 3);
  196. }
  197. }
  198. return 1;
  199. }
  200.  
  201.  
  202.  
  203.  
  204. public OnPlayerConnect(playerid)
  205. {
  206. SendClientMessage(playerid, COLOR_YELLOW, "Bitte Warten...");
  207. new string[64];
  208. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  209. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  210. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  211. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  212. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  213. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  214. SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
  215. SendClientMessageToAll(0xFFFFFFAA,string);
  216. GameTextForPlayer(playerid,"~r~ Wilkommen waehle dein Team!",6000,5);
  217. if(IsPlayerConnected(playerid))
  218. {
  219. SendClientMessage(playerid, COLOR_LIGHTGREEN, "SERVER: Wilkommen auf dem Grove vs Vagos Server!");
  220. SendClientMessage(playerid, COLOR_LIGHTGREEN, "SERVER: Auf dem Server kannst du Fighten und durch Kills Punkte erzielen!");
  221. SendClientMessage(playerid, COLOR_LIGHTGREEN, "SERVER: Die erste Gang die 30 Punkte erzielt, gewinnt somit diese Runde!!");
  222. SendClientMessage(playerid, COLOR_LIGHTGREEN, "SERVER: Anschließend folgt ein kleiner Restart und es kann die nächste Runde beginnen!");
  223. SendClientMessage(playerid, COLOR_LIGHTGREEN, "SERVER: Wir wünschen dir viel Spaß!!");
  224. }
  225. return 1;
  226. }
  227.  
  228.  
  229.  
  230.  
  231.  
  232. public SetupPlayerForClassSelection(playerid)
  233. {
  234. SetPlayerInterior(playerid,11);
  235. SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
  236. SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
  237. SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
  238. SetPlayerFacingAngle(playerid,0.0);
  239. new string[64], pName[MAX_PLAYER_NAME];
  240. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  241. format(string,sizeof string,"%s hat den Server betreten!",pName);
  242. }
  243.  
  244.  
  245.  
  246.  
  247. public OnPlayerSpawn(playerid)
  248. {
  249. if(gTeam[playerid] == TEAM_GROVE)
  250. {
  251. GivePlayerWeapon(playerid,24,600);
  252. GivePlayerWeapon(playerid,31,999);
  253. SetPlayerTeam(playerid,0);
  254. Grove(playerid);
  255. SetPlayerInterior(playerid,0);
  256. TextDrawShowForPlayer(playerid, Textdraw);
  257. }
  258. else if(gTeam[playerid] == TEAM_VAGOS)
  259. {
  260. GivePlayerWeapon(playerid,24,600);
  261. GivePlayerWeapon(playerid,31,999);
  262. SetPlayerTeam(playerid,0);
  263. SetPlayerInterior(playerid,0);
  264. Vagos(playerid);
  265. TextDrawShowForPlayer(playerid, Textdraw);
  266. }
  267.  
  268. return 1;
  269. }
  270.  
  271.  
  272.  
  273.  
  274.  
  275. public OnPlayerDeath(playerid, killerid, reason)
  276. {
  277. if(killerid == TEAM_VAGOS)
  278. {
  279. GameTextForPlayer(playerid, "~g~GANGZONE~r~KILL", 5000, 5);
  280. Vagosscore += 1;
  281. }
  282.  
  283.  
  284. if(killerid == TEAM_GROVE)
  285. {
  286. GameTextForPlayer(playerid, "~g~GANGZONE~r~KILL", 5000, 5);
  287. Grovescore += 1;
  288. }
  289.  
  290. SendDeathMessage(killerid,playerid,reason);
  291. SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
  292. return 1;
  293. }
  294.  
  295.  
  296.  
  297.  
  298.  
  299. public OnPlayerCommandText(playerid, cmdtext[])
  300. {
  301. if(!strcmp(cmdtext, "/gangfight", true))
  302. {
  303. if(gTeam[playerid] == TEAM_GROVE)
  304. {
  305. SetPlayerPos(playerid, 2478.4541,-1370.8633,28.5406);
  306. }
  307.  
  308. if(gTeam[playerid] == TEAM_VAGOS)
  309. {
  310. SetPlayerPos(playerid, 2478.5095,-1351.6801,27.0582);
  311. }
  312. return 1;
  313. }
  314. return 0;
  315. }
  316.  
  317.  
  318.  
  319.  
  320. public PunkteUpdate()
  321. {
  322. new string[100];
  323. TextDrawHideForAll(Text:scores);
  324. format(string,sizeof(string),"~y~Vagos:%d ~w~--------~g~Grove:%d", Vagosscore,Grovescore);
  325. scores = TextDrawCreate(271.000000,400.000000,string);
  326. TextDrawTextSize(scores,200.000000,0.000000);
  327. TextDrawSetOutline(scores,1);
  328. TextDrawSetShadow(scores,1);
  329. TextDrawShowForAll(Text:scores);
  330. }
  331.  
  332.  
  333.  
  334.  
  335. public PunkteCheck(playerid)
  336. {
  337. if (Grovescore >= 30) {
  338. Grovescore = 0;
  339. Vagosscore = 0;
  340. GameTextForAll("~g~Grove haben Gewonnen",6000,5);
  341. SetPlayerHealth(playerid, 0);
  342. SetTimer("Finish",MAX_GM_TIME,true);
  343. }
  344.  
  345. if (Vagosscore >= 30) {
  346. Grovescore = 0;
  347. Vagosscore = 0;
  348. GameTextForAll("~y~Vagos haben Gewonnen",6000,5);
  349. SetPlayerHealth(playerid, 0);
  350. SetTimer("Finish",MAX_GM_TIME,true);
  351. }
  352. }
  353.  
  354.  
  355.  
  356. public Wetter()
  357. {
  358. DasWetter[0] = WetterRandomLS[random(sizeof(WetterRandomLS))];
  359. DasWetter[1] = WetterRandomSF[random(sizeof(WetterRandomSF))];
  360. DasWetter[2] = WetterRandomLV[random(sizeof(WetterRandomLV))];
  361. }
  362.  
  363. public SetWetter()
  364. {
  365. new Float:xx, Float:yy, Float:zz;
  366. for(new i=0; i< GetMaxPlayers(); i++)
  367. {
  368. if(IsPlayerConnected(i))
  369. {
  370. GetPlayerPos(i, xx, yy, zz);
  371. if((xx > -992.5172 && xx < 4000.0000) && (yy < 528.0000 && yy > -4000.0000)) //Los Santos
  372. {
  373. SetPlayerWeather(i, DasWetter[0]);
  374. }
  375. if((xx > -4000.0000 && xx< -992.5172) && (yy < 4000.0000 && yy > -4000.0000)) //San Fierro
  376. {
  377. SetPlayerWeather(i, DasWetter[1]);
  378. }
  379. if((xx > -992.5172 && xx< 4000.0000) && (yy < 4000.0000 && yy > 528.0000)) //Las Venturas
  380. {
  381. SetPlayerWeather(i, DasWetter[2]);
  382. }
  383. }
  384. }
  385. return 1;
  386. }
  387.  
  388.  
  389. public Finish()
  390. {
  391. SendRconCommand("gmx");
  392. return 1;
  393. }
  394.  
  395. #if defined FILTERSCRIPT
  396. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement