1. Notty Пользователь

    Регистрация:
    09.03.15
    Сообщения:
    126
    Симпатии:
    23
    Пол:
    Мужской
    Добрый вечер форумчане, помогите мне с исходником:)
    Нужно сделать цветной чат и перевести на русский сообщения в чат:)

    Код (Unknown Language):
    1. /*
    2.  
    3. Plugin: Amxx Piss
    4. Version: 2.0
    5. Author: KRoTaL (Based on TakeADookie by PaintLancer)
    6.  
    7.  
    8. 1.0  Release
    9. 1.1  Better effect
    10. 1.2  Bug fix
    11. 1.3  New effect + piss puddle
    12. 1.4a New effects, only for cs/cz/dod
    13. 1.4b New effects, only for other mods than cs/cz/dod
    14. 1.5  #define NO_CS_CZ added
    15. 1.6  Bug fix (DoD)
    16. 1.7  Bug fix
    17. 1.8  Some checks added
    18. 1.9  #define NO_CS_CZ changed into #define NO_CS_CZ
    19. 2.0  New cvar : amx_piss_effect
    20.  
    21. Commands:
    22.  
    23.     To piss on a dead body you have to bind a key to: piss
    24.     Open your console and write: bind "key" "piss"
    25.     ex: bind "x" "piss"
    26.     Then stand still above a dead player (cs/cz only), press your key and you'll piss on them !
    27.     You can control the direction of the stream with your mouse.
    28.     You are not able to move or to shoot for 10 seconds when you piss, so beware (cs/cz only).
    29.     The puddle of piss will appear where you are aiming at 2 seconds after you start pissing,
    30.     so try to aim at the dead body instead of the sky or a wall ;)
    31.  
    32.     Players can say "/piss" in the chat to get some help.
    33.  
    34. Cvars:
    35.  
    36.     amx_maxpees 6        -    Maximum number of times a player is allowed to piss per round.
    37.  
    38.     amx_piss_admin 0        -    0 : All the players are allowed to piss
    39.                               1 : Only admins with ADMIN_LEVEL_A flag are allowed to piss
    40.  
    41.     amx_piss_effect 0        -    0 : yellow bloodsprite
    42.                               1 : yellow laserbeam
    43.  
    44. Setup:
    45.  
    46.     You need to put these files on your server:
    47.  
    48.     sound/piss/pissing.wav
    49.     models/piss/piss_puddle1.mdl
    50.     models/piss/piss_puddle2.mdl  
    51.     models/piss/piss_puddle3.mdl      
    52.     models/piss/piss_puddle4.mdl    
    53.     models/piss/piss_puddle5.mdl    
    54.     models/piss/piss.mdl
    55.  
    56.     You need to enable Fun and Engine Modules for cs/cs-cz.
    57.     You need to enable Engine Module for the other mods.
    58.  
    59. Credits:
    60.  
    61.     Rastin for his trousers fly sounds
    62.     SLayer KL for his piss puddle models
    63.  
    64. */
    65.  
    66. // UNCOMMENT IF YOU USE ANOTHER MOD THAN CS and CS-CZ
    67. //#define NO_CS_CZ
    68.  
    69.  
    70.  
    71.  
    72. /***************************************************************************************************/
    73.  
    74. #include <amxmodx>
    75. #if !defined NO_CS_CZ
    76. #include <fun>
    77. #endif
    78. #include <engine>
    79.  
    80.  
    81. new piss_model
    82. new piss_sprite
    83. new water_splash
    84. new count_piss[33]
    85. new count_puddle[33]
    86. new bool:PissFlag[33]
    87. new bool:aim[33]
    88. new Float:aim_origin[33][3]
    89. #if !defined NO_CS_CZ
    90. new player_origins[33][3]
    91. new mod_name[32]
    92. #endif
    93.  
    94. public piss_on_player(id)
    95. {
    96.  
    97. if (get_cvar_num("amx_maxpees")==0)
    98.     return PLUGIN_HANDLED
    99. if (!is_user_alive(id))
    100.     return PLUGIN_HANDLED
    101. if ( (get_cvar_num("amx_piss_admin")==1) && !(get_user_flags(id) & ADMIN_LEVEL_A) )
    102. {
    103.     console_print(id, "[AMXX] You have not access to this command.")
    104.     return PLUGIN_HANDLED
    105. }
    106. if(PissFlag[id])
    107.     return PLUGIN_HANDLED
    108.  
    109. #if !defined NO_CS_CZ
    110. new player_origin[3], players[32], inum=0, dist, last_dist=99999, last_id
    111.  
    112. get_user_origin(id,player_origin,0)
    113. get_players(players,inum,"b")
    114. if (inum>0) {
    115.     for (new i=0;i<inum;i++) {
    116.         if (players[i]!=id) {
    117.             dist = get_distance(player_origin,player_origins[players[i]])
    118.             if (dist<last_dist) {
    119.                 last_id = players[i]
    120.                 last_dist = dist
    121.             }
    122.         }
    123.     }
    124.     if (last_dist<80) {
    125. #endif
    126.         if (count_piss[id] > get_cvar_num("amx_maxpees")) {
    127.             client_print(id,print_chat,"You can only piss on a player %d time%s in a round !", get_cvar_num("amx_maxpees"), (get_cvar_num("amx_maxpees")>1) ? "s" : "")
    128.             return PLUGIN_CONTINUE
    129.         }
    130.         new player_name[32]
    131.         get_user_name(id, player_name, 31)
    132.         #if !defined NO_CS_CZ
    133.         new dead_name[32]
    134.         get_user_name(last_id, dead_name, 31)
    135.         client_print(0,print_chat,"%s Is Pissing On %s's Dead Body !! HaHaHaHa !!", player_name, dead_name)
    136.         #else
    137.         client_print(0,print_chat,"%s Is Pissing !!", player_name)
    138.         #endif
    139.         count_piss[id]+=1
    140.         count_puddle[id]=1
    141.         new ids[1]
    142.         ids[0]=id
    143.         PissFlag[id]=true
    144.         aim[id]=false
    145.         #if !defined NO_CS_CZ
    146.         if( (equali(mod_name,"cstrike")) || (equali(mod_name,"czero")) )
    147.         {
    148.             client_cmd(id, "weapon_knife")
    149.             set_user_maxspeed(id, -1.0)
    150.         }
    151.         #endif
    152.         emit_sound(id,CHAN_VOICE,"piss/pissing.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
    153.         switch(get_cvar_num("amx_piss_effect"))
    154.         {
    155.             case 0:  set_task(0.2,"make_pee",1481+id,ids,1,"a",48)
    156.             case 1:  set_task(0.1,"make_pee",1481+id,ids,1,"a",102)
    157.             default: set_task(0.2,"make_pee",1481+id,ids,1,"a",48)
    158.         }
    159.         set_task(2.2,"place_puddle",3424+id,ids,1,"a",4)
    160.         #if !defined NO_CS_CZ
    161.         set_task(12.0,"weapons_back",6794+id,ids,1)
    162.     }
    163.     else
    164.     {
    165.         client_print(id,print_chat,"There are no dead bodies around you.")
    166.         return PLUGIN_HANDLED
    167.     }
    168. }
    169. #endif
    170. return PLUGIN_HANDLED
    171. }
    172.  
    173. public sqrt(num)
    174. {
    175.     new div = num
    176.     new result = 1
    177.     while (div > result) {
    178.         div = (div + result) / 2
    179.         result = num / div
    180.     }
    181.     return div
    182. }
    183.  
    184. public make_pee(ids[])
    185. {
    186.     new id=ids[0]
    187.     new vec[3]
    188.     new aimvec[3]
    189.     new velocityvec[3]
    190.     new length
    191.     get_user_origin(id,vec)
    192.     get_user_origin(id,aimvec,3)
    193.     new distance = get_distance(vec,aimvec)
    194.     new speed = floatround(distance*1.9)
    195.  
    196.     velocityvec[0]=aimvec[0]-vec[0]
    197.     velocityvec[1]=aimvec[1]-vec[1]
    198.     velocityvec[2]=aimvec[2]-vec[2]
    199.  
    200.     length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2])
    201.  
    202.     velocityvec[0]=velocityvec[0]*speed/length
    203.     velocityvec[1]=velocityvec[1]*speed/length
    204.     velocityvec[2]=velocityvec[2]*speed/length
    205.  
    206.     switch(get_cvar_num("amx_piss_effect"))
    207.     {
    208.         case 0:
    209.         {
    210.             message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    211.             write_byte(101)
    212.             write_coord(vec[0])
    213.             write_coord(vec[1])
    214.             write_coord(vec[2])
    215.             write_coord(velocityvec[0])
    216.             write_coord(velocityvec[1])
    217.             write_coord(velocityvec[2])
    218.             write_byte(102) // color
    219.             write_byte(160) // speed
    220.             message_end()
    221.         }
    222.         case 1:
    223.         {
    224.             message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    225.             write_byte(106)
    226.             write_coord(vec[0])
    227.             write_coord(vec[1])
    228.             write_coord(vec[2])
    229.             write_coord(velocityvec[0])
    230.             write_coord(velocityvec[1])
    231.             write_coord(velocityvec[2]+100)
    232.             write_angle (0)
    233.             write_short (piss_model)
    234.             write_byte (0)
    235.             write_byte (255)
    236.             message_end()
    237.  
    238.             message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    239.             write_byte (1)  
    240.             write_short (id)
    241.             write_coord(aimvec[0])
    242.             write_coord(aimvec[1])
    243.             write_coord(aimvec[2])
    244.             write_short(piss_sprite)
    245.             write_byte( 1 ) // framestart
    246.             write_byte( 6 ) // framerate
    247.             write_byte( 1 ) // life
    248.             write_byte( 8 ) // width
    249.             write_byte( 0 ) // noise
    250.             write_byte( 255 ) // r, g, b
    251.             write_byte( 255 ) // r, g, b
    252.             write_byte( 0 ) // r, g, b
    253.             write_byte( 200 ) // brightness
    254.             write_byte( 10 ) // speed
    255.             message_end()
    256.  
    257.             message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
    258.             write_byte(17)
    259.             write_coord(aimvec[0])
    260.             write_coord(aimvec[1])
    261.             write_coord(aimvec[2])
    262.             write_short(water_splash)
    263.             write_byte(16)
    264.             write_byte(18)
    265.             message_end()
    266.  
    267.         }
    268.         default:
    269.         {
    270.             message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    271.             write_byte(101)
    272.             write_coord(vec[0])
    273.             write_coord(vec[1])
    274.             write_coord(vec[2])
    275.             write_coord(velocityvec[0])
    276.             write_coord(velocityvec[1])
    277.             write_coord(velocityvec[2])
    278.             write_byte(102) // color
    279.             write_byte(160) // speed
    280.             message_end()
    281.         }
    282.     }
    283. }
    284.  
    285. public place_puddle(ids[])
    286. {
    287.     new id=ids[0]
    288.     if(!aim[id])
    289.     {
    290.         new origin[3]
    291.         get_user_origin(id,origin,3)
    292.         aim_origin[id][0]=float(origin[0])
    293.         aim_origin[id][1]=float(origin[1])
    294.         aim_origin[id][2]=float(origin[2])
    295.     }
    296.  
    297.     new puddle_entity
    298.     puddle_entity = create_entity("info_target")
    299.  
    300.     if(puddle_entity == 0) {
    301.         return PLUGIN_HANDLED_MAIN
    302.     }
    303.  
    304.     new Float:MinBox[3]
    305.     new Float:MaxBox[3]
    306.  
    307.     MinBox[0] = -1.0
    308.     MinBox[1] = -1.0
    309.     MinBox[2] = -1.0
    310.     MaxBox[0] = 1.0
    311.     MaxBox[1] = 1.0
    312.     MaxBox[2] = 1.0
    313.  
    314.     entity_set_vector(puddle_entity, EV_VEC_mins, MinBox)
    315.     entity_set_vector(puddle_entity, EV_VEC_maxs, MaxBox)
    316.  
    317.     switch(count_puddle[id])
    318.     {
    319.         case 1:
    320.         {        
    321.             entity_set_string(puddle_entity, EV_SZ_classname, "piss_puddle1")
    322.             entity_set_model(puddle_entity, "models/piss/piss_puddle1.mdl")
    323.         }
    324.         case 2:
    325.         {        
    326.             entity_set_string(puddle_entity, EV_SZ_classname, "piss_puddle2")
    327.             entity_set_model(puddle_entity, "models/piss/piss_puddle2.mdl")
    328.         }
    329.         case 3:
    330.         {        
    331.             entity_set_string(puddle_entity, EV_SZ_classname, "piss_puddle3")
    332.             entity_set_model(puddle_entity, "models/piss/piss_puddle3.mdl")
    333.         }
    334.         case 4:
    335.         {        
    336.             entity_set_string(puddle_entity, EV_SZ_classname, "piss_puddle4")
    337.             entity_set_model(puddle_entity, "models/piss/piss_puddle4.mdl")
    338.         }
    339.         case 5:
    340.         {        
    341.             entity_set_string(puddle_entity, EV_SZ_classname, "piss_puddle5")
    342.             entity_set_model(puddle_entity, "models/piss/piss_puddle5.mdl")
    343.             #if defined NO_CS_CZ
    344.                PissFlag[id]=false
    345.             #endif
    346.         }
    347.         default: {}
    348.     }
    349.  
    350.     entity_set_origin(puddle_entity, aim_origin[id])
    351.     entity_set_int(puddle_entity, EV_INT_solid, 3)  
    352.     entity_set_int(puddle_entity, EV_INT_movetype, 6)
    353.     entity_set_edict(puddle_entity, EV_ENT_owner, id)
    354.  
    355.     count_puddle[id]+=1
    356.     aim[id]=true
    357.  
    358.        return PLUGIN_CONTINUE
    359. }
    360.  
    361. public death_event()
    362. {
    363.        new victim = read_data(2)
    364.      #if !defined NO_CS_CZ    
    365.     get_user_origin(victim,player_origins[victim],0)
    366.     #endif
    367.  
    368.     if(PissFlag[victim])
    369.         reset_piss(victim)
    370.  
    371.        return PLUGIN_CONTINUE
    372. }
    373.  
    374. #if !defined NO_CS_CZ
    375. public weapons_back(ids[])
    376. {
    377.        PissFlag[ids[0]]=false
    378.     if( (equali(mod_name,"cstrike")) || (equali(mod_name,"czero")) )
    379.     {
    380.         set_user_maxspeed(ids[0], 250.0)
    381.     }
    382. }
    383.  
    384. public cur_weapon(id)
    385. {
    386.     if(PissFlag[id])
    387.     {
    388.         if( (equali(mod_name,"cstrike")) || (equali(mod_name,"czero")) )
    389.         {
    390.             client_cmd(id, "weapon_knife")
    391.             set_user_maxspeed(id, -1.0)
    392.         }
    393.     }
    394.  
    395.     return PLUGIN_CONTINUE
    396. }
    397. #endif
    398.  
    399. public reset_piss(id)
    400. {
    401.     if(task_exists(1481+id))
    402.         remove_task(1481+id)
    403.     if(task_exists(3424+id))
    404.         remove_task(3424+id)
    405.     #if !defined NO_CS_CZ
    406.     if(task_exists(6794+id))
    407.         remove_task(6794+id)
    408.     #endif
    409.     emit_sound(id,CHAN_VOICE,"piss/pissing.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)
    410.     PissFlag[id]=false
    411.  
    412.     return PLUGIN_CONTINUE
    413. }
    414.  
    415. public reset_hud(id)
    416. {
    417.     if(task_exists(1481+id))
    418.         remove_task(1481+id)
    419.     if(task_exists(3424+id))
    420.         remove_task(3424+id)
    421.     #if !defined NO_CS_CZ
    422.     if(task_exists(6794+id))
    423.         remove_task(6794+id)
    424.     #endif
    425.     emit_sound(id,CHAN_VOICE,"piss/pissing.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)
    426.     PissFlag[id]=false
    427.  
    428.     new iCurrent
    429.  
    430.     for (new i=1 ; i<count_piss[id] ; i++)
    431.     {              
    432.         iCurrent = find_ent_by_class(-1, "piss_puddle1")
    433.         if(iCurrent != -1)
    434.             remove_entity(iCurrent)
    435.         iCurrent = find_ent_by_class(-1, "piss_puddle2")
    436.         if(iCurrent != -1)
    437.             remove_entity(iCurrent)
    438.         iCurrent = find_ent_by_class(-1, "piss_puddle3")
    439.         if(iCurrent != -1)
    440.             remove_entity(iCurrent)
    441.         iCurrent = find_ent_by_class(-1, "piss_puddle4")
    442.         if(iCurrent != -1)
    443.             remove_entity(iCurrent)
    444.         iCurrent = find_ent_by_class(-1, "piss_puddle5")
    445.         if(iCurrent != -1)
    446.             remove_entity(iCurrent)
    447.       }
    448.     count_piss[id]=1
    449.  
    450.     return PLUGIN_CONTINUE
    451. }
    452.  
    453. public piss_help(id)
    454. {
    455.     client_print(id, print_chat, "To piss on a dead body you have to bind a key to: piss")
    456.     client_print(id, print_chat, "Open your console and write: bind ^"key^" ^"piss^"")
    457.     client_print(id, print_chat, "ex: bind ^"x^" ^"piss^"")
    458.  
    459.     return PLUGIN_CONTINUE
    460. }
    461.  
    462. public handle_say(id)
    463. {
    464.     new said[192]
    465.     read_args(said,192)
    466.     remove_quotes(said)
    467.  
    468.     if( (containi(said, "piss") != -1) && !(containi(said, "/piss") != -1) ) {
    469.         client_print(id, print_chat, "[AMXX] For Piss help say /piss")
    470.     }
    471.  
    472.     return PLUGIN_CONTINUE
    473. }
    474.  
    475. public plugin_precache()
    476. {
    477.     if (file_exists("sound/piss/pissing.wav"))
    478.         precache_sound( "piss/pissing.wav")  
    479.     if (file_exists("models/piss/piss_puddle1.mdl"))    
    480.         precache_model("models/piss/piss_puddle1.mdl")
    481.     if (file_exists("models/piss/piss_puddle2.mdl"))    
    482.         precache_model("models/piss/piss_puddle2.mdl")
    483.     if (file_exists("models/piss/piss_puddle3.mdl"))    
    484.         precache_model("models/piss/piss_puddle3.mdl")
    485.     if (file_exists("models/piss/piss_puddle4.mdl"))    
    486.         precache_model("models/piss/piss_puddle4.mdl")
    487.     if (file_exists("models/piss/piss_puddle5.mdl"))    
    488.         precache_model("models/piss/piss_puddle5.mdl")
    489.     if (file_exists("models/piss/piss.mdl"))    
    490.         piss_model = precache_model("models/piss/piss.mdl")
    491.     piss_sprite = precache_model("sprites/plasma.spr")
    492.     water_splash = precache_model("sprites/wsplash3.spr")
    493.  
    494.        return PLUGIN_CONTINUE
    495. }
    496.  
    497. public client_connect(id)
    498. {
    499.     PissFlag[id]=false
    500.     count_piss[id]=1
    501.    
    502.     return PLUGIN_CONTINUE
    503. }
    504.  
    505. public client_disconnect(id)
    506. {
    507.     reset_hud(id)
    508.  
    509.     return PLUGIN_CONTINUE
    510. }
    511.  
    512. public plugin_init()
    513. {
    514.     register_plugin("AMXX Piss","2.0","KRoTaL")
    515.     register_clcmd("piss","piss_on_player",0,"- Piss on a dead player")
    516.     register_clcmd("say /piss","piss_help",0,"- Displays piss help")
    517.     register_clcmd("say","handle_say")
    518.     register_cvar("amx_maxpees","6")
    519.     register_cvar("amx_piss_admin","0")
    520.     register_cvar("amx_piss_effect","0")
    521.     register_event("DeathMsg","death_event","a")
    522.     register_event("ResetHUD", "reset_hud", "be")
    523.     #if !defined NO_CS_CZ
    524.     register_event("CurWeapon","cur_weapon","be","1=1")
    525.     get_modname(mod_name,31)
    526.     #endif
    527.  
    528.     return PLUGIN_CONTINUE
    529. }
    530.  
     
  2. DoHaTeJIJIo Пользователь

    Регистрация:
    21.06.16
    Сообщения:
    23
    Симпатии:
    1
    Пол:
    Мужской
    VKcom:
    id273992047
    вот лови
     

    Вложения:

    • lololol.sma
      Размер файла:
      95 байт
      Просмотров:
      4
  3. SpartaneC Пользователь

    Регистрация:
    03.10.15
    Сообщения:
    49
    Симпатии:
    34
    Пол:
    Мужской
    @DoHaTeJIJIo, вероятность того что вопрос этим решится маловероятна)

    @Notty, держи
     

    Вложения:

    • piss.sma
      Размер файла:
      16,1 КБ
      Просмотров:
      7
    Notty нравится это.
  4. GIT VIP user

    Регистрация:
    15.05.15
    Сообщения:
    163
    Симпатии:
    22
    Пол:
    Мужской
    А это делает этот плагин?
     
  5. BaJIepbI4 Пользователь

    Регистрация:
    12.05.15
    Сообщения:
    1.070
    Симпатии:
    210
    Пол:
    Мужской
    Skype:
    BaJIepbI4_sky
    Дает возможность пописать на труп игрока.