Guest User

Untitled

a guest
Aug 22nd, 2012
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.33 KB | None | 0 0
  1. #include <a_samp>
  2. #include <core>
  3. #include <utils>
  4. #include <float>
  5. #include <time>
  6. //--------boje-----//
  7. #define bela 0xFFFFFFC8
  8. #define groveboja 0x008000FF
  9. #define ballasboja 0xFF0000FF
  10.  
  11. static pTim[MAX_PLAYERS];
  12.  
  13. forward SetPlayerToTeamColor(playerid);
  14. forward SetupPlayerForClassSelection(playerid);
  15. forward SetPlayerToTeamFromClass(playerid, classid);
  16.  
  17. //===================================================/
  18. //===================================================/
  19. //===================================================/
  20.  
  21. public OnGameModInit() { //Kada palimo server
  22.  
  23. print(" ") ;
  24. print("============================================") ;
  25. print("Knock Out DeathMetch") ;
  26. print("============================================") ;
  27. print(" ");
  28.  
  29. //vozila sa groove------------------------------------------//
  30. AddStaticVehicleEx(545,2505.60009766,-1688.00000000,13.50000000,0.00000000,-1,-86,86);
  31. AddStaticVehicleEx(492,2482.30004883,-1690.90002441,13.39999962,0.00000000,-1,-86,86);
  32. AddStaticVehicleEx(492,2474.39990234,-1689.50000000,13.39999962,0.00000000,-1,-86,86);
  33. //--------------------------ballas-------------------------------------------------//
  34. AddStaticVehicleEx(566,2502.80004883,-1551.09997559,23.29999924,0.00000000,-1,149,149);
  35. AddStaticVehicleEx(566,2506.80004883,-1551.50000000,23.20000076,0.00000000,-1,149,149);
  36. AddStaticVehicleEx(507,2510.30004883,-1551.40002441,23.20000076,0.00000000,-1,149,149);
  37.  
  38. //---------------------------classovi----------------------------------------//
  39. AddPlayerClass(106,2495.4683,-1687.4482,13.5161,1.0023,22,100,0,0,0,0);
  40. AddPlayerClass(107,2486.7502,-1646.8213,14.0703,181.3389,22,100,0,0,0,0);
  41. AddPlayerClass(102,2000.0907,-1115.2217,27.1318,182.4643,22,100,0,0,0,0);
  42.  
  43. return 1;
  44. }
  45.  
  46. //===================================================/
  47. //===================================================/
  48. //===================================================/
  49.  
  50. public OnGameModExit() { //Kada gasimo server
  51.  
  52. print(" ") ;
  53. print("============================================") ;
  54. print("Gasenje Knock Out DeathMetch") ;
  55. print("============================================") ;
  56. print(" ");
  57. return 1;
  58. }
  59.  
  60.  
  61. //===================================================/
  62. //===================================================/
  63. //===================================================/
  64.  
  65. public OnPlayerCommandText(playerid, cmdtext[]) {
  66. //===================================================/
  67. if(strcmp(cmdtext,"/kill",true)==0) {
  68. new Float:posx, Float:posy, Float:posz; GetPlayerPos(playerid, posx, posy, posz);
  69. SetPlayerHealth(playerid, 0);
  70. SendClientMessage(playerid, bela, "Pocionio si samoubistvo !");
  71. PlayerPlaySound(playerid, 1149, posx, posy, posz);
  72. return 1;
  73. }
  74. //--------------
  75. return 1;
  76. }
  77.  
  78. //===================================================================
  79.  
  80. stock pName(playerid) {
  81. new aName[MAX_PLAYER_NAME];
  82. GetPlayerName(playerid, aName, sizeof(aName));
  83. return aName;
  84. }
  85.  
  86. //===================================================/
  87. //===================================================/
  88. //===================================================/
  89. public OnPlayerSpawn(playerid)
  90. {
  91. SetPlayerToTeamColor(playerid);
  92. return 1;
  93. }
  94. //===================================================/
  95. //===================================================/
  96. //===================================================/
  97. public OnPlayerText(playerid, text[])
  98. {
  99. new string[256];
  100. //-----------Slanje Poruke svim igracima-----------------------//
  101. format(string,sizeof(string),"%s: %s", pName(playerid), text); SendClientMessageToAll(bela, string);
  102. return 0;
  103. }
  104. //===================================================/
  105. //===================================================/
  106. //===================================================/
  107. public OnPlayerRequestSpawn(playerid);
  108. {
  109. return 1;
  110. }
  111. //===================================================/
  112. //===================================================/
  113. //===================================================/
  114. public OnPlayerRequestClass (playerid, classid) {
  115. SetupPlayerForClassSelection(playerid);
  116. SetPlayerToTeamFromClass(playerid, classid);
  117. if(classid == 0 || classid == 1) {
  118. GameTextForPlayer(playerid, "~g~Grove ~w~Tim", 2000, 6);
  119. }else if(classid == 2 || classid == 3) {
  120. GameTextForPlayer(playerid, "~r~Ballas ~w~Tim", 2000, 6);
  121. return 1;
  122. }
  123. //==========================================//
  124. public SetPlayerToTeamColor(playerid) {
  125. if(pTim[playerid] == 1) {
  126. SetPlayerColor(playerid, groveboja);
  127. if(pTim[playerid] == 2) {
  128. SetPlayerColor(playerid, ballasboja); }
  129. return 1;
  130. }
  131. //==========================================//
  132. public SetPlayerToTeamColor(playerid, classid) {
  133. if(classid == 0 || classid == 1) {
  134. pTim[playerid] = 1;
  135. }else if(classid == 2 || classid == 3) {
  136. pTim[playerid] = 2; }
  137. return 1;
  138. }
  139. //-====================================-//
  140. public SetupPlayerForClassSelection(playerid);
  141. SetPlayerPos(playerid,1602.8048,-995.9656,24.0781);
  142. SetPlayerCameraPos(playerid,1603.2174,-995.8314,24.0781);
  143. SetPlayerCameraLookAt(playerid,1602.8048,-995.9656,24.0781);
  144. SetPlayerFacingAngle(playerid,174.2892);
  145. return 1;
  146. }
Advertisement
Add Comment
Please, Sign In to add comment