AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   disable taking guns (https://forums.alliedmods.net/showthread.php?t=195946)

GhostMan 09-13-2012 13:49

disable taking guns
 
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;



Liverwiz 09-13-2012 18:07

Re: disable taking guns
 
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.

pokemonmaster 09-14-2012 05:51

Re: disable taking guns
 
Code:
RegisterHam(Ham_Touch, "WeapEntTouch");
Where is the entity?!

Torge 09-14-2012 06:49

Re: disable taking guns
 
Quote:

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

Where is the entity?!

Entity is (I think) the player which touch the weapon.

micapat 09-14-2012 06:58

Re: disable taking guns
 
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;




All times are GMT -4. The time now is 08:21.

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