Raised This Month: $ Target: $400
 0% 

No Weapon Pickup ... Not Working ..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
uNy
Member
Join Date: Dec 2009
Old 05-17-2010 , 18:42   No Weapon Pickup ... Not Working ..
Reply With Quote #1

Hi ya'll ... i have a problem .. i asked xPaw for a no weapon pickup, that applies just for TERRORISTS ! that means just T cant pick up weapons .. the others, can ! Here is the deal ... this is not making even weapon pickup block at any team ... so please .. someone edit it and make if for T Only .. and one that is working. Thx so much.


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

new g_iMaxPlayers;

public 
plugin_init( ) {
    
register_plugin"No Weapon Pickup""1.0""xPaw" );
    
    
g_iMaxPlayers get_maxplayers( );
    
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerWeaponTouch" );
    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerWeaponTouch" );
}

public 
FwdHamPlayerPickup( const iEntity, const id )
    return ( 
<= id <= g_iMaxPlayers ) ? HAM_SUPERCEDE HAM_IGNORED
__________________
AlliedModders is The BEST !
That's what she said.
steam://connect/80.96.216.53:27015
uNy is offline
JaGareN
Senior Member
Join Date: Mar 2009
Old 05-17-2010 , 18:55   Re: No Weapon Pickup ... Not Working ..
Reply With Quote #2

PHP Code:
if( cs_get_user_team(index) == CS_TEAM_T )
{
       
//code

JaGareN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-17-2010 , 19:09   Re: No Weapon Pickup ... Not Working ..
Reply With Quote #3

You should cache a players team when a team is joined; this will be more efficient than constantly calling get_user_team when this ham forward is fired (which is alot).

The reason it isn't working at all is your forward function name does not match the function name used to register.

RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerWeaponTouch" );
RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerWeaponTouch" );

Try this:
PHP Code:
public FwdHamPlayerWeaponTouch( const iEntity, const id )
    return ( 
<= id <= g_iMaxPlayers ) ? HAM_SUPERCEDE HAM_IGNORED
__________________

Last edited by Bugsy; 05-17-2010 at 19:15.
Bugsy is offline
Old 05-17-2010, 19:11
Bugsy
This message has been deleted by Bugsy.
uNy
Member
Join Date: Dec 2009
Old 05-17-2010 , 20:10   Re: No Weapon Pickup ... Not Working ..
Reply With Quote #5

Ok, i suck that bad ... can someone put that together please ?
__________________
AlliedModders is The BEST !
That's what she said.
steam://connect/80.96.216.53:27015
uNy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-17-2010 , 20:17   Re: No Weapon Pickup ... Not Working ..
Reply With Quote #6

This will work but can be done more efficiently.
PHP Code:
public FwdHamPlayerWeaponTouch( const iEntity, const id )
    return ( ( 
<= id <= g_iMaxPlayers ) && ( cs_get_user_teamid ) == CS_TEAM_T ) ) ? HAM_SUPERCEDE HAM_IGNORED
__________________
Bugsy is offline
uNy
Member
Join Date: Dec 2009
Old 05-17-2010 , 20:21   Re: No Weapon Pickup ... Not Working ..
Reply With Quote #7

So, this is the final thing that i got .. and i can't compile it .. errors everywhere ...


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

new g_iMaxPlayers;

public 
plugin_init( ) {
    
register_plugin"No Weapon Pickup""1.0""xPaw" );
 

 
g_iMaxPlayers get_maxplayers( );
    
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerWeaponTouch" );
    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerWeaponTouch" );
}


public 
FwdHamPlayerWeaponTouch( const iEntity, const id )
    return ( ( 
<= id <= g_iMaxPlayers ) && ( cs_get_user_teamid ) == CS_TEAM_T ) ? HAM_SUPERCEDE HAM_IGNORED


Errors:

/groups/amxmodx/tmp3/textKEDH34.sma(10) : warning 217: loose indentation
/groups/amxmodx/tmp3/textKEDH34.sma(12) : warning 217: loose indentation
/groups/amxmodx/tmp3/textKEDH34.sma(1 : error 017: undefined symbol "cs_get_user_team"
__________________
AlliedModders is The BEST !
That's what she said.
steam://connect/80.96.216.53:27015

Last edited by uNy; 05-17-2010 at 20:23.
uNy is offline
Reply


Thread Tools
Display Modes

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 03:39.


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