AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Stopping weaponswitch (https://forums.alliedmods.net/showthread.php?t=29985)

TheDemonIII 06-19-2006 21:23

Stopping weaponswitch
 
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 :D

jtp10181 06-19-2006 21:28

weapon arena already does this.

TheDemonIII 06-19-2006 22:26

well i dont think i asked for a plugin that does it... i just asked how to do it

Lee 06-19-2006 22:49

Well, maybe if you looked at that plugin, you might see how it's done?

jtp10181 06-20-2006 06:43

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.

VEN 06-20-2006 14:07

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.


All times are GMT -4. The time now is 08:00.

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