Guest User

second filterscript

a guest
Jul 19th, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.15 KB | None | 0 0
  1. #if defined Sho_Credits
  2.  
  3. !---------------------------------------------------!
  4. !___________________________________________________!
  5. ! SSSS !
  6. ! SSSSS SS SS SSSS SSSS SS SS SS SS !
  7. ! SS SS SS SS SS SS SS SS SS SS SS SS !
  8. ! SS SS SS SS SS SS SS SS SS SS SS !
  9. ! SS SSSSSS SS SS SS SS SSSS SSSS !
  10. ! SSSSSS SS SS SS SS SS SS SS SS SS !
  11. ! SS SS SS SS SS SS SS SS SS SS !
  12. ! SS SS SS SS SS SS SS SS SS SS SS !
  13. ! SSSSS SS SS SSSS SSSS SSSSS SSSS !
  14. !___________________________________________________!
  15. ! !
  16. !---------------------------------------------------!
  17.  
  18.  
  19. <- ShoScripts™ ->
  20. ______________________
  21. | * Version - 1.2 |
  22. | * Author - ShOoBy |
  23. | * Lines - 184 |
  24. | * Time Spent - 4h |
  25. | * Mode - Snowballs |
  26. | * Variables - 5 |
  27. | * Objects - 20 |
  28. | * Script - Unique! |
  29. ========================
  30. #endif
  31.  
  32. #include <a_samp>
  33.  
  34. #define KEY_AIM (128)
  35.  
  36. new Snow_F[MAX_PLAYERS];
  37. new Obj[MAX_PLAYERS];
  38. new Shoot[MAX_PLAYERS];
  39. new Killer[MAX_PLAYERS];
  40. new Charged[MAX_PLAYERS];
  41.  
  42. #define FILTERSCRIPT
  43.  
  44. #if defined FILTERSCRIPT
  45.  
  46. public OnFilterScriptInit()
  47. {
  48. CreateObject(8172,-716.59997559,3800.50000000,8.50000000,0.00000000,0.00000000,90.00000000); //object(vgssairportland07) (1)
  49. CreateObject(3074,-782.29998779,3785.30004883,8.50000000,0.00000000,270.00000000,269.99948120); //object(d9_runway) (6)
  50. CreateObject(3074,-782.29998779,3798.89990234,8.50000000,0.00000000,270.00000000,269.99450684); //object(d9_runway) (7)
  51. CreateObject(3074,-782.29998779,3807.60009766,8.50000000,0.00000000,270.00000000,269.99450684); //object(d9_runway) (8)
  52. CreateObject(3074,-752.09997559,3807.60009766,8.50000000,0.00000000,270.00000000,269.99450684); //object(d9_runway) (9)
  53. CreateObject(3074,-722.00000000,3807.50000000,8.50000000,0.00000000,270.00000000,269.99450684); //object(d9_runway) (10)
  54. CreateObject(3074,-691.79998779,3807.50000000,8.50000000,0.00000000,270.00000000,269.99450684); //object(d9_runway) (11)
  55. CreateObject(3074,-661.59997559,3807.50000000,8.50000000,0.00000000,270.00000000,269.99450684); //object(d9_runway) (12)
  56. CreateObject(3074,-753.79998779,3795.19995117,8.60000038,0.00000000,270.00000000,269.99450684); //object(d9_runway) (14)
  57. CreateObject(3074,-723.59997559,3795.10009766,8.60000038,0.00000000,270.00000000,269.99450684); //object(d9_runway) (15)
  58. CreateObject(3074,-693.40002441,3794.89990234,8.60000038,0.00000000,270.00000000,269.99450684); //object(d9_runway) (16)
  59. CreateObject(3074,-664.09997559,3794.69995117,8.60000038,0.00000000,270.00000000,269.99450684); //object(d9_runway) (17)
  60. CreateObject(3074,-664.29998779,3781.69995117,8.69999981,0.00000000,270.00000000,269.99450684); //object(d9_runway) (18)
  61. CreateObject(3074,-694.50000000,3781.80004883,8.69999981,0.00000000,270.00000000,269.99450684); //object(d9_runway) (19)
  62. CreateObject(3074,-724.40002441,3781.89990234,8.69999981,0.00000000,270.00000000,269.99450684); //object(d9_runway) (20)
  63. CreateObject(3074,-754.40002441,3782.00000000,8.69999981,0.00000000,270.00000000,269.99450684); //object(d9_runway) (21)
  64. CreateObject(8172,-796.79998779,3800.50000000,-48.00000000,90.00000000,0.00000000,90.00000000); //object(vgssairportland07) (2)
  65. CreateObject(8172,-650.20001221,3800.50000000,-48.00000000,90.00000000,180.00000000,90.00000000); //object(vgssairportland07) (3)
  66. CreateObject(8172,-729.09997559,3780.69995117,12.80000019,0.00000000,270.00000000,270.00000000); //object(vgssairportland07) (4)
  67. CreateObject(8172,-726.20001221,3820.19995117,12.80000019,0.00000000,270.00000000,90.00000000); //object(vgssairportland07) (5)
  68. return 1;
  69. }
  70.  
  71. #else
  72.  
  73. main()
  74. {
  75. print("\n ShoScripts © 2006 - 2011 ");
  76. print(" SnowBalls Fight Minigame ");
  77. print(" by ShOoBy ™ \n");
  78. }
  79.  
  80. #endif
  81.  
  82. public OnPlayerConnect(playerid)
  83. {
  84. Snow_F[playerid] = 0;
  85. Killer[playerid] = 501;
  86. Charged[playerid] = 0;
  87. Shoot[playerid] = 0;
  88. return 1;
  89. }
  90.  
  91. public OnPlayerDeath(playerid, killerid, reason)
  92. {
  93. if(Snow_F[playerid] == 1) return Snow_F[playerid] = 0;
  94. return 1;
  95. }
  96.  
  97. public OnPlayerSpawn(playerid)
  98. {
  99. DestroyObject(Obj[playerid]);
  100. if(Killer[playerid] != 501) {
  101. Shoot[Killer[playerid]] = 0;
  102. Killer[playerid] = 501;
  103. }
  104. return 1;
  105. }
  106.  
  107. public OnPlayerCommandText(playerid, cmdtext[])
  108. {
  109. if (strcmp("/snow", cmdtext, true, 10) == 0)
  110. {
  111. if(Snow_F[playerid] == 0) {
  112. Snow_F[playerid] = 1;
  113. Charged[playerid] = 0;
  114. Shoot[playerid] = 0;
  115. SetPlayerPos(playerid,-708.40002441,3796.19995117,9.69999981);
  116. new res22[500], iName[128];
  117. GetPlayerName(playerid,iName,sizeof(iName));
  118. format(res22,sizeof(res22),"{0088FF}Hey {FF0000}%s{0088FF}!\nYou've just started playing {15FF00}SnowBall Fight{0088FF} minigame.\nIn this minigame , your goal is to hit as many players,\nas you can , without being hit by them.\nTo throw an snowball press : {FF7B0F}AIM Key\n{FFFF0F}Good Luck! ",iName);
  119. ShowPlayerDialog(playerid,9944,DIALOG_STYLE_MSGBOX,"{FF0000}SnowBalls {FFFF00}Fight",res22,"Ok","");
  120. }
  121. else if(Snow_F[playerid] == 1) {
  122. Snow_F[playerid] = 0;
  123. SpawnPlayer(playerid);
  124. }
  125. return 1;
  126. }
  127. return 0;
  128. }
  129.  
  130. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  131. {
  132. if(Snow_F[playerid] == 1) {
  133. if(Shoot[playerid] == 0) {
  134. if(newkeys & KEY_AIM) {
  135. if(Charged[playerid] == 1) return CheckSnow(playerid);
  136. else if(Charged[playerid] == 0) return ApplyAnimation( playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0 ), Charged[playerid] = 1;
  137. }
  138. }
  139. }
  140. return 1;
  141. }
  142.  
  143. forward CheckSnow(playerid);
  144. public CheckSnow(playerid)
  145. {
  146. Shoot[playerid] = 0;
  147. for(new i = 0; i < 30; i++) {
  148. new Float:X, Float:Y;
  149. GetXYInFrontOfPlayer(playerid,X,Y,i);
  150. for(new z = 0; z < MAX_PLAYERS; z++) {
  151. if(z != playerid && Shoot[playerid] == 0 && Killer[z] == 501) {
  152. if(IsPlayerInRangeOfPoint(z,1.0,X,Y,9.69999981)) {
  153. Shoot[playerid] = 1;
  154. new Float:pX,Float:pY,Float:pZ,Float:tX,Float:tY,Float:tZ;
  155. GetPlayerPos(playerid,pX,pY,pZ);
  156. GetPlayerPos(z,tX,tY,tZ);
  157. Obj[z] = CreateObject(2709,pX,pY,pZ+0.5,0.0,0.0,0.0,30);
  158. MoveObject(Obj[z],tX,tY,tZ-0.9,25.0);
  159. SetPlayerHealth(z,0);
  160. Killer[z] = playerid;
  161. GameTextForPlayer(playerid,"~R~Target ~y~Shoot~B~!~N~~G~+ 500 ~p~Cash",1000,3);
  162. GivePlayerMoney(playerid,500);
  163. Charged[playerid] = 0;
  164. ApplyAnimation(playerid,"GRENADE","WEAPON_throw",4.1,0,1,1,0,1000,1);
  165. }
  166. }
  167. }
  168. }
  169. if(Shoot[playerid] == 0) GameTextForPlayer(playerid,"~R~NO ~G~Targets~B~!",1000,1);
  170. return 1;
  171. }
  172.  
  173. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  174. {
  175. new Float:a;
  176. GetPlayerPos(playerid, x, y, a);
  177. GetPlayerFacingAngle(playerid, a);
  178. if (GetPlayerVehicleID(playerid))
  179. {
  180. GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  181. }
  182. x += (distance * floatsin(-a, degrees));
  183. y += (distance * floatcos(-a, degrees));
  184. }
Advertisement
Add Comment
Please, Sign In to add comment