Raised This Month: $ Target: $400
 0% 

disable taking guns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 09-13-2012 , 13:49   disable taking guns
Reply With Quote #1

I want to disallow any team from taking guns on round end. How do i do that?
This one okay, i there is better way?

PHP Code:
new disWep

plugin init
()
{
    
register_logevent("round_end"2"1=Round_End");
    
register_event("HLTV""new_round""a""1=0""2=0")
    
RegisterHam(Ham_Touch"WeapEntTouch");
}

public 
round_end()
{
    
disWep true;
}

public 
new_round()
{
    
disWep false;
}

public 
WeapEntTouch()
{
    if(
disWep)
        return 
HAM_SUPERCEDE;

GhostMan is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-13-2012 , 18:07   Re: disable taking guns
Reply With Quote #2

tag disWep as a bool. Other than that it looks good to me. Event the tag you don't really have to do. But its good practice.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 09-14-2012 , 05:51   Re: disable taking guns
Reply With Quote #3

Code:
RegisterHam(Ham_Touch, "WeapEntTouch");
Where is the entity?!
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 09-14-2012 , 06:49   Re: disable taking guns
Reply With Quote #4

Quote:
Originally Posted by pokemonmaster View Post
Code:
RegisterHam(Ham_Touch, "WeapEntTouch");

Where is the entity?!
Entity is (I think) the player which touch the weapon.
Torge is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 09-14-2012 , 06:58   Re: disable taking guns
Reply With Quote #5

No.

You can use this with <engine> :

PHP Code:
// ...
register_touch"weaponbox""player""CPlayer__TouchWeapon" );
register_touch"armoury_entity""player""CPlayer__TouchWeapon" );
// register_touch( "weapon_shield", "player", "CPlayer__TouchWeapon" );
// ...

public CPlayer__TouchWeaponweaponplayer )
{
    return ( 
disWep ) ? PLUGIN_HANDLED PLUGIN_CONTINUE;

__________________
micapat 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 08:21.


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