AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Strip weapons and block buy commands (https://forums.alliedmods.net/showthread.php?t=108189)

Zpoke 11-02-2009 14:07

Strip weapons and block buy commands
 
1 Attachment(s)
hello, is this the best way to strip weapons and block buy commands ?:)

if it's not, please tell me how to do, THANKS !

Hx7r 11-02-2009 14:21

Re: Strip weapons and block buy commands
 
use ham_spawn
..
https://forums.alliedmods.net/showthread.php?t=102611

unnyquee 11-02-2009 14:22

Re: Strip weapons and block buy commands
 
You should include <engine> because the client_kill() forward requires it :)

master4life 11-02-2009 14:33

Re: Strip weapons and block buy commands
 
Test this

PHP Code:

#include < amxmodx >
#include < fakemeta >
#include < cstrike >
#include < fun >
#include < hamsandwich >

static const g_szBuyCmds[ ][ ] = {
    
"usp""glock""deagle""p228""elites""fn57""m3""xm1014""mp5""tmp""p90""mac10""ump45""ak47"
    
"galil""famas""sg552""m4a1""aug""scout""awp""g3sg1""sg550""m249""vest""vesthelm""flash""hegren",
    
"sgren""defuser""nvgs""shield""primammo""secammo""km45""9x19mm""nighthawk""228compact""12gauge",
    
"autoshotgun""smg""mp""c90""cv47""defender""clarion""krieg552""bullpup""magnum""d3au1""krieg550",
    
"buyammo1""buyammo2"


public 
plugin_init( ) {
    
register_plugin"Strip Weapons & Block Selfkill""1.0""master4life" );
    
    
register_forwardFM_ClientKill"FwdClientKill" );
    
RegisterHamHam_Spawn"player""FwdHamSpawnPlayer_Post");    
    
    for( new 
isizeof g_szBuyCmdsi++ )
        
register_clcmdg_szBuyCmds], "BlockBuyCmd" 
}

public 
BlockBuyCmdid ) return PLUGIN_HANDLED;

public 
FwdHamSpawnPlayer_Postid ) {
    if( 
is_user_aliveid ) ) {
        
strip_user_weaponsid );
        
cs_set_user_moneyid);
        
give_itemid"weapon_knife" );
    }
}

public 
FwdClientKillid ) {
    
client_printidprint_chat"You cannot kill yourself at this moment in time!" );
    
client_printidprint_console"You cannot kill yourself at this moment in time!" );
        
    return 
FMRES_SUPERCEDE;



lazarev 11-02-2009 15:00

Re: Strip weapons and block buy commands
 
PHP Code:

#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < fun >
#include < hamsandwich >
 
public plugin_init()
{
    
register_plugin"Strip weapons & block buying""1.0" "Juice" );
    
    
RegisterHamHam_Spawn"player""HamPlayerSpawn");
    
    
register_forwardFM_ClientKill"FwdClientKill" );
    
    new 
iEnt = -1;
    while ( ( 
iEnt find_ent_by_classiEnt"func_buyzone" ) ) )
                
entity_set_intiEntEV_INT_team);
}

public 
HamPlayerSpawnid ) {
    if( 
is_user_connectedid ) && is_user_aliveid ) )
        
strip_user_weaponsid );
}


public 
FwdClientKillid ) {
    
client_printidprint_chat"You can't use kill command!" );
    return 
FMRES_SUPERCEDE;



drumzplaya13 11-03-2009 12:10

Re: Strip weapons and block buy commands
 
you could just use the no buy zone plugin and find a plugin which strips weapons already.

maybe this plugin will work for you for striping all weapons, it works for me. Stewie created it. I didnt. I just did some research to find it on the forum.

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fun>

public plugin_init()
{
    
register_plugin("hello""1.0""Stewie!");
    
RegisterHam(Ham_Spawn"player""player_spawn"1);
}

public 
player_spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weapons(id);
    }



lazarev 11-03-2009 13:25

Re: Strip weapons and block buy commands
 
drumzplaya13 check my post -.-

matsi 11-03-2009 15:33

Re: Strip weapons and block buy commands
 
If you don't want to block all those commands you could just 'hide' the buyzone entity.

drumzplaya13 11-03-2009 16:35

Re: Strip weapons and block buy commands
 
Quote:

Originally Posted by lazarev (Post 979794)
drumzplaya13 check my post -.-

Yes I know, I was just giving him another option.


Quote:

Originally Posted by matsi (Post 979950)
If you don't want to block all those commands you could just 'hide' the buyzone entity.

There is a buyzone plugin which you can specify nowhere/specific/everywhere for buyzones.

matsi 11-03-2009 16:59

Re: Strip weapons and block buy commands
 
Quote:

Originally Posted by drumzplaya13 (Post 980056)
Yes I know, I was just giving him another option.




There is a buyzone plugin which you can specify nowhere/specific/everywhere for buyzones.

The thing with buyzone is that you can't just remove it. If you remove buyzone the game would create buyzone for each spawn automaticly ( correct me if im wrong ). So one thing you can do is that you create new buyzone and set its size.

->

Requires fakemeta
Code:
new Float:g_buyzone_min[3] = { -8192.0, -8192.0, -8192.0 } new Float:g_buyzone_max[3] = { -8191.0, -8191.0, -8191.0 } public plugin_init() {     g_buyzone = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "func_buyzone" ) )     dllfunc( DLLFunc_Spawn, g_buyzone )     engfunc( EngFunc_SetSize, g_buyzone, g_buyzone_min, g_buyzone_max ) }

From VEN's Buyzone Range [Everywhere/Nowhere/Default] as you said there is existing plugin.


All times are GMT -4. The time now is 17:38.

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