Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.17 KB | None | 0 0
  1. /*
  2. Plugin: Amx Ejaculate
  3. Version: 0.1
  4. Author: KRoTaL
  5.  
  6. 0.1 Release
  7.  
  8.  
  9. Commands:
  10.  
  11. To ejaculate on a dead body you have to bind a key to: ejaculate
  12. Open your console and type: bind "key" "ejaculate"
  13. ex: bind "x" "ejaculate"
  14. Then stand still above a dead player (cs/cz only), press your key and you'll ejaculate on them !
  15. You can control the direction of the stream with your mouse.
  16.  
  17. Players can say "/ejaculate" in the chat to get some help.
  18.  
  19. Cvars:
  20.  
  21. amx_maxejaculations 6 - Maximum number of times a player is allowed to ejaculate per round.
  22.  
  23. amx_ejaculate_admin 0 - 0 : All the players are allowed to ejaculate
  24. 1 : Only admins with ADMIN_LEVEL_A flag are allowed to ejaculate
  25.  
  26. Setup:
  27.  
  28. You need to put these files on your server:
  29.  
  30. sound/ejaculate/ejaculate.wav
  31. addons/amx/lang/ejaculate.txt
  32.  
  33. */
  34.  
  35. // UNCOMMENT IF YOU USE ANOTHER MOD THAN CS and CS-CZ
  36. //#define NO_CS_CZ
  37.  
  38.  
  39.  
  40.  
  41. /***************************************************************************************************/
  42.  
  43. #include <amxmodx>
  44.  
  45. new count_ejaculate[33]
  46. new bool:EjaculateFlag[33]
  47. new bool:aim[33]
  48. new counter[33]
  49. #if !defined NO_CS_CZ
  50. new player_origins[33][3]
  51. #endif
  52.  
  53. public ejaculate_on_player(id)
  54. {
  55.  
  56. if (get_cvar_num("amx_maxejaculations")==0)
  57. return PLUGIN_HANDLED
  58. if (!is_user_alive(id))
  59. return PLUGIN_HANDLED
  60. if ( (get_cvar_num("amx_ejaculate_admin")==1) && !(get_user_flags(id) & ADMIN_LEVEL_A) )
  61. {
  62. console_print(id,"")
  63. return PLUGIN_HANDLED
  64. }
  65. if(EjaculateFlag[id])
  66. return PLUGIN_HANDLED
  67.  
  68. #if !defined NO_CS_CZ
  69. new player_origin[3], players[32], inum=0, dist, last_dist=99999, last_id
  70.  
  71. get_user_origin(id,player_origin,0)
  72. get_players(players,inum,"b")
  73. if (inum>0) {
  74. for (new i=0;i<inum;i++) {
  75. if (players[i]!=id) {
  76. dist = get_distance(player_origin,player_origins[players[i]])
  77. if (dist<last_dist) {
  78. last_id = players[i]
  79. last_dist = dist
  80. }
  81. }
  82. }
  83. if (last_dist<80) {
  84. #endif
  85. if (count_ejaculate[id] > get_cvar_num("amx_maxejaculations")) {
  86. client_print(id,print_chat,"", get_cvar_num("amx_maxejaculations"))
  87. return PLUGIN_CONTINUE
  88. }
  89. new player_name[32]
  90. get_user_name(id, player_name, 31)
  91. #if !defined NO_CS_CZ
  92. new dead_name[32]
  93. get_user_name(last_id, dead_name, 31)
  94. client_print(0,print_chat,"%s Esta eyaculando encima del cuerpo de %s", player_name, dead_name)
  95. #else
  96. client_print(0,print_chat,"%s Esta eyaculando!", player_name)
  97. #endif
  98. count_ejaculate[id]+=1
  99. new ids[1]
  100. ids[0]=id
  101. EjaculateFlag[id]=true
  102. aim[id]=false
  103. counter[id]=0
  104. emit_sound(id, CHAN_VOICE, "ejaculate/ejaculate.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  105. set_task(1.0,"make_ejaculate",4210+id,ids,1,"a",10)
  106. #if !defined NO_CS_CZ
  107. }
  108. else
  109. {
  110. client_print(id,print_chat,"Necesitas tener un cadaver serca para eyacular")
  111. return PLUGIN_HANDLED
  112. }
  113. }
  114. #endif
  115.  
  116. return PLUGIN_HANDLED
  117. }
  118.  
  119. public sqrt(num)
  120. {
  121. new div = num
  122. new result = 1
  123. while (div > result) {
  124. div = (div + result) / 2
  125. result = num / div
  126. }
  127. return div
  128. }
  129.  
  130. public make_ejaculate(ids[])
  131. {
  132. new id=ids[0]
  133. new vec[3]
  134. new aimvec[3]
  135. new velocityvec[3]
  136. new length
  137. get_user_origin(id,vec)
  138. get_user_origin(id,aimvec,3)
  139. new distance = get_distance(vec,aimvec)
  140. new speed = floatround(distance*1.9)
  141.  
  142. velocityvec[0]=aimvec[0]-vec[0]
  143. velocityvec[1]=aimvec[1]-vec[1]
  144. velocityvec[2]=aimvec[2]-vec[2]
  145.  
  146. length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2])
  147.  
  148. velocityvec[0]=velocityvec[0]*speed/length
  149. velocityvec[1]=velocityvec[1]*speed/length
  150. velocityvec[2]=velocityvec[2]*speed/length
  151.  
  152. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  153. write_byte(101)
  154. write_coord(vec[0])
  155. write_coord(vec[1])
  156. write_coord(vec[2])
  157. write_coord(velocityvec[0])
  158. write_coord(velocityvec[1])
  159. write_coord(velocityvec[2])
  160. write_byte(6) // color
  161. write_byte(160) // speed
  162. message_end()
  163.  
  164. counter[id]++
  165. if(counter[id]==10)
  166. EjaculateFlag[id]=false
  167. }
  168.  
  169. public death_event()
  170. {
  171. new victim = read_data(2)
  172. #if !defined NO_CS_CZ
  173. get_user_origin(victim,player_origins[victim],0)
  174. #endif
  175.  
  176. if(EjaculateFlag[victim])
  177. reset_ejaculate(victim)
  178.  
  179. return PLUGIN_CONTINUE
  180. }
  181.  
  182. public reset_ejaculate(id)
  183. {
  184. if(task_exists(4210+id))
  185. remove_task(4210+id)
  186. emit_sound(id,CHAN_VOICE,"ejaculate/ejaculate.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)
  187. EjaculateFlag[id]=false
  188.  
  189. return PLUGIN_CONTINUE
  190. }
  191.  
  192. public reset_hud(id)
  193. {
  194. if(task_exists(4210+id))
  195. remove_task(4210+id)
  196. emit_sound(id,CHAN_VOICE,"ejaculate/ejaculate.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)
  197. EjaculateFlag[id]=false
  198.  
  199. count_ejaculate[id]=1
  200.  
  201. return PLUGIN_CONTINUE
  202. }
  203.  
  204. public ejaculate_help(id)
  205. {
  206. client_print(id, print_chat, "Para eyacular escribe en consola bind ^"v^" ^"ejaculate^"")
  207.  
  208. return PLUGIN_CONTINUE
  209. }
  210.  
  211. public handle_say(id)
  212. {
  213. new said[192]
  214. read_args(said,192)
  215. remove_quotes(said)
  216.  
  217. if( ((containi(said, "ejaculate") != -1) && !(containi(said, "/ejaculate") != -1))
  218. || ((containi(said, "ejaculer") != -1) && !(containi(said, "/ejaculer") != -1)) )
  219. {
  220. client_print(id, print_chat, "")
  221. }
  222.  
  223. return PLUGIN_CONTINUE
  224. }
  225.  
  226. public plugin_precache()
  227. {
  228. if (file_exists("sound/ejaculate/ejaculate.wav"))
  229. precache_sound("ejaculate/ejaculate.wav")
  230.  
  231. return PLUGIN_CONTINUE
  232. }
  233.  
  234. public client_connect(id)
  235. {
  236. EjaculateFlag[id]=false
  237. count_ejaculate[id]=1
  238.  
  239. return PLUGIN_CONTINUE
  240. }
  241.  
  242. public client_disconnect(id)
  243. {
  244. reset_hud(id)
  245.  
  246. return PLUGIN_CONTINUE
  247. }
  248.  
  249. public plugin_init()
  250. {
  251. register_plugin("AMX Ejaculate","0.1","KRoTaL")
  252. register_clcmd("ejaculate","ejaculate_on_player",0,"- Ejaculate on a dead player")
  253. register_clcmd("ejaculer","ejaculate_on_player",0,"- Ejaculate on a dead player")
  254. register_clcmd("say /ejaculate","ejaculate_help",0,"- Displays Ejaculate help")
  255. register_clcmd("say /ejaculer","ejaculate_help",0,"- Displays Ejaculate help")
  256. register_clcmd("say","handle_say")
  257. register_cvar("amx_maxejaculations","3")
  258. register_cvar("amx_ejaculate_admin","0")
  259. register_event("DeathMsg","death_event","a")
  260. register_event("ResetHUD", "reset_hud", "be")
  261.  
  262. return PLUGIN_CONTINUE
  263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement