Raised This Month: $ Target: $400
 0% 

Stopping weaponswitch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheDemonIII
Junior Member
Join Date: Aug 2005
Old 06-19-2006 , 21:23   Stopping weaponswitch
Reply With Quote #1

i'm making a plugin that makes the player only use glock and knife. How do i make it so they can't buy weapons or switch to other weapons other than glock and knife?

thanks
TheDemonIII is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-19-2006 , 21:28  
Reply With Quote #2

weapon arena already does this.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
TheDemonIII
Junior Member
Join Date: Aug 2005
Old 06-19-2006 , 22:26  
Reply With Quote #3

well i dont think i asked for a plugin that does it... i just asked how to do it
TheDemonIII is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-19-2006 , 22:49  
Reply With Quote #4

Well, maybe if you looked at that plugin, you might see how it's done?
Lee is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-20-2006 , 06:43  
Reply With Quote #5

its not that simple. so yes, Lee, has a good point.

you either have to use the restrict plugin or rewrite your own to prevent buying.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
VEN
Veteran Member
Join Date: Jan 2005
Old 06-20-2006 , 14:07  
Reply With Quote #6

Or that:
Code:
#if cellbits == 32     #define OFFSET_MAPZONES 235 #else // amd64     #define OFFSET_MAPZONES 268 #endif #define BIT_BUYZONE (1<<0) #define cs_set_user_nobuy(%1) set_pdata_int(%1, OFFSET_MAPZONES, get_pdata_int(%1, OFFSET_MAPZONES) & ~BIT_BUYZONE) /* stock cs_set_user_nobuy(index)     set_pdata_int(index, OFFSET_MAPZONES, get_pdata_int(index, OFFSET_MAPZONES) & ~BIT_BUYZONE) */ #include <amxmodx> #include <fakemeta> public plugin_init() {     register_plugin("CS Set User NoBuy (offset method)", "0.0.1", "VEN")     register_forward(FM_PlayerPostThink, "forward_player_postthink") } public forward_player_postthink(id) {     if (is_user_alive(id))         cs_set_user_nobuy(id) }

To prevent weapon switch: engclient_cmd(id, "weapon_name") on weapon change.
To prevent weapon collect: block player/weaponbox touch.
VEN 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 08:00.


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