Dabar yra 2019 Rgp 21 02:29

Visos datos yra UTC + 2 valandos


Forumo taisyklės


Šiame forume galite siūlyti idėjas ar prašyti jums reikalingų pluginų. Jei kas nors pradės jį kurti, tai pasirašys Jūsų sukurtoje temoje. Niekada nepykite, jei niekas neatsako į Jūsų prašymą. Gal tai tiesiog per sudėtinga, arba reikalauja per daug darbo.



 Puslapis 11 [ 5 pranešimai(ų) ] 
Autorius Žinutė
 Pranešimo tema: Pls fix this Plugin... Grab Plugin for 1.8.3 REHLDS
Žinutės numeris: #1  StandartinėParašytas: 2018 Gru 20 13:13 
O taip. Jis jau surinko 50 žinučių!

Užsiregistravo: 2016 Spa 21 18:47
Pranešimai: 81
Karma: 0
Hello, can anyone fix problems there ?
5: ML Not found
disarm dont work .
give zero speed dont work.
splint to the screen dont work.

Need it for my knife server....

  1. #include < amxmodx >
  2. #include < amxmisc >
  3. #include < fakemeta >
  4. #include < hamsandwich >
  5.  
  6. #define PLUGIN      "[All mod] Grab"
  7. #define VERSION     "2.1"
  8. #define AUTHOR      "Ian Cammarata / Opo4uMapy"
  9.  
  10. // Options
  11. #define ADMIN       ADMIN_LEVEL_F       //Флаг админа
  12. #define RESON_KICK  "Kick by plugin grab"   //РŸС€РёС‡РёРЅР° РєРёРєР°
  13. #define GRAB_MENU   //РžС‚РєС€С‹РІР°С‚СŒ РјРµРЅСŽ гшаба или нет. Если нет сделайте так //#define GRAB_MENU (Стандаштно откшыто)
  14.  
  15. enum //Цвет гшаба
  16. {
  17.     r = 0.0,    //Red
  18.     g = 0.0,    //Green
  19.     b = 255.0//Blue
  20.  
  21.     a = 200.0   //Alpha
  22. };
  23. //
  24. new const Menu[][] =
  25. {
  26.     "",
  27.     "MENU_1",
  28.     "MENU_2",
  29.     "MENU_3",
  30.     "MENU_4",
  31.     "MENU_5",
  32.     "MENU_6",
  33.     "MENU_7"
  34. };
  35.  
  36. #define TSK_CHKE 50
  37.  
  38. #define SF_FADEOUT 0
  39.  
  40. new client_data[33][4]
  41. #define GRABBED  0
  42. #define GRABBER  1
  43. #define GRAB_LEN 2
  44. #define FLAGS   3
  45.  
  46. #define CDF_IN_PUSH   (1<<0)
  47. #define CDF_IN_PULL   (1<<1)
  48. #define CDF_NO_CHOKE  (1<<2)
  49.  
  50.  
  51. //Cvar Pointers
  52. new p_enabled, p_players_only
  53. new p_throw_force, p_min_dist, p_speed, p_grab_force
  54. new p_choke_time, p_choke_dmg, p_auto_choke
  55. new p_glow
  56. new speed_off[33]
  57. //Pseudo Constants
  58. new MAXPLAYERS
  59. new SVC_SCREENSHAKE, SVC_SCREENFADE, WTF_DAMAGE
  60.  
  61. public plugin_init( )
  62. {
  63.     register_plugin(PLUGIN, VERSION, AUTHOR)
  64.     register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
  65.     RegisterHam(Ham_Spawn, "player", "SpawnPlayer")
  66.  
  67.     p_enabled = register_cvar( "gp_enabled", "1" )
  68.     p_players_only = register_cvar( "gp_players_only", "0" )
  69.    
  70.     p_min_dist = register_cvar ( "gp_min_dist", "90" )
  71.     p_throw_force = register_cvar( "gp_throw_force", "1500" )
  72.     p_grab_force = register_cvar( "gp_grab_force", "8" )
  73.     p_speed = register_cvar( "gp_speed", "5" )
  74.    
  75.     p_choke_time = register_cvar( "gp_choke_time", "1.5" )
  76.     p_choke_dmg = register_cvar( "gp_choke_dmg", "5" )
  77.     p_auto_choke = register_cvar( "gp_auto_choke", "1" )
  78.    
  79.     p_glow = register_cvar( "gp_glow", "1" )
  80.    
  81.     register_clcmd( "amx_grab", "force_grab", ADMIN, "Grab client & teleport to you." )
  82.     register_clcmd( "+grab", "grab", ADMIN, "bind a key to +grab" )
  83.     register_clcmd( "-grab", "unset_grabbed" )
  84.    
  85.     register_clcmd( "+push", "push", ADMIN, "bind a key to +push" )
  86.     register_clcmd( "-push", "push" )
  87.     register_clcmd( "+pull", "pull", ADMIN, "bind a key to +pull" )
  88.     register_clcmd( "-pull", "pull" )
  89.     register_clcmd( "push", "push2" )
  90.     register_clcmd( "pull", "pull2" )
  91.    
  92.     register_clcmd( "drop" ,"throw" )
  93.    
  94.     register_event( "DeathMsg", "DeathMsg", "a" )
  95.    
  96.     register_forward( FM_PlayerPreThink, "fm_player_prethink" )
  97.    
  98.     register_dictionary( "grab_plus.txt" )
  99.    
  100.     MAXPLAYERS = get_maxplayers()
  101.    
  102.     SVC_SCREENFADE = get_user_msgid( "ScreenFade" )
  103.     SVC_SCREENSHAKE = get_user_msgid( "ScreenShake" )
  104.     WTF_DAMAGE = get_user_msgid( "Damage" )
  105.  
  106.     register_dictionary("grab_new.txt");
  107. }
  108.  
  109. public plugin_precache( )
  110.     precache_sound( "player/PL_PAIN2.WAV" )
  111.  
  112. public fm_player_prethink( id )
  113. {
  114.     new target
  115.     //Search for a target
  116.     if ( client_data[id][GRABBED] == -1 )
  117.     {
  118.         new Float:orig[3], Float:ret[3]
  119.         get_view_pos( id, orig )
  120.         ret = vel_by_aim( id, 9999 )
  121.        
  122.         ret[0] += orig[0]
  123.         ret[1] += orig[1]
  124.         ret[2] += orig[2]
  125.        
  126.         target = traceline( orig, ret, id, ret )
  127.        
  128.         if( 0 < target <= MAXPLAYERS )
  129.         {
  130.             if( is_grabbed( target, id ) ) return FMRES_IGNORED
  131.             set_grabbed( id, target )
  132.         }
  133.         else if( !get_pcvar_num( p_players_only ) )
  134.         {
  135.             new movetype
  136.             if( target && pev_valid( target ) )
  137.             {
  138.                 movetype = pev( target, pev_movetype )
  139.                 if( !( movetype == MOVETYPE_WALK || movetype == MOVETYPE_STEP || movetype == MOVETYPE_TOSS ) )
  140.                     return FMRES_IGNORED
  141.             }
  142.             else
  143.             {
  144.                 target = 0
  145.                 new ent = engfunc( EngFunc_FindEntityInSphere, -1, ret, 12.0 )
  146.                 while( !target && ent > 0 )
  147.                 {
  148.                     movetype = pev( ent, pev_movetype )
  149.                     if( ( movetype == MOVETYPE_WALK || movetype == MOVETYPE_STEP || movetype == MOVETYPE_TOSS )
  150.                             && ent != id  )
  151.                         target = ent
  152.                     ent = engfunc( EngFunc_FindEntityInSphere, ent, ret, 12.0 )
  153.                 }
  154.             }
  155.             if( target )
  156.             {
  157.                 if( is_grabbed( target, id ) ) return FMRES_IGNORED
  158.                 set_grabbed( id, target )
  159.             }
  160.         }
  161.     }
  162.    
  163.     target = client_data[id][GRABBED]
  164.     //If they've grabbed something
  165.     if( target > 0 )
  166.     {
  167.         if( !pev_valid( target ) || ( pev( target, pev_health ) < 1 && pev( target, pev_max_health ) ) )
  168.         {
  169.             unset_grabbed( id )
  170.             return FMRES_IGNORED
  171.         }
  172.          
  173.         //Use key choke
  174.         if( pev( id, pev_button ) & IN_USE )
  175.             do_choke( id )
  176.        
  177.         //Push and pull
  178.         new cdf = client_data[id][FLAGS]
  179.         if ( cdf & CDF_IN_PULL )
  180.             do_pull( id )
  181.         else if ( cdf & CDF_IN_PUSH )
  182.             do_push( id )
  183.        
  184.         if( target > MAXPLAYERS ) grab_think( id )
  185.     }
  186.    
  187.     //If they're grabbed
  188.     target = client_data[id][GRABBER]
  189.     if( target > 0 ) grab_think( target )
  190.    
  191.     return FMRES_IGNORED
  192. }
  193.  
  194. public grab_think( id ) //id of the grabber
  195. {
  196.     new target = client_data[id][GRABBED]
  197.    
  198.     //Keep grabbed clients from sticking to ladders
  199.     if( pev( target, pev_movetype ) == MOVETYPE_FLY && !(pev( target, pev_button ) & IN_JUMP ) ) client_cmd( target, "+jump;wait;-jump" )
  200.    
  201.     //Move targeted client
  202.     new Float:tmpvec[3], Float:tmpvec2[3], Float:torig[3], Float:tvel[3]
  203.    
  204.     get_view_pos( id, tmpvec )
  205.    
  206.     tmpvec2 = vel_by_aim( id, client_data[id][GRAB_LEN] )
  207.    
  208.     torig = get_target_origin_f( target )
  209.    
  210.     new force = get_pcvar_num( p_grab_force )
  211.    
  212.     tvel[0] = ( ( tmpvec[0] + tmpvec2[0] ) - torig[0] ) * force
  213.     tvel[1] = ( ( tmpvec[1] + tmpvec2[1] ) - torig[1] ) * force
  214.     tvel[2] = ( ( tmpvec[2] + tmpvec2[2] ) - torig[2] ) * force
  215.    
  216.     set_pev( target, pev_velocity, tvel )
  217. }
  218.  
  219. stock Float:get_target_origin_f( id )
  220. {
  221.     new Float:orig[3]
  222.     pev( id, pev_origin, orig )
  223.    
  224.     //If grabbed is not a player, move origin to center
  225.     if( id > MAXPLAYERS )
  226.     {
  227.         new Float:mins[3], Float:maxs[3]
  228.         pev( id, pev_mins, mins )
  229.         pev( id, pev_maxs, maxs )
  230.        
  231.         if( !mins[2] ) orig[2] += maxs[2] / 2
  232.     }
  233.    
  234.     return orig
  235. }
  236.  
  237. public grab( id, level, cid )
  238. {
  239.     if( !cmd_access( id, level, cid, 1 ) || !get_pcvar_num( p_enabled ) ) return PLUGIN_HANDLED
  240.    
  241.     if ( !client_data[id][GRABBED] ) client_data[id][GRABBED] = -1
  242.    
  243.     return PLUGIN_HANDLED
  244. }
  245.  
  246. public SpawnPlayer(id)
  247.     speed_off[id] = false
  248.  
  249. public CurrentWeapon(id)
  250. {
  251.     if(speed_off[id])
  252.         set_pev(id, pev_maxspeed, 00000.0)
  253. }
  254.  
  255. public grab_menu(id)
  256. {
  257.     new name[32]
  258.     new target = client_data[id][GRABBED]
  259.     if(target && is_user_alive(target))
  260.     {
  261.         get_user_name(target, name, charsmax(name))
  262.     }
  263.     new Item[512], Str[10], menu;
  264.  
  265.     formatex(Item, charsmax(Item), "%L", id, "MENU_NAME", name);
  266.     menu = menu_create(Item, "menu_handler")
  267.  
  268.     for(new i = 1; i <= charsmax(Menu); i++)
  269.     {
  270.         num_to_str(i, Str, charsmax(Str));
  271.  
  272.         formatex(Item, charsmax(Item), "%L", id, Menu[i]);
  273.         menu_additem(menu, Item, Str, 0);
  274.     }
  275.     formatex(Item, charsmax(Item), "%L", id, "MENU_EXIT");
  276.     menu_setprop(menu, MPROP_EXITNAME, Item);
  277.  
  278.     menu_display(id, menu, 0);
  279.  
  280.     return PLUGIN_HANDLED;
  281. }
  282.      
  283. public menu_handler(id, menu, item)
  284. {
  285.     if(item == MENU_EXIT)
  286.     {
  287.         menu_destroy(menu)
  288.         return PLUGIN_HANDLED
  289.     }
  290.          
  291.     new data[6], iName[64], access, callback
  292.     menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
  293.          
  294.     new key = str_to_num(data)
  295.     new target = client_data[id][GRABBED]
  296.          
  297.     switch(key)
  298.     {
  299.         case 1:
  300.         {
  301.             if(target && is_user_alive(target))
  302.             {
  303.                 server_cmd("kick #%d ^"%s^"", get_user_userid(target), RESON_KICK)
  304.             }
  305.         }
  306.         case 2:
  307.         {
  308.             if(target && is_user_alive(target))
  309.             {
  310.                 user_kill(target)
  311.             }
  312.         }
  313.         case 3:
  314.         {
  315.             if(target && is_user_alive(target))
  316.             {
  317.                 fm_strip_user_weapons(target)
  318.                 fm_give_item(target, "weapon_knife")
  319.             }
  320.         }
  321.         case 4:
  322.         {
  323.             if(target && is_user_alive(target))
  324.             {
  325.                 set_pev(target, pev_maxspeed, 00000.0)
  326.                 speed_off[target] = true
  327.             }
  328.         }
  329.         case 5:
  330.         {
  331.             if(target && is_user_alive(target))
  332.             {
  333.                 set_pev(target, pev_maxspeed, 240.0)
  334.                 speed_off[target] = false
  335.             }
  336.         }
  337.         case 6:
  338.         {
  339.             if(target && is_user_alive(target))
  340.             {
  341.                 set_pev(target, pev_health, 1.0)
  342.             }
  343.         }
  344.         case 7:
  345.         {
  346.             if(target && is_user_alive(target))
  347.             {
  348.                 set_pev(target, pev_punchangle, { 400.0, 999.0, 400.0 })
  349.             }
  350.         }
  351.     }
  352.     return PLUGIN_HANDLED
  353. }
  354.  
  355. public throw( id )
  356. {
  357.     new target = client_data[id][GRABBED]
  358.     if( target > 0 )
  359.     {
  360.         set_pev( target, pev_velocity, vel_by_aim( id, get_pcvar_num(p_throw_force) ) )
  361.         unset_grabbed( id )
  362.         return PLUGIN_HANDLED
  363.     }
  364.  
  365.     return PLUGIN_CONTINUE
  366. }
  367.  
  368. public unset_grabbed( id )
  369. {
  370.     new target = client_data[id][GRABBED]
  371.     if( target > 0 && pev_valid( target ) )
  372.     {
  373.         set_pev( target, pev_renderfx, kRenderFxNone )
  374.         set_pev( target, pev_rendercolor, {255.0, 255.0, 255.0} )
  375.         set_pev( target, pev_rendermode, kRenderNormal )
  376.         set_pev( target, pev_renderamt, 16.0 )
  377.        
  378.         if( 0 < target <= MAXPLAYERS )
  379.             client_data[target][GRABBER] = 0
  380.     }
  381.     show_menu(id, 0, "^n", 1)
  382.     client_data[id][GRABBED] = 0
  383. }
  384.  
  385. //Grabs onto someone
  386. public set_grabbed( id, target )
  387. {
  388.     if( get_pcvar_num( p_glow ) )
  389.     {
  390.         set_pev( target, pev_renderfx, kRenderFxGlowShell )
  391.         set_pev( target, pev_rendercolor, {r, g, b})
  392.         set_pev( target, pev_rendermode, kRenderTransColor )
  393.         set_pev( target, pev_renderamt, a )
  394.     }
  395.    
  396.     if( 0 < target <= MAXPLAYERS )
  397.         client_data[target][GRABBER] = id
  398.     client_data[id][FLAGS] = 0
  399.     client_data[id][GRABBED] = target
  400.     new name[33], name2[33]
  401.     get_user_name(id, name, 32)
  402.     get_user_name(target, name2, 32)
  403.     if(get_user_team(target)==1 || get_user_team(target)==2)
  404.     {
  405.         ChatColor(target, "%L", target, "CHAT_1", name)  
  406.         ChatColor(id, "%L", id, "CHAT_2", name2)
  407.         #if defined GRAB_MENU
  408.         grab_menu(id)
  409.         #endif
  410.     }
  411.     else
  412.     {
  413.         ChatColor(id, "%L", id, "CHAT_3")  
  414.     }
  415.     new Float:torig[3], Float:orig[3]
  416.     pev( target, pev_origin, torig )
  417.     pev( id, pev_origin, orig )
  418.     client_data[id][GRAB_LEN] = floatround( get_distance_f( torig, orig ) )
  419.     if( client_data[id][GRAB_LEN] < get_pcvar_num( p_min_dist ) ) client_data[id][GRAB_LEN] = get_pcvar_num( p_min_dist )
  420. }
  421.  
  422. public push( id )
  423. {
  424.     client_data[id][FLAGS] ^= CDF_IN_PUSH
  425.     return PLUGIN_HANDLED
  426. }
  427.  
  428. public pull( id )
  429. {
  430.     client_data[id][FLAGS] ^= CDF_IN_PULL
  431.     return PLUGIN_HANDLED
  432. }
  433.  
  434. public push2( id )
  435. {
  436.     if( client_data[id][GRABBED] > 0 )
  437.     {
  438.         do_push( id )
  439.         return PLUGIN_HANDLED
  440.     }
  441.     return PLUGIN_CONTINUE
  442. }
  443.  
  444. public pull2( id )
  445. {
  446.     if( client_data[id][GRABBED] > 0 )
  447.     {
  448.         do_pull( id )
  449.         return PLUGIN_HANDLED
  450.     }
  451.     return PLUGIN_CONTINUE
  452. }
  453.  
  454. public do_push( id )
  455.     if( client_data[id][GRAB_LEN] < 9999 )
  456.         client_data[id][GRAB_LEN] += get_pcvar_num( p_speed )
  457.  
  458. public do_pull( id )
  459. {
  460.     new mindist = get_pcvar_num( p_min_dist )
  461.     new len = client_data[id][GRAB_LEN]
  462.    
  463.     if( len > mindist )
  464.     {
  465.         len -= get_pcvar_num( p_speed )
  466.         if( len < mindist ) len = mindist
  467.         client_data[id][GRAB_LEN] = len
  468.     }
  469.     else if( get_pcvar_num( p_auto_choke ) )
  470.         do_choke( id )
  471. }
  472.  
  473. public do_choke( id )
  474. {
  475.     new target = client_data[id][GRABBED]
  476.     if( client_data[id][FLAGS] & CDF_NO_CHOKE || id == target || target > MAXPLAYERS) return
  477.    
  478.     new dmg = get_pcvar_num( p_choke_dmg )
  479.     new vec[3]
  480.     FVecIVec( get_target_origin_f( target ), vec )
  481.    
  482.     message_begin( MSG_ONE, SVC_SCREENSHAKE, _, target )
  483.     write_short( 999999 ) //amount
  484.     write_short( 9999 ) //duration
  485.     write_short( 999 ) //frequency
  486.     message_end( )
  487.    
  488.     message_begin( MSG_ONE, SVC_SCREENFADE, _, target )
  489.     write_short( 9999 ) //duration
  490.     write_short( 100 ) //hold
  491.     write_short( SF_FADE_MODULATE ) //flags
  492.     write_byte( 200 ) //r
  493.     write_byte( 0 ) //g
  494.     write_byte( 0 ) //b
  495.     write_byte( 200 ) //a
  496.     message_end( )
  497.    
  498.     message_begin( MSG_ONE, WTF_DAMAGE, _, target )
  499.     write_byte( 0 ) //damage armor
  500.     write_byte( dmg ) //damage health
  501.     write_long( DMG_CRUSH ) //damage type
  502.     write_coord( vec[0] ) //origin[x]
  503.     write_coord( vec[1] ) //origin[y]
  504.     write_coord( vec[2] ) //origin[z]
  505.     message_end( )
  506.        
  507.     message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  508.     write_byte( TE_BLOODSTREAM )
  509.     write_coord( vec[0] ) //pos.x
  510.     write_coord( vec[1] ) //pos.y
  511.     write_coord( vec[2] + 15 ) //pos.z
  512.     write_coord( random_num( 0, 255 ) ) //vec.x
  513.     write_coord( random_num( 0, 255 ) ) //vec.y
  514.     write_coord( random_num( 0, 255 ) ) //vec.z
  515.     write_byte( 70 ) //col index
  516.     write_byte( random_num( 50, 250 ) ) //speed
  517.     message_end( )
  518.    
  519.     new health = pev( target, pev_health ) - dmg
  520.     set_pev( target, pev_health, float( health ) )
  521.     if( health < 1 ) dllfunc( DLLFunc_ClientKill, target )
  522.    
  523.     emit_sound( target, CHAN_BODY, "player/PL_PAIN2.WAV", VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
  524.    
  525.     client_data[id][FLAGS] ^= CDF_NO_CHOKE
  526.     set_task( get_pcvar_float( p_choke_time ), "clear_no_choke", TSK_CHKE + id )
  527. }
  528.  
  529. public clear_no_choke( tskid )
  530. {
  531.     new id = tskid - TSK_CHKE
  532.     client_data[id][FLAGS] ^= CDF_NO_CHOKE
  533. }
  534.  
  535. //Grabs the client and teleports them to the admin
  536. public force_grab(id, level, cid)
  537. {
  538.     if( !cmd_access( id, level, cid, 1 ) || !get_pcvar_num( p_enabled ) ) return PLUGIN_HANDLED
  539.  
  540.     new arg[33]
  541.     read_argv( 1, arg, 32 )
  542.  
  543.     new targetid = cmd_target( id, arg, 1 )
  544.    
  545.     if( is_grabbed( targetid, id ) ) return PLUGIN_HANDLED
  546.     if( !is_user_alive( targetid ) )
  547.     {
  548.         return PLUGIN_HANDLED
  549.     }
  550.    
  551.     //Safe to tp target to aim spot?
  552.     new Float:tmpvec[3], Float:orig[3], Float:torig[3], Float:trace_ret[3]
  553.     new bool:safe = false, i
  554.    
  555.     get_view_pos( id, orig )
  556.     tmpvec = vel_by_aim( id, get_pcvar_num( p_min_dist ) )
  557.    
  558.     for( new j = 1; j < 11 && !safe; j++ )
  559.     {
  560.         torig[0] = orig[0] + tmpvec[i] * j
  561.         torig[1] = orig[1] + tmpvec[i] * j
  562.         torig[2] = orig[2] + tmpvec[i] * j
  563.        
  564.         traceline( tmpvec, torig, id, trace_ret )
  565.        
  566.         if( get_distance_f( trace_ret, torig ) ) break
  567.        
  568.         engfunc( EngFunc_TraceHull, torig, torig, 0, HULL_HUMAN, 0, 0 )
  569.         if ( !get_tr2( 0, TR_StartSolid ) && !get_tr2( 0, TR_AllSolid ) && get_tr2( 0, TR_InOpen ) )
  570.             safe = true
  571.     }
  572.    
  573.     //Still not safe? Then find another safe spot somewhere around the grabber
  574.     pev( id, pev_origin, orig )
  575.     new try[3]
  576.     orig[2] += 2
  577.     while( try[2] < 3 && !safe )
  578.     {
  579.         for( i = 0; i < 3; i++ )
  580.             switch( try[i] )
  581.             {
  582.                 case 0 : torig[i] = orig[i] + ( i == 2 ? 80 : 40 )
  583.                 case 1 : torig[i] = orig[i]
  584.                 case 2 : torig[i] = orig[i] - ( i == 2 ? 80 : 40 )
  585.             }
  586.        
  587.         traceline( tmpvec, torig, id, trace_ret )
  588.        
  589.         engfunc( EngFunc_TraceHull, torig, torig, 0, HULL_HUMAN, 0, 0 )
  590.         if ( !get_tr2( 0, TR_StartSolid ) && !get_tr2( 0, TR_AllSolid ) && get_tr2( 0, TR_InOpen )
  591.                 && !get_distance_f( trace_ret, torig ) ) safe = true
  592.        
  593.         try[0]++
  594.         if( try[0] == 3 )
  595.         {
  596.             try[0] = 0
  597.             try[1]++
  598.             if( try[1] == 3 )
  599.             {
  600.                 try[1] = 0
  601.                 try[2]++
  602.             }
  603.         }
  604.     }
  605.    
  606.     if( safe )
  607.     {
  608.         set_pev( targetid, pev_origin, torig )
  609.         set_grabbed( id, targetid )
  610.     }
  611.  
  612.     return PLUGIN_HANDLED
  613. }
  614.  
  615. public is_grabbed( target, grabber )
  616. {
  617.     for( new i = 1; i <= MAXPLAYERS; i++ )
  618.         if( client_data[i][GRABBED] == target )
  619.         {
  620.             unset_grabbed( grabber )
  621.             return true
  622.         }
  623.     return false
  624. }
  625.  
  626. public DeathMsg( )
  627.     kill_grab( read_data( 2 ) )
  628.  
  629. public client_disconnect( id )
  630. {
  631.     kill_grab( id )
  632.     speed_off[id] = false
  633.     return PLUGIN_CONTINUE
  634. }
  635.  
  636. public kill_grab( id )
  637. {
  638.     //If given client has grabbed, or has a grabber, unset it
  639.     if( client_data[id][GRABBED] )
  640.         unset_grabbed( id )
  641.     else if( client_data[id][GRABBER] )
  642.         unset_grabbed( client_data[id][GRABBER] )
  643. }
  644.  
  645. stock traceline( const Float:vStart[3], const Float:vEnd[3], const pIgnore, Float:vHitPos[3] )
  646. {
  647.     engfunc( EngFunc_TraceLine, vStart, vEnd, 0, pIgnore, 0 )
  648.     get_tr2( 0, TR_vecEndPos, vHitPos )
  649.     return get_tr2( 0, TR_pHit )
  650. }
  651.  
  652. stock get_view_pos( const id, Float:vViewPos[3] )
  653. {
  654.     new Float:vOfs[3]
  655.     pev( id, pev_origin, vViewPos )
  656.     pev( id, pev_view_ofs, vOfs )      
  657.    
  658.     vViewPos[0] += vOfs[0]
  659.     vViewPos[1] += vOfs[1]
  660.     vViewPos[2] += vOfs[2]
  661. }
  662.  
  663. stock Float:vel_by_aim( id, speed = 1 )
  664. {
  665.     new Float:v1[3], Float:vBlah[3]
  666.     pev( id, pev_v_angle, v1 )
  667.     engfunc( EngFunc_AngleVectors, v1, v1, vBlah, vBlah )
  668.    
  669.     v1[0] *= speed
  670.     v1[1] *= speed
  671.     v1[2] *= speed
  672.    
  673.     return v1
  674. }
  675. stock fm_give_item(index, const item[])
  676. {
  677.     if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
  678.         return 0
  679.  
  680.     new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
  681.     if (!pev_valid(ent))
  682.         return 0
  683.  
  684.     new Float:origin[3];
  685.     pev(index, pev_origin, origin)
  686.     set_pev(ent, pev_origin, origin)
  687.     set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
  688.     dllfunc(DLLFunc_Spawn, ent)
  689.  
  690.     new save = pev(ent, pev_solid)
  691.     dllfunc(DLLFunc_Touch, ent, index)
  692.     if (pev(ent, pev_solid) != save)
  693.         return ent
  694.  
  695.     engfunc(EngFunc_RemoveEntity, ent)
  696.  
  697.     return -1
  698. }
  699.  
  700. stock fm_strip_user_weapons(id)
  701. {
  702.         static ent
  703.         ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"))
  704.         if (!pev_valid(ent)) return;
  705.        
  706.         dllfunc(DLLFunc_Spawn, ent)
  707.         dllfunc(DLLFunc_Use, ent, id)
  708.         engfunc(EngFunc_RemoveEntity, ent)
  709. }
  710.  
  711. stock ChatColor(const id, const input[], any:...)
  712. {
  713.     new count = 1, players[32]
  714.     static msg[191]
  715.     vformat(msg, 190, input, 3)
  716.    
  717.     replace_all(msg, 190, "!g", "^4")
  718.     replace_all(msg, 190, "!y", "^1")
  719.     replace_all(msg, 190, "!team", "^3")
  720.    
  721.     if (id) players[0] = id; else get_players(players, count, "ch")
  722.     {
  723.         for (new i = 0; i < count; i++)
  724.         {
  725.             if (is_user_connected(players[i]))
  726.             {
  727.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  728.                 write_byte(players[i]);
  729.                 write_string(msg);
  730.                 message_end();
  731.             }
  732.         }
  733.     }
  734. }


Lang File:

  1. [en]
  2. MENU_NAME = \yYou took a grab: \r%s
  3.  
  4. MENU_1 = Kill
  5. MENU_2 = Disarm
  6. MENU_3 = Return weapons
  7. MENU_4 = Pull
  8. MENU_5 = To make a zero speed
  9. MENU_6 = Give standard speed
  10. MENU_7 = Leave 1 HP
  11. MENU_8 = To spin the screen
  12.  
  13. MENU_EXIT = Exit^n^n
  14.  
  15. CHAT_1 = !y[!gGrab!y] Administrator !team%s !ytook you !ggrab
  16. CHAT_2 = !y[!gGrab!y] You took grab !yplayer !team%s
  17. CHAT_3 = !y[!gGrab!y] You took grab !teamWeapon


Atsijungęs
 Aprašymas  
 
 Pranešimo tema: Re: Pls fix this Plugin... Grab Plugin for 1.8.3 REHLDS
Žinutės numeris: #2  StandartinėParašytas: 2018 Gru 20 17:02 
Moderatorius
Vartotojo avataras

Užsiregistravo: 2012 Rgp 03 01:12
Pranešimai: 4497
Karma: 126

Miestas: Vilnius
any error logs ?



_________________
Paveikslėlis
Paveikslėlis
Paveikslėlis
Atsijungęs
 Aprašymas  
 
 Pranešimo tema: Re: Pls fix this Plugin... Grab Plugin for 1.8.3 REHLDS
Žinutės numeris: #3  StandartinėParašytas: 2018 Gru 20 17:47 
O taip. Jis jau surinko 50 žinučių!

Užsiregistravo: 2016 Spa 21 18:47
Pranešimai: 81
Karma: 0
I see that DISARM dont work as only thing now. They get auto back weapon when i disarm anyone.. Maybe can remove "KICK" from this and add Burn ?? it would be cool. No logs there :/


Atsijungęs
 Aprašymas  
 
 Pranešimo tema: Re: Pls fix this Plugin... Grab Plugin for 1.8.3 REHLDS
Žinutės numeris: #4  StandartinėParašytas: 2018 Gru 20 19:36 
Gana aktyvus vartotojas
Vartotojo avataras

Užsiregistravo: 2017 Bal 04 11:44
Pranešimai: 365
Karma: 2

Miestas: Alytus
Infamous2017 rašė:
I see that DISARM dont work as only thing now. They get auto back weapon when i disarm anyone.. Maybe can remove "KICK" from this and add Burn ?? it would be cool. No logs there :/



.. I think we need logs or see amx_plugins works or unknown ????



_________________
PATYLĖK!!! Bent protingesnis atrodysi :))
Atsijungęs
 Aprašymas  
 
 Pranešimo tema: Re: Pls fix this Plugin... Grab Plugin for 1.8.3 REHLDS
Žinutės numeris: #5  StandartinėParašytas: 2018 Gru 20 22:34 
O taip. Jis jau surinko 50 žinučių!

Užsiregistravo: 2016 Spa 21 18:47
Pranešimai: 81
Karma: 0
I cant send logs.. There are no logs. Should i create an Video ? When i grab anyone and use "Disarm" then he get directly the Knife back without disarm. :(


Atsijungęs
 Aprašymas  
 
Rodyti paskutinius pranešimus:  Rūšiuoti pagal  
 Puslapis 11 [ 5 pranešimai(ų) ] 

Visos datos yra UTC + 2 valandos


Dabar prisijungę

Vartotojai naršantys šį forumą: Registruotų vartotojų nėra ir 3 svečių


Jūs negalite kurti naujų temų šiame forume
Jūs negalite atsakinėti į temas šiame forume
Jūs negalite redaguoti savo pranešimų šiame forume
Jūs negalite trinti savo pranešimų šiame forume
Jūs negalite prikabinti failų šiame forume

Ieškoti:
Pereiti į:  

cron