Raised This Month: $ Target: $400
 0% 

How to restrict weapons without server crashes?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
neverminde
Senior Member
Join Date: Feb 2011
Location: St.Piter
Old 06-10-2012 , 07:29   How to restrict weapons without server crashes?
Reply With Quote #1

Hi,
I want restrict
PHP Code:
weapon_sg550
weapon_g3sg1 
but restmenu.amxx crashes server

I also write this small plugin, but it crashes server too
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin"PLUGIN""VERSION""AUTHOR" )
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
}

public 
Event_CurWeapon(id)
{
    if(!
is_user_alive(id) || !is_user_connected(id)) 
        return 
PLUGIN_CONTINUE
        
    
new temp[2], weapon get_user_weapon(idtemp[0], temp[1])
    if( (
weapon == CSW_G3SG1) || (weapon == CSW_SG550) )
    {
        
engclient_cmd(id"drop""weapon_sg550")
        
engclient_cmd(id"drop""weapon_g3sg1")
    }
    return 
PLUGIN_CONTINUE

For restricting shield I use noshield.amxx plugin by ConnorMcLeod
http://forums.alliedmods.net/showthread.php?p=1308465
It works perfectly and server works stable with it

Can anybody tell me how rewrite noshield.sma for my case ?
neverminde is offline
 



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 06:18.


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