Raised This Month: $12 Target: $400
 3% 

Strip weapons and block buy commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zpoke
Senior Member
Join Date: Aug 2009
Location: Sweden
Old 11-02-2009 , 14:07   Strip weapons and block buy commands
Reply With Quote #1

hello, is this the best way to strip weapons and block buy commands ?

if it's not, please tell me how to do, THANKS !
Attached Files
File Type: sma Get Plugin or Get Source (no_weapons.sma - 804 views - 907 Bytes)
Zpoke is offline
Hx7r
Member
Join Date: Mar 2009
Old 11-02-2009 , 14:21   Re: Strip weapons and block buy commands
Reply With Quote #2

use ham_spawn
..
https://forums.alliedmods.net/showthread.php?t=102611
Hx7r is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 11-02-2009 , 14:22   Re: Strip weapons and block buy commands
Reply With Quote #3

You should include <engine> because the client_kill() forward requires it
__________________
unnyquee is offline
master4life
Senior Member
Join Date: Mar 2006
Location: Germany
Old 11-02-2009 , 14:33   Re: Strip weapons and block buy commands
Reply With Quote #4

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;

__________________


[img]http://img714.**************/img714/8612/33726.png[/img]

Last edited by master4life; 11-02-2009 at 14:39.
master4life is offline
Send a message via ICQ to master4life Send a message via MSN to master4life Send a message via Skype™ to master4life
lazarev
Veteran Member
Join Date: Sep 2008
Old 11-02-2009 , 15:00   Re: Strip weapons and block buy commands
Reply With Quote #5

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;


Last edited by lazarev; 11-02-2009 at 15:03. Reason: added "kill" command block
lazarev is offline
Old 11-02-2009, 15:23
master4life
This message has been deleted by master4life. Reason: bla
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 11-03-2009 , 12:10   Re: Strip weapons and block buy commands
Reply With Quote #6

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);
    }

__________________
Think Positive - Stay Positive
drumzplaya13 is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 11-03-2009 , 13:25   Re: Strip weapons and block buy commands
Reply With Quote #7

drumzplaya13 check my post -.-
lazarev is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 11-03-2009 , 15:33   Re: Strip weapons and block buy commands
Reply With Quote #8

If you don't want to block all those commands you could just 'hide' the buyzone entity.
matsi is offline
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 11-03-2009 , 16:35   Re: Strip weapons and block buy commands
Reply With Quote #9

Quote:
Originally Posted by lazarev View Post
drumzplaya13 check my post -.-
Yes I know, I was just giving him another option.


Quote:
Originally Posted by matsi View Post
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.
__________________
Think Positive - Stay Positive
drumzplaya13 is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 11-03-2009 , 16:59   Re: Strip weapons and block buy commands
Reply With Quote #10

Quote:
Originally Posted by drumzplaya13 View Post
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.
matsi 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 20:32.


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