Raised This Month: $ Target: $400
 0% 

help with give item and restrict all weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
vL.
Senior Member
Join Date: Aug 2009
Location: Estonia
Old 08-06-2010 , 19:57   Re: help with give item and restrict all weapons
Reply With Quote #2

Much useless junk in your script.

Try this one, it removes the buyzone, so no one can buy anything

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <engine>
#include <hamsandwich>

#include <hamsandwich>

#define PLUGIN "Knife Mod + respawn"
#define VERSION "0.1"
#define AUTHOR "LaSsHhH"

// Macros
#if cellbits == 32
#define OFFSET_BZ 235
#else
#define OFFSET_BZ 268
#endif

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
RegisterHam(Ham_Spawn"player""Fwd_Ham_Spawn_Post"1); // Spawns
    
    
register_message(get_user_msgid("StatusIcon" ), "MsgStatusIcon" ); // BuyZone Icon
    
    // Remove buyzone on map
    
remove_entity_name("info_map_parameters");
    
remove_entity_name("func_buyzone");
    
    
// Create own entity to block buying
    
new iEntity create_entity("info_map_parameters");
    
    
DispatchKeyValue(iEntity"buying""3");
    
DispatchSpawn(iEntity);
}

public 
Fwd_Ham_Spawn_Post(id

    
strip_user_weapons(id);
    
    
give_item(id"weapon_knife");
}

public 
MsgStatusIcon(msg_idmsg_destid)
{
    new 
szIcon[8];
    
get_msg_arg_string(2szIcon7);
    
    static const 
BuyZone[ ] = "buyzone";
    
    if(
equal(szIconBuyZone))
    {
        
set_pdata_int(idOFFSET_BZget_pdata_int(idOFFSET_BZ5) & ~(<< 0), 5)
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

PS: Tested, works.

Last edited by vL.; 08-06-2010 at 20:07.
vL. 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 00:12.


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