Raised This Month: $ Target: $400
 0% 

5 items i need to know


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rjckE
Junior Member
Join Date: Mar 2009
Old 06-04-2009 , 04:38   5 items i need to know
Reply With Quote #1

Hi guys, i need to read about this things:

- Block buy for players.
- Weapons strip.
- Block attack with knife (or something like godmode to all when attacking with knife)
- Block c4 plant.
and the most important:
- I need some code where, if a user drops c4 and no-one picks up, the c4 comes back to the users.

Where can i read about the first 4 and who can help me with the last one?

Thanks for your replies ;)
rjckE is offline
Send a message via MSN to rjckE
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-04-2009 , 04:55   Re: 5 items i need to know
Reply With Quote #2

  1. Code:
    #include <amxmodx> #include <hamsandwich>   new g_iBuyZoneEntSpawn;   public plugin_precache()         g_iBuyZoneEntSpawn = RegisterHam(Ham_Spawn, "func_buyzone", "fwdBuyZoneEntSpawn");   public plugin_init()         DisableHamForward(g_iBuyZoneEntSpawn);   public fwdBuyZoneEntSpawn(iEnt)         return pev_valid(iEnt) ? HAM_SUPERCEDE : HAM_IGNORED;
  2. Code:
    #include <amxmodx> #include <fun> #include <hamsandwich>   #define OFFSET_PRIMARYWEAPON 116   public plugin_init()         RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawn", 1);   public fwdPlayerSpawn(iCl)         if (is_user_alive(iCl))         {                 strip_user_weapons(iCl);                 set_pdata_int(iCl, OFFSET_PRIMARYWEAPON, 0);                 give_item(iCl, "weapon_knife"); // Remove this if you don't want knife         }
  3. Code:
    #include <amxmodx> #include <fakemeta>   public plugin_init()         register_forward(FM_CmdStart, "fwdCmdStart");   public fwdCmdStart(iCl, iHandle) {         if (get_user_weapon(iCl) == CSW_KNIFE)         {                 static iButtons;                 iButtons = get_uc(iHandle, UC_Buttons);                   if (iButtons & IN_ATTACK)                 {                         set_uc(iHandle, UC_Buttons, ~IN_ATTACK);                           return FMRES_SUPERCEDE;                 }                 else if (iButtons & IN_ATTACK2)                 {                         set_uc(iHandle, UC_Buttons, ~IN_ATTACK2);                           return FMRES_SUPERCEDE;                 }         }           return FMRES_IGNORED; }
  4. Code:
    #include <amxmodx> #include <cstrike> #include <hamsandwich>   public plugin_init()         RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawn", 1);   public fwdPlayerSpawn(iCl)         if (is_user_alive(iCl))                 cs_set_user_plant(iCl, 0, 0);
__________________

Last edited by hleV; 06-04-2009 at 05:07.
hleV is offline
raidmax
Junior Member
Join Date: Feb 2008
Old 06-04-2009 , 08:05   Re: 5 items i need to know
Reply With Quote #3

hlev

missing includes in 1st and 2nd plugins
raidmax is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-04-2009 , 08:30   Re: 5 items i need to know
Reply With Quote #4

Sorry. Add
Code:
#include <fakemeta>
in both 1st & 2nd.
__________________
hleV is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-04-2009 , 08:34   Re: 5 items i need to know
Reply With Quote #5

PHP Code:
                if (iButtons IN_ATTACK)
                {
                        
set_uc(iHandleUC_Buttons, ~IN_ATTACK);
 
                        return 
FMRES_SUPERCEDE;
                } 
Buggy thing,blocking attack of knife :/ the problem is with animation, if you could fix it,it will be great :]p
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-04-2009 , 08:38   Re: 5 items i need to know
Reply With Quote #6

i prefer setting nexttimeattack :p
__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-04-2009 , 08:45   Re: 5 items i need to know
Reply With Quote #7

PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 

#define PLUGIN "No Knife Attack2" 
#define VERSION "1.0" 
#define AUTHOR "ConnorMcLeod" 

#define    m_flNextSecondaryAttack    47 

public plugin_init() 

    
register_plugin(PLUGINNAMEVERSIONAUTHOR

    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_knife""Knife_SecondaryAttack"


public 
Knife_SecondaryAttackiEnt 

    
set_pdata_float(iEntm_flNextSecondaryAttack20.04
    return 
HAM_SUPERCEDE 

You mean something like this?
This is too buggy
xbatista is offline
Send a message via Skype™ to xbatista
rjckE
Junior Member
Join Date: Mar 2009
Old 06-04-2009 , 10:56   Re: 5 items i need to know
Reply With Quote #8

Hey hleV, code 1, 2 and 3 worked perfectly ;)

but code 4 didn't work

anyways, thanks a lot man
rjckE is offline
Send a message via MSN to rjckE
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-04-2009 , 14:40   Re: 5 items i need to know
Reply With Quote #9

You can try using this for blocking players from planting C4.
Code:
#include <amxmodx> #include <hamsandwich>   public plugin_init()         RegisterHam(Ham_Touch, "func_buyzone", "fwdTouchBuyZone");   public fwdTouchBuyZone(iEnt, iCl)         return (pev_valid(iEnt) && 1 <= iCl <= 32) ? HAM_SUPERCEDE : HAM_IGNORED;
__________________
hleV is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode