hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.07.04. 17:48



Jelenlévő felhasználók

Jelenleg 424 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 423 vendég

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása Hozzászólás a témához  [1 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Hokizás, Ürítés, Pisilés átírás
HozzászólásElküldve:2012.08.18. 23:42 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Üdv.!

Valaki átírná nekem ezeket a pluginokat úgy, hogy ne az ellenfél holttesténél kelljen végezni a dolgomat, hanem bárhol tudjak pisilni/hokizni/kakálni?
Köszi előre is!

Smak:
Kód:
  1. /*

  2.  

  3. Plugin: Amx Piss

  4. Version: 2.2

  5. Author: KRoTaL (Based on TakeADookie by PaintLancer)

  6.  

  7. Modified by commonbullet to work with amxx, untested.

  8.  

  9. 1.0  Release

  10. 1.1  Better effect

  11. 1.2  Bug fix

  12. 1.3  New effect + piss puddle

  13. 1.4a New effects, only for cs/cz/dod

  14. 1.4b New effects, only for other mods than cs/cz/dod

  15. 1.5  #define NO_CS_CZ added

  16. 1.6  Bug fix (DoD)

  17. 1.7  Bug fix

  18. 1.8  Some checks added

  19. 1.9  #define NO_CS_CZ changed into #define NO_CS_CZ

  20. 2.0  New cvar : amx_piss_effect

  21. 2.1  English & French language support

  22. 2.2  Removed knife model when pissing and added admin immunity

  23.  

  24. Commands:

  25.  

  26.   To piss on a dead body you have to bind a key to: piss

  27.   Open your console and write: bind "key" "piss"

  28.   ex: bind "x" "piss"

  29.   Then stand still above a dead player, press your key and you'll piss on them !

  30.   You can control the direction of the stream with your mouse.

  31.   You are not able to move or to shoot for 10 seconds when you piss, so beware.

  32.   The puddle of piss will appear where you are aiming at 2 seconds after you start pissing,

  33.   so try to aim at the dead body instead of the sky or a wall ;)

  34.  

  35.   Players can say "/piss" in the chat to get some help.

  36.  

  37. Cvars:

  38.  

  39.   amx_maxpees 6   - Maximum number of times a player is allowed to piss per round.

  40.  

  41.   amx_piss_admin 0    -   0 : All the players are allowed to piss

  42.                           1 : Only admins with ADMIN_LEVEL_A flag are allowed to piss

  43.  

  44.   amx_piss_effect 0   -   0 : yellow bloodsprite

  45.                           1 : yellow laserbeam

  46.  

  47. Setup:

  48.  

  49.   You need to put these files on your server:

  50.  

  51.   sound/piss/pissing.wav

  52.   models/piss/piss_puddle1.mdl

  53.   models/piss/piss_puddle2.mdl

  54.   models/piss/piss_puddle3.mdl

  55.   models/piss/piss_puddle4.mdl

  56.   models/piss/piss_puddle5.mdl

  57.   models/piss/piss.mdl

  58.   addons/amx/lang/piss.txt

  59.  

  60.   You need to enable Fun and Vexd Utilities Modules for cs/cs-cz.

  61.   You need to enable Vexd Utilities Module for the other mods.

  62.  

  63.   Use amx_piss_cs_cz.amx if you use CS or CS-CZ (player can't move).

  64.   Use amx_piss.amx if you use another mod (dod, tfc, ...), or if you play CS/CS-CZ

  65.   and you want to be able to piss without being stuck.

  66.  

  67.  

  68.  Credits:

  69.  

  70.   Rastin for his trousers fly sounds

  71.   SLayer KL for his piss puddle models

  72.  

  73. */

  74.  

  75. // UNCOMMENT IF YOU USE ANOTHER MOD THAN CS and CS-CZ,

  76. // OR IF YOU USE CS/CS-CZ AND YOU WANT TO BE ABLE TO PISS ANYWHERE ON THE MAP (NOT JUST NEAR DEAD PLAYERS)

  77. //#define NO_CS_CZ

  78.  

  79.  

  80.  

  81.  

  82. /***************************************************************************************************/

  83.  

  84. #include <amxmodx>

  85. #if !defined NO_CS_CZ

  86. #include <fun>

  87. #endif

  88. #include <Vexd_Utilities>

  89.  

  90.  

  91. new piss_model

  92. new piss_sprite

  93. new water_splash

  94. new count_piss[33]

  95. new count_puddle[33]

  96. new bool:PissFlag[33]

  97. new bool:aim[33]

  98. new Float:aim_origin[33][3]

  99. #if !defined NO_CS_CZ

  100. new player_origins[33][3]

  101. new mod_name[32]

  102. #endif

  103.  

  104. public piss_on_player(id)

  105. {

  106. if (get_cvar_num("amx_maxpees")==0)

  107.   return PLUGIN_HANDLED

  108. if (!is_user_alive(id))

  109.   return PLUGIN_HANDLED

  110. if ( (get_cvar_num("amx_piss_admin")==1) && !(get_user_flags(id) & ADMIN_LEVEL_A) )

  111. {

  112.   console_print(id, "[AMX] Nincs jogosultsagod ehhez a parancshoz.")

  113.   return PLUGIN_HANDLED

  114. }

  115. if(PissFlag[id])

  116.   return PLUGIN_HANDLED

  117.  

  118. #if !defined NO_CS_CZ

  119. new player_origin[3], players[32], player, inum=0, dist, last_dist=99999, last_id

  120.  

  121. get_user_origin(id,player_origin,0)

  122. get_players(players,inum,"b")

  123. if (inum>0) {

  124.   for (new i=0;i<inum;i++) {

  125.     player = players[i]

  126.     if (player!=id) {

  127.       dist = get_distance(player_origin,player_origins[player])

  128.       if (dist<last_dist) {

  129.         last_id = player

  130.         last_dist = dist

  131.       }

  132.     }

  133.   }

  134.   if (last_dist<80) {

  135. #endif

  136.     if (count_piss[id] > get_cvar_num("amx_maxpees")) {

  137.       client_print(id,print_chat, "You can only piss on a player %d time(s) in a round !", get_cvar_num("amx_maxpees"))

  138.       return PLUGIN_CONTINUE

  139.     }

  140.     new player_name[32]

  141.     get_user_name(id, player_name, 31)

  142. #if !defined NO_CS_CZ

  143.     if(get_user_flags(last_id) & ADMIN_IMMUNITY)

  144.     {

  145.       client_print(id,print_chat, "Ot nem lehet lepisilni !")

  146.       return PLUGIN_HANDLED

  147.     }

  148.     new dead_name[32]

  149.     get_user_name(last_id, dead_name, 31)

  150.     client_print(0,print_chat, "%s lepisilte %s -t !! HaHaHaHa !!", player_name, dead_name)

  151. #else

  152.     client_print(0,print_chat, "%s pisil !!" , player_name)

  153. #endif

  154.     count_piss[id]+=1

  155.     count_puddle[id]=1

  156.     new ids[1]

  157.     ids[0]=id

  158.     PissFlag[id]=true

  159.     aim[id]=false

  160. #if !defined NO_CS_CZ

  161.     if( (equali(mod_name,"cstrike")) || (equali(mod_name,"czero")) )

  162.     {

  163.       client_cmd(id, "weapon_knife")

  164.       entity_set_string(id, EV_SZ_viewmodel, "")

  165.       entity_set_string(id, EV_SZ_weaponmodel, "")

  166.       set_user_maxspeed(id, -1.0)

  167.     }

  168. #endif

  169.     emit_sound(id,CHAN_VOICE,"piss/pissing.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

  170.     switch(get_cvar_num("amx_piss_effect"))

  171.     {

  172.       case 0:  set_task(0.2,"make_pee",1481+id,ids,1,"a",48)

  173.       case 1:  set_task(0.1,"make_pee",1481+id,ids,1,"a",102)

  174.       default: set_task(0.2,"make_pee",1481+id,ids,1,"a",48)

  175.     }

  176.     set_task(2.2,"place_puddle",3424+id,ids,1,"a",4)

  177. #if !defined NO_CS_CZ

  178.     set_task(12.0,"weapons_back",6794+id,ids,1)

  179.   }

  180.   else

  181.   {

  182.     client_print(id,print_chat, "There are no dead bodies around you.")

  183.     return PLUGIN_HANDLED

  184.   }

  185. }

  186. #endif

  187. return PLUGIN_HANDLED

  188. }

  189.  

  190. public sqrt(num)

  191. {

  192.   new div = num

  193.   new result = 1

  194.   while (div > result) {

  195.     div = (div + result) / 2

  196.     result = num / div

  197.   }

  198.   return div

  199. }

  200.  

  201. public make_pee(ids[])

  202. {

  203.   new id=ids[0]

  204.   new vec[3]

  205.   new aimvec[3]

  206.   new velocityvec[3]

  207.   new length

  208.   get_user_origin(id,vec)

  209.   get_user_origin(id,aimvec,3)

  210.   new distance = get_distance(vec,aimvec)

  211.   new speed = floatround(distance*1.9)

  212.  

  213.   velocityvec[0]=aimvec[0]-vec[0]

  214.   velocityvec[1]=aimvec[1]-vec[1]

  215.   velocityvec[2]=aimvec[2]-vec[2]

  216.  

  217.   length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2])

  218.  

  219.   velocityvec[0]=velocityvec[0]*speed/length

  220.   velocityvec[1]=velocityvec[1]*speed/length

  221.   velocityvec[2]=velocityvec[2]*speed/length

  222.  

  223.   switch(get_cvar_num("amx_piss_effect"))

  224.   {

  225.     case 0:

  226.     {

  227.       message_begin(MSG_BROADCAST,SVC_TEMPENTITY)

  228.       write_byte(101)

  229.       write_coord(vec[0])

  230.       write_coord(vec[1])

  231.       write_coord(vec[2])

  232.       write_coord(velocityvec[0])

  233.       write_coord(velocityvec[1])

  234.       write_coord(velocityvec[2])

  235.       write_byte(102) // color

  236.       write_byte(160) // speed

  237.       message_end()

  238.     }

  239.     case 1:

  240.     {

  241.       message_begin(MSG_BROADCAST,SVC_TEMPENTITY)

  242.       write_byte(106)

  243.       write_coord(vec[0])

  244.       write_coord(vec[1])

  245.       write_coord(vec[2])

  246.       write_coord(velocityvec[0])

  247.       write_coord(velocityvec[1])

  248.       write_coord(velocityvec[2]+100)

  249.       write_angle (0)

  250.       write_short (piss_model)

  251.       write_byte (0)

  252.       write_byte (255)

  253.       message_end()

  254.  

  255.       message_begin(MSG_BROADCAST,SVC_TEMPENTITY)

  256.       write_byte (1)

  257.       write_short (id)

  258.       write_coord(aimvec[0])

  259.       write_coord(aimvec[1])

  260.       write_coord(aimvec[2])

  261.       write_short(piss_sprite)

  262.       write_byte( 1 ) // framestart

  263.       write_byte( 6 ) // framerate

  264.       write_byte( 1 ) // life

  265.       write_byte( 8 ) // width

  266.       write_byte( 0 ) // noise

  267.       write_byte( 255 ) // r, g, b

  268.       write_byte( 255 ) // r, g, b

  269.       write_byte( 0 ) // r, g, b

  270.       write_byte( 200 ) // brightness

  271.       write_byte( 10 ) // speed

  272.       message_end()

  273.  

  274.       message_begin( MSG_BROADCAST,SVC_TEMPENTITY)

  275.       write_byte(17)

  276.       write_coord(aimvec[0])

  277.       write_coord(aimvec[1])

  278.       write_coord(aimvec[2])

  279.       write_short(water_splash)

  280.       write_byte(16)

  281.       write_byte(18)

  282.       message_end()

  283.  

  284.     }

  285.     default:

  286.     {

  287.       message_begin(MSG_BROADCAST,SVC_TEMPENTITY)

  288.       write_byte(101)

  289.       write_coord(vec[0])

  290.       write_coord(vec[1])

  291.       write_coord(vec[2])

  292.       write_coord(velocityvec[0])

  293.       write_coord(velocityvec[1])

  294.       write_coord(velocityvec[2])

  295.       write_byte(102) // color

  296.       write_byte(160) // speed

  297.       message_end()

  298.     }

  299.   }

  300. }

  301.  

  302. public place_puddle(ids[])

  303. {

  304.   new id=ids[0]

  305.   if(!aim[id])

  306.   {

  307.     new origin[3]

  308.     get_user_origin(id,origin,3)

  309.     aim_origin[id][0]=float(origin[0])

  310.     aim_origin[id][1]=float(origin[1])

  311.     aim_origin[id][2]=float(origin[2])

  312.   }

  313.  

  314.   new puddle_entity

  315.   puddle_entity = CreateEntity("info_target")

  316.  

  317.   if(puddle_entity == 0) {

  318.     return PLUGIN_HANDLED_MAIN

  319.   }

  320.  

  321.   new Float:MinBox[3]

  322.   new Float:MaxBox[3]

  323.  

  324.   MinBox[0] = -1.0

  325.   MinBox[1] = -1.0

  326.   MinBox[2] = -1.0

  327.   MaxBox[0] = 1.0

  328.   MaxBox[1] = 1.0

  329.   MaxBox[2] = 1.0

  330.  

  331.   Entvars_Set_Vector(puddle_entity, EV_VEC_mins, MinBox)

  332.   Entvars_Set_Vector(puddle_entity, EV_VEC_maxs, MaxBox)

  333.  

  334.   switch(count_puddle[id])

  335.   {

  336.     case 1:

  337.     {

  338.       Entvars_Set_String(puddle_entity, EV_SZ_classname, "piss_puddle1")

  339.       ENT_SetModel(puddle_entity, "models/piss/piss_puddle1.mdl")

  340.     }

  341.     case 2:

  342.     {

  343.       Entvars_Set_String(puddle_entity, EV_SZ_classname, "piss_puddle2")

  344.       ENT_SetModel(puddle_entity, "models/piss/piss_puddle2.mdl")

  345.     }

  346.     case 3:

  347.     {

  348.       Entvars_Set_String(puddle_entity, EV_SZ_classname, "piss_puddle3")

  349.       ENT_SetModel(puddle_entity, "models/piss/piss_puddle3.mdl")

  350.     }

  351.     case 4:

  352.     {

  353.       Entvars_Set_String(puddle_entity, EV_SZ_classname, "piss_puddle4")

  354.       ENT_SetModel(puddle_entity, "models/piss/piss_puddle4.mdl")

  355.     }

  356.     case 5:

  357.     {

  358.       Entvars_Set_String(puddle_entity, EV_SZ_classname, "piss_puddle5")

  359.       ENT_SetModel(puddle_entity, "models/piss/piss_puddle5.mdl")

  360.       #if defined NO_CS_CZ

  361.         PissFlag[id]=false

  362.       #endif

  363.     }

  364.     default: {}

  365.   }

  366.  

  367.   ENT_SetOrigin(puddle_entity, aim_origin[id])

  368.   Entvars_Set_Int(puddle_entity, EV_INT_solid, 3)

  369.   Entvars_Set_Int(puddle_entity, EV_INT_movetype, 6)

  370.   Entvars_Set_Edict(puddle_entity, EV_ENT_owner, id)

  371.  

  372.   count_puddle[id]+=1

  373.   aim[id]=true

  374.  

  375.   return PLUGIN_CONTINUE

  376. }

  377.  

  378. public death_event()

  379. {

  380.   new victim = read_data(2)

  381.   #if !defined NO_CS_CZ

  382.   get_user_origin(victim,player_origins[victim],0)

  383.   #endif

  384.  

  385.   if(PissFlag[victim])

  386.     reset_piss(victim)

  387.  

  388.   return PLUGIN_CONTINUE

  389. }

  390.  

  391. #if !defined NO_CS_CZ

  392. public weapons_back(ids[])

  393. {

  394.   PissFlag[ids[0]]=false

  395.   if( (equali(mod_name,"cstrike")) || (equali(mod_name,"czero")) )

  396.   {

  397.     set_user_maxspeed(ids[0], 250.0)

  398.     client_cmd(ids[0], "weapon_knife")

  399.   }

  400. }

  401.  

  402. public cur_weapon(id)

  403. {

  404.   if(PissFlag[id])

  405.   {

  406.     if( (equali(mod_name,"cstrike")) || (equali(mod_name,"czero")) )

  407.     {

  408.       client_cmd(id, "weapon_knife")

  409.       set_user_maxspeed(id, -1.0)

  410.       entity_set_string(id, EV_SZ_viewmodel, "")

  411.       entity_set_string(id, EV_SZ_weaponmodel, "")

  412.     }

  413.   }

  414.  

  415.   return PLUGIN_CONTINUE

  416. }

  417. #endif

  418.  

  419. public reset_piss(id)

  420. {

  421.   if(task_exists(1481+id))

  422.     remove_task(1481+id)

  423.   if(task_exists(3424+id))

  424.     remove_task(3424+id)

  425.   #if !defined NO_CS_CZ

  426.   if(task_exists(6794+id))

  427.     remove_task(6794+id)

  428.   #endif

  429.   emit_sound(id,CHAN_VOICE,"piss/pissing.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)

  430.   PissFlag[id]=false

  431.  

  432.   return PLUGIN_CONTINUE

  433. }

  434.  

  435. public reset_hud(id)

  436. {

  437.   if(task_exists(1481+id))

  438.     remove_task(1481+id)

  439.   if(task_exists(3424+id))

  440.     remove_task(3424+id)

  441.   #if !defined NO_CS_CZ

  442.   if(task_exists(6794+id))

  443.     remove_task(6794+id)

  444.   #endif

  445.   emit_sound(id,CHAN_VOICE,"piss/pissing.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)

  446.   PissFlag[id]=false

  447.  

  448.   new iCurrent

  449.  

  450.   for (new i=1 ; i<count_piss[id] ; i++)

  451.   {

  452.     iCurrent = FindEntity(-1, "piss_puddle1")

  453.     if(iCurrent > 0)

  454.       RemoveEntity(iCurrent)

  455.     iCurrent = FindEntity(-1, "piss_puddle2")

  456.     if(iCurrent > 0)

  457.       RemoveEntity(iCurrent)

  458.     iCurrent = FindEntity(-1, "piss_puddle3")

  459.     if(iCurrent > 0)

  460.       RemoveEntity(iCurrent)

  461.     iCurrent = FindEntity(-1, "piss_puddle4")

  462.     if(iCurrent > 0)

  463.       RemoveEntity(iCurrent)

  464.     iCurrent = FindEntity(-1, "piss_puddle5")

  465.     if(iCurrent > 0)

  466.       RemoveEntity(iCurrent)

  467.   }

  468.   count_piss[id]=1

  469.  

  470.   return PLUGIN_CONTINUE

  471. }

  472.  

  473. public piss_help(id)

  474. {

  475.   client_print(id, print_chat, "To piss on a dead body you have to bind a key to: piss")

  476.   client_print(id, print_chat, "Open your console and write: bind ^"key^" ^"piss^"")

  477.   client_print(id, print_chat, "ex: bind ^"x^" ^"piss^"")

  478.  

  479.   return PLUGIN_CONTINUE

  480. }

  481.  

  482. public handle_say(id)

  483. {

  484.   new said[192]

  485.   read_args(said,192)

  486.   remove_quotes(said)

  487.  

  488.   if( (containi(said, "piss") != -1) && !(containi(said, "/piss") != -1) ) {

  489.     client_print(id, print_chat, "[AMX] For Piss help say /piss")

  490.   }

  491.  

  492.   return PLUGIN_CONTINUE

  493. }

  494.  

  495. public plugin_precache()

  496. {

  497.   if (file_exists("sound/piss/pissing.wav"))

  498.     precache_sound("piss/pissing.wav")

  499.   if (file_exists("models/piss/piss_puddle1.mdl"))

  500.     precache_model("models/piss/piss_puddle1.mdl")

  501.   if (file_exists("models/piss/piss_puddle2.mdl"))

  502.     precache_model("models/piss/piss_puddle2.mdl")

  503.   if (file_exists("models/piss/piss_puddle3.mdl"))

  504.     precache_model("models/piss/piss_puddle3.mdl")

  505.   if (file_exists("models/piss/piss_puddle4.mdl"))

  506.     precache_model("models/piss/piss_puddle4.mdl")

  507.   if (file_exists("models/piss/piss_puddle5.mdl"))

  508.     precache_model("models/piss/piss_puddle5.mdl")

  509.   if (file_exists("models/piss/piss.mdl"))

  510.     piss_model = precache_model("models/piss/piss.mdl")

  511.   piss_sprite = precache_model("sprites/plasma.spr")

  512.   water_splash = precache_model("sprites/wsplash3.spr")

  513. }

  514.  

  515. public client_connect(id)

  516. {

  517.   PissFlag[id]=false

  518.   count_piss[id]=1

  519. }

  520.  

  521. public client_disconnect(id)

  522. {

  523.   reset_hud(id)

  524. }

  525.  

  526. public plugin_init()

  527. {

  528.   register_plugin("AMX Piss","2.2","KRoTaL")

  529.   register_clcmd("piss","piss_on_player",0,"- Piss on a dead player")

  530.   register_clcmd("say /piss","piss_help",0,"- Displays piss help")

  531.   register_clcmd("say","handle_say")

  532.   register_cvar("amx_maxpees","6")

  533.   register_cvar("amx_piss_admin","0")

  534.   register_cvar("amx_piss_effect","0")

  535.   register_event("DeathMsg","death_event","a")

  536.   register_event("ResetHUD", "reset_hud", "be")

  537.   #if !defined NO_CS_CZ

  538.   register_event("CurWeapon","cur_weapon","be","1=1")

  539.   get_modname(mod_name,31)

  540.   #endif

  541. }


Kód:
  1.  

  2. #include <amxmodx>

  3.  

  4. new count_ejaculate[33]

  5. new bool:EjaculateFlag[33]

  6. new bool:aim[33]

  7. new counter[33]

  8. #if !defined NO_CS_CZ

  9. new player_origins[33][3]

  10. #endif

  11.  

  12. public ejaculate_on_player(id)

  13. {

  14.  

  15. if (get_cvar_num("amx_maxejaculations")==0)

  16.         return PLUGIN_HANDLED

  17. if (!is_user_alive(id))

  18.         return PLUGIN_HANDLED

  19. if ( (get_cvar_num("amx_ejaculate_admin")==1) && !(get_user_flags(id) & ADMIN_LEVEL_A) )

  20. {

  21.         console_print(id,"[AMXX] Nincs hozzaferesed a parancshoz.")

  22.         return PLUGIN_HANDLED

  23. }

  24. if(EjaculateFlag[id])

  25.         return PLUGIN_HANDLED

  26.  

  27. #if !defined NO_CS_CZ

  28. new player_origin[3], players[32], inum=0, dist, last_dist=99999, last_id

  29.  

  30. get_user_origin(id,player_origin,0)

  31. get_players(players,inum,"b")

  32. if (inum>0) {

  33.         for (new i=0;i<inum;i++) {

  34.                 if (players[i]!=id) {

  35.                         dist = get_distance(player_origin,player_origins[players[i]])

  36.                         if (dist<last_dist) {

  37.                                 last_id = players[i]

  38.                                 last_dist = dist

  39.                         }

  40.                 }

  41.         }

  42.         if (last_dist<80) {

  43. #endif

  44.                 if (count_ejaculate[id] > get_cvar_num("amx_maxejaculations")) {

  45.                         client_print(id,print_chat,"Csak %d -szer tudsz hokizni koronkent.", get_cvar_num("amx_maxejaculations"))

  46.                         return PLUGIN_CONTINUE

  47.                 }

  48.                 new player_name[32]

  49.                 get_user_name(id, player_name, 31)

  50.                 #if !defined NO_CS_CZ

  51.                 new dead_name[32]

  52.                 get_user_name(last_id, dead_name, 31)

  53.                 client_print(0,print_chat,"%s ra hokizott %s halott testere! HaHaHaHa!", player_name, dead_name)

  54.                 #else

  55.                 client_print(0,print_chat,"%s hokizik", player_name)

  56.                 #endif

  57.                 count_ejaculate[id]+=1

  58.                 new ids[1]

  59.                 ids[0]=id

  60.                 EjaculateFlag[id]=true

  61.                 aim[id]=false

  62.                 counter[id]=0

  63.                 emit_sound(id, CHAN_VOICE, "ejaculate/ejaculate.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

  64.                 set_task(1.0,"make_ejaculate",4210+id,ids,1,"a",10)

  65. #if !defined NO_CS_CZ

  66.         }

  67.         else

  68.         {

  69.                 client_print(id,print_chat,"Nincs holttest a kozeledben.")

  70.                 return PLUGIN_HANDLED

  71.         }

  72. }

  73. #endif

  74.  

  75. return PLUGIN_HANDLED

  76. }

  77.  

  78. public sqrt(num)

  79. {

  80.         new div = num

  81.         new result = 1

  82.         while (div > result) {

  83.                 div = (div + result) / 2

  84.                 result = num / div

  85.         }

  86.         return div

  87. }

  88.  

  89. public make_ejaculate(ids[])

  90. {

  91.         new id=ids[0]

  92.         new vec[3]

  93.         new aimvec[3]

  94.         new velocityvec[3]

  95.         new length

  96.         get_user_origin(id,vec)

  97.         get_user_origin(id,aimvec,3)

  98.         new distance = get_distance(vec,aimvec)

  99.         new speed = floatround(distance*1.9)

  100.  

  101.         velocityvec[0]=aimvec[0]-vec[0]

  102.         velocityvec[1]=aimvec[1]-vec[1]

  103.         velocityvec[2]=aimvec[2]-vec[2]

  104.  

  105.         length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2])

  106.  

  107.         velocityvec[0]=velocityvec[0]*speed/length

  108.         velocityvec[1]=velocityvec[1]*speed/length

  109.         velocityvec[2]=velocityvec[2]*speed/length

  110.  

  111.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY)

  112.         write_byte(101)

  113.         write_coord(vec[0])

  114.         write_coord(vec[1])

  115.         write_coord(vec[2])

  116.         write_coord(velocityvec[0])

  117.         write_coord(velocityvec[1])

  118.         write_coord(velocityvec[2])

  119.         write_byte(6) // color

  120.         write_byte(160) // speed

  121.         message_end()

  122.  

  123.         counter[id]++

  124.         if(counter[id]==10)

  125.                 EjaculateFlag[id]=false

  126. }

  127.  

  128. public death_event()

  129. {

  130.         new victim = read_data(2)

  131.         #if !defined NO_CS_CZ  

  132.         get_user_origin(victim,player_origins[victim],0)

  133.         #endif

  134.  

  135.         if(EjaculateFlag[victim])

  136.                 reset_ejaculate(victim)

  137.  

  138.         return PLUGIN_CONTINUE

  139. }

  140.  

  141. public reset_ejaculate(id)

  142. {

  143.         if(task_exists(4210+id))

  144.                 remove_task(4210+id)

  145.         emit_sound(id,CHAN_VOICE,"ejaculate/ejaculate.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)

  146.         EjaculateFlag[id]=false

  147.  

  148.         return PLUGIN_CONTINUE

  149. }

  150.  

  151. public reset_hud(id)

  152. {

  153.         if(task_exists(4210+id))

  154.                 remove_task(4210+id)

  155.         emit_sound(id,CHAN_VOICE,"ejaculate/ejaculate.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)

  156.         EjaculateFlag[id]=false

  157.  

  158.         count_ejaculate[id]=1

  159.  

  160.         return PLUGIN_CONTINUE

  161. }

  162.  

  163. public ejaculate_help(id)

  164. {

  165.         client_print(id, print_chat, "Hokizni csak akkor tudsz ha be bindeled")

  166.         client_print(id, print_chat, "Ird a konzolba hogy: bind ^"key^" ^"ejaculate^"")

  167.         client_print(id, print_chat, "Pelda: bind ^"x^" ^"ejaculate^"")

  168.  

  169.         return PLUGIN_CONTINUE

  170. }

  171.  

  172. public handle_say(id)

  173. {

  174.         new said[192]

  175.         read_args(said,192)

  176.         remove_quotes(said)

  177.  

  178.         if( ((containi(said, "ejaculate") != -1) && !(containi(said, "/ejaculate") != -1))

  179.         || ((containi(said, "ejaculer") != -1) && !(containi(said, "/ejaculer") != -1)) )

  180.         {

  181.                 client_print(id, print_chat, "[AMX] Ird /ejaculate az infokhoz")

  182.         }

  183.  

  184.         return PLUGIN_CONTINUE

  185. }

  186.  

  187. public plugin_precache()

  188. {

  189.         if (file_exists("sound/ejaculate/ejaculate.wav"))

  190.                 precache_sound("ejaculate/ejaculate.wav")    

  191.  

  192.         return PLUGIN_CONTINUE

  193. }

  194.  

  195. public client_connect(id)

  196. {

  197.         EjaculateFlag[id]=false

  198.         count_ejaculate[id]=1

  199.  

  200.         return PLUGIN_CONTINUE

  201. }

  202.  

  203. public client_disconnect(id)

  204. {

  205.         reset_hud(id)

  206.  

  207.         return PLUGIN_CONTINUE

  208. }

  209.  

  210. public plugin_init()

  211. {

  212.         register_plugin("AMX Ejaculate","0.1","KRoTaL")

  213.         register_clcmd("ejaculate","ejaculate_on_player",0,"- Ejaculate on a dead player")

  214.         register_clcmd("ejaculer","ejaculate_on_player",0,"- Ejaculate on a dead player")

  215.         register_clcmd("say /ejaculate","ejaculate_help",0,"- Displays Ejaculate help")

  216.         register_clcmd("say /ejaculer","ejaculate_help",0,"- Displays Ejaculate help")

  217.         register_clcmd("say","handle_say")

  218.         register_cvar("amx_maxejaculations","6")

  219.         register_cvar("amx_ejaculate_admin","0")

  220.         register_event("DeathMsg","death_event","a")

  221.         register_event("ResetHUD", "reset_hud", "be")

  222.  

  223.         return PLUGIN_CONTINUE

  224. }

  225.  

  226. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

  227. *{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1038{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }

  228. */

  229.  


Kód:
  1. /////TakeADookie -by PaintLancer (paintlancer@hotmail.com)

  2.  

  3. // What it is:

  4. //             Enables players to "Take A Dookie" on the dead bodies of other players

  5.  

  6. // Cvars:

  7. //        amx_dookie "2" (sets the amount of dookies per round you can take)

  8. //        amx_superdookie "2" (the amount of headshots it takes to turn a dookie into a superdookie)

  9.  

  10. // History:

  11. //          I made this plugin many months ago for AMX and thought

  12. //          it would be too stupid to release... but I've had a bunch of

  13. //          server admins ask me for it saying the searched the net but

  14. //          couldn't find it so..

  15.  

  16. #include <amxmodx>

  17. #include <fakemeta>

  18.  

  19. #define MAX_PLAYERS 32

  20.  

  21. new const DOOKIE_CLASSNAME[] = "amx_dookie"

  22. new const DOOKIE_MODEL1[] = "models/dookie2.mdl"

  23. new const DOOKIE_MODEL2[] = "models/dookie3.mdl"

  24. new const DOOKIE_SOUND1[] = "dookie/dookie1.wav"

  25. new const DOOKIE_SOUND2[] = "dookie/dookie3.wav"

  26. new const STEAM_SPRITE[] = "sprites/xsmoke3.spr"

  27. new const SMOKE_SPRITE[] = "sprites/steam1.spr"

  28.  

  29. new Float:pl_origins[MAX_PLAYERS+1][3]

  30. new pl_dookied[MAX_PLAYERS+1]

  31. new hs_counter[MAX_PLAYERS+1]

  32. new steamsprite

  33. new smoke

  34.  

  35. new gmsgShake

  36. new bool:g_RestartAttempt[MAX_PLAYERS+1]

  37. new amx_dookie, amx_superdookie

  38.  

  39. public plugin_precache(){

  40.         engfunc(EngFunc_PrecacheSound, DOOKIE_SOUND1)

  41.         engfunc(EngFunc_PrecacheSound, DOOKIE_SOUND2)

  42.         engfunc(EngFunc_PrecacheModel, DOOKIE_MODEL1)

  43.         engfunc(EngFunc_PrecacheModel, DOOKIE_MODEL2)

  44.         steamsprite = engfunc(EngFunc_PrecacheModel, STEAM_SPRITE)

  45.         smoke = engfunc(EngFunc_PrecacheModel, SMOKE_SPRITE)

  46. }

  47.  

  48. public plugin_init()

  49. {

  50.         register_plugin("TakeADookie", "2.3", "PaintLancer") // conversion amxx : ConnorMcLeod

  51.         register_dictionary("dookie.txt")

  52.  

  53.         register_clcmd("takeadookie", "take_a_dookie")

  54.         register_clcmd("defequer", "take_a_dookie")

  55.  

  56.         register_clcmd("say /dookie", "do_help", 0, "- Displays dookie help")

  57.         register_clcmd("say /defequer", "do_help", 0, "- Affiche l'aide du plugin pour defequer")

  58.         register_clcmd("say", "HandleSay")

  59.         register_clcmd("clcmd_fullupdate", "fullupdateCmd")

  60.  

  61.         register_forward(FM_Think, "fwdThink")

  62.  

  63.         register_event("TextMsg", "eRestartAttempt", "a", "2=#Game_will_restart_in")

  64.         register_event("ResetHUD", "eResetHUD", "be")

  65.         register_event("DeathMsg","eDeathMsg", "a")

  66.  

  67.         gmsgShake = get_user_msgid("ScreenShake")

  68.  

  69.         amx_dookie = register_cvar("amx_dookie", "2")

  70.         amx_superdookie = register_cvar("amx_superdookie", "2")

  71. }

  72.  

  73. public fullupdateCmd() {

  74.         return PLUGIN_HANDLED_MAIN

  75. }

  76.  

  77. public eRestartAttempt() {

  78.         new players[32], num

  79.         get_players(players, num, "a")

  80.         for (new i; i < num; ++i)

  81.                 g_RestartAttempt[players[i]] = true

  82. }

  83.  

  84. public eResetHUD(id) {

  85.         if (g_RestartAttempt[id]) {

  86.                 g_RestartAttempt[id] = false

  87.                 return

  88.         }

  89.         KillDookie(id)

  90. }

  91.  

  92. public take_a_dookie(id) {

  93.         new dookie = get_pcvar_num(amx_dookie)

  94.         if(!dookie)

  95.                 return PLUGIN_HANDLED

  96.         if (!is_user_alive(id))

  97.                 return PLUGIN_HANDLED

  98.  

  99.         if (pl_dookied[id] > dookie) {

  100.                 client_print(id, print_chat, "%L", id, "DOOKIE_ONLY", dookie)

  101.                 return PLUGIN_HANDLED

  102.         }

  103.  

  104.         new Float:cur_origin[3], players[MAX_PLAYERS], player, pl_num, Float:dist, Float:last_dist=99999.0, last_id

  105.  

  106.         pev(id, pev_origin, cur_origin)

  107.         get_players(players, pl_num, "b")

  108.  

  109.         if(!pl_num) {

  110.                 client_print(id, print_chat, "%L", id, "DOOKIE_NODEADS")

  111.                 return PLUGIN_HANDLED

  112.         }

  113.  

  114.         for (new i=0;i<pl_num;i++) {

  115.                 player = players[i]

  116.                 if (player!=id) {

  117.                         dist = get_distance_f(cur_origin,pl_origins[player])

  118.                         if (dist<last_dist) {

  119.                                 last_id = player

  120.                                 last_dist = dist

  121.                         }

  122.                 }

  123.         }

  124.         if(last_dist<80.0) {           

  125.                 new superdookie = get_pcvar_num(amx_superdookie)

  126.                 if(hs_counter[id] >= superdookie)

  127.                 {

  128.                         hs_counter[id] -= superdookie

  129.                         ++pl_dookied[id]

  130.  

  131.                         new Float:origin[3]

  132.                         pev(id, pev_origin, origin)

  133.  

  134.                         engfunc(EngFunc_EmitSound, id, CHAN_VOICE, DOOKIE_SOUND2, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

  135.  

  136.                         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

  137.                         write_byte(TE_SMOKE)

  138.                         engfunc(EngFunc_WriteCoord, origin[0])

  139.                         engfunc(EngFunc_WriteCoord, origin[1])

  140.                         engfunc(EngFunc_WriteCoord, origin[2])

  141.                         write_short(smoke)

  142.                         write_byte(60)

  143.                         write_byte(5)

  144.                         message_end()

  145.  

  146.                         new dookier[32], dookied[32]

  147.                         get_user_name(last_id, dookied, 31)

  148.                         get_user_name(id, dookier, 31)

  149.                         CreateSuperDookie(id)

  150.                         client_print(0,print_chat,"%L", LANG_PLAYER, "DOOKIE_SUPER", dookier, dookied)

  151.                         return PLUGIN_HANDLED

  152.                 }

  153.                 else

  154.                 {

  155.                         ++pl_dookied[id]

  156.                         new Float:origin[3]

  157.                         pev(id, pev_origin, origin)

  158.  

  159.                         engfunc(EngFunc_EmitSound, id, CHAN_VOICE, DOOKIE_SOUND1, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

  160.  

  161.                         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

  162.                         write_byte(TE_SMOKE)

  163.                         engfunc(EngFunc_WriteCoord, origin[0])

  164.                         engfunc(EngFunc_WriteCoord, origin[1])

  165.                         engfunc(EngFunc_WriteCoord, origin[2])

  166.                         write_short(smoke)

  167.                         write_byte(60)

  168.                         write_byte(5)

  169.                         message_end()

  170.  

  171.                         new dookier[32], dookied[32]

  172.                         get_user_name(last_id, dookied, charsmax(dookied))

  173.                         get_user_name(id, dookier, charsmax(dookier))

  174.                         CreateDookie(id)

  175.                         client_print(0, print_chat, "%L", LANG_PLAYER, "DOOKIE_NORM", dookier, dookied)

  176.                         return PLUGIN_HANDLED

  177.                 }

  178.         }

  179.         else

  180.         {

  181.                 client_print(id, print_chat, "%L", id, "DOOKIE_NODEADS_AROUND")

  182.                 return PLUGIN_HANDLED

  183.         }

  184.  

  185.         return PLUGIN_HANDLED

  186. }

  187.  

  188. public eDeathMsg() {

  189.         new victim = read_data(2)

  190.         pev(victim, pev_origin, pl_origins[victim])

  191.         if(read_data(3))

  192.                 hs_counter[read_data(1)]++

  193. }

  194.  

  195. public CreateDookie(id){

  196.  

  197.         new Float:origin[3]

  198.         pev(id, pev_origin, origin)

  199.  

  200.         new ent

  201.         ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))

  202.  

  203.         if(!ent)

  204.                 return

  205.  

  206.         set_pev(ent, pev_classname, DOOKIE_CLASSNAME)

  207.  

  208.         engfunc(EngFunc_SetModel, ent, DOOKIE_MODEL1)

  209.  

  210.         new Float:MinBox[3]

  211.         new Float:MaxBox[3]

  212.         for(new a; a<3; a++) {

  213.                 MinBox[a] = -1.0

  214.                 MaxBox[a] = 1.0

  215.         }

  216.         engfunc(EngFunc_SetSize, ent, MinBox, MaxBox)

  217.         engfunc(EngFunc_SetOrigin, ent, origin)

  218.  

  219.         set_pev(ent, pev_solid, SOLID_SLIDEBOX)

  220.         set_pev(ent, pev_movetype, MOVETYPE_TOSS)

  221.         set_pev(ent, pev_owner, id)

  222.  

  223.         new Float:global_Time

  224.         global_get(glb_time, global_Time)

  225.         set_pev(ent, pev_nextthink, global_Time + 1.0)

  226. }

  227.  

  228. public CreateSuperDookie(id){

  229.  

  230.         new Float:origin[3]

  231.         pev(id, pev_origin, origin)

  232.  

  233.         new ent

  234.         ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))

  235.  

  236.         if(!ent)

  237.                 return

  238.  

  239.         set_pev(ent, pev_classname, DOOKIE_CLASSNAME)

  240.  

  241.         engfunc(EngFunc_SetModel, ent, DOOKIE_MODEL2)

  242.  

  243.         new Float:MinBox[3]

  244.         new Float:MaxBox[3]

  245.  

  246.         for(new a; a<3; a++) {

  247.                 MinBox[a] = -1.0

  248.                 MaxBox[a] = 1.0

  249.         }

  250.  

  251.         engfunc(EngFunc_SetSize, ent, MinBox, MaxBox)

  252.         engfunc(EngFunc_SetOrigin, ent, origin)

  253.  

  254.         set_pev(ent, pev_solid, SOLID_SLIDEBOX)

  255.         set_pev(ent, pev_movetype, MOVETYPE_TOSS)

  256.         set_pev(ent, pev_owner, id)

  257.  

  258.         //shake

  259.         new all[MAX_PLAYERS], all_num

  260.         get_players(all, all_num, "a")

  261.  

  262.         for (new i=0;i<all_num;i++)

  263.         {

  264.                 message_begin(MSG_ONE, gmsgShake, _, all[i])

  265.                 write_short(1<<15) // shake amount

  266.                 write_short(1<<11) // shake lasts this long

  267.                 write_short(1<<15) // shake noise frequency

  268.                 message_end()

  269.         }

  270.  

  271.         //poo matter

  272.         for (new j = 0; j < 10; j++)

  273.         {

  274.                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY)

  275.                 write_byte(TE_BLOODSTREAM)

  276.                 engfunc(EngFunc_WriteCoord, origin[0])

  277.                 engfunc(EngFunc_WriteCoord, origin[1])

  278.                 engfunc(EngFunc_WriteCoord, origin[2] - 20.0)

  279.                 write_coord(random_num(-100,100)) // x

  280.                 write_coord(random_num(-100,100)) // y

  281.                 write_coord(random_num(20,300)) // z

  282.                 write_byte(100) // color

  283.                 write_byte(random_num(100,200)) // speed

  284.                 message_end()

  285.         }

  286.  

  287.         new Float:global_Time

  288.         global_get(glb_time, global_Time)

  289.         set_pev(ent, pev_nextthink, global_Time + 1.0)

  290.  

  291. }

  292.  

  293. public fwdThink(ent) {

  294.         if(!pev_valid(ent))

  295.                 return FMRES_IGNORED

  296.  

  297.         static classname[33]

  298.         pev(ent, pev_classname, classname, charsmax(classname))

  299.  

  300.         if(!equal(classname, DOOKIE_CLASSNAME))

  301.                 return FMRES_IGNORED

  302.  

  303.         DookieSteam(ent)

  304.         new Float:global_Time

  305.         global_get(glb_time, global_Time)

  306.         set_pev(ent, pev_nextthink, global_Time + 1.0)

  307.         return FMRES_HANDLED

  308. }

  309.  

  310. public KillDookie(id){

  311.         new iCurrent = -1

  312.  

  313.         while((iCurrent = engfunc(EngFunc_FindEntityByString, iCurrent, "classname", DOOKIE_CLASSNAME)) > 0) {

  314.                 if(pev(iCurrent, pev_owner) == id)

  315.                         engfunc(EngFunc_RemoveEntity, iCurrent)

  316.         }

  317.  

  318.         pl_dookied[id] = 1

  319. }

  320.  

  321. public DookieSteam(ent)

  322. {

  323.         new Float:origin[3]

  324.         pev(ent, pev_origin, origin)

  325.  

  326.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

  327.         write_byte(TE_SPRITE)

  328.         engfunc(EngFunc_WriteCoord, origin[0])

  329.         engfunc(EngFunc_WriteCoord, origin[1])

  330.         engfunc(EngFunc_WriteCoord, origin[2] + 10.0)

  331.         write_short(steamsprite)

  332.         write_byte(8)

  333.         write_byte(10)

  334.         message_end()

  335. }

  336.  

  337. public do_help(id){

  338.  

  339.   new len = 1300

  340.   new buffer[1301]

  341.   new title[20]

  342.   new n = 0

  343.  

  344.   n += formatex( buffer[n],len-n, "<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:#000000;margin-left:8px;margin-top:0px;}</style></head><body><pre>")

  345.  

  346.   n += formatex( buffer[n],len-n, "%L", id, "DOOKIE_MOTD1")

  347.  

  348.   n += formatex( buffer[n],len-n, "%L", id, "DOOKIE_MOTD2")

  349.   n += formatex( buffer[n],len-n, "%L", id, "DOOKIE_MOTD3")

  350.  

  351.   n += formatex( buffer[n],len-n, "ex:^n^n")

  352.   n += formatex( buffer[n],len-n, "%L", id, "DOOKIE_MOTD4")

  353.  

  354.   n += formatex( buffer[n],len-n, "%L", id, "DOOKIE_MOTD5")

  355.   n += formatex( buffer[n],len-n, "%L", id, "DOOKIE_MOTD6", get_pcvar_num(amx_superdookie))

  356.   n += formatex( buffer[n],len-n, "%L", id, "DOOKIE_MOTD7")

  357.  

  358.   n += formatex( buffer[n],len-n, "</pre></body></html>")

  359.  

  360.   formatex(title, charsmax(title), "%L", id, "DOOKIE_MOTD_TITLE")

  361.   show_motd(id, buffer, title)

  362.   return PLUGIN_CONTINUE

  363. }

  364.  

  365. public HandleSay(id) {

  366.   new Speech[192]

  367.   read_args(Speech,192)

  368.   remove_quotes(Speech)

  369.  

  370.   if( (containi(Speech, "dookie") != -1) || (containi(Speech, "takeadookie") != -1) || (containi(Speech, "defequer") != -1) ) {

  371.     client_print(id,print_chat, "%L", id, "DOOKIE_HELP")

  372.   }

  373.  

  374.   return PLUGIN_CONTINUE

  375. }


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [1 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 5 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole