AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to disable buy menu? (https://forums.alliedmods.net/showthread.php?t=11041)

XunTric 03-08-2005 10:57

How to disable buy menu?
 
Im working on a plugin where you get weapons on round start. How do i disable the buy menu like on fy maps?

Thanks

xeroblood 03-08-2005 11:11

The way fy_ maps disable buying is a mapping technique and is compiled into the map itself...

XunTric 03-08-2005 11:17

kk, but is there still a way to disable the buy menu? I'm 90% sure ive seen it in a other metamod or amxx plugin.

XxAvalanchexX 03-08-2005 18:27

You could try this:

Code:
#include <amxmodx> #include <engine> public plugin_precache() {    disable_buyzone(); // disable buying    // do it in precache because it is done earlier than plugin_init, and it MIGHT matter } public disable_buyzone() {    // find that info entity    new ent = find_ent_by_class(-1,"info_map_parameters");    // if we couldn't find one, make our own    if(!ent) {       ent = create_entity("info_map_parameters");    }    // disable buying for both teams    DispatchKeyValue(ent,"buying","3");    DispatchSpawn(ent); }

It may not work.

XunTric 03-09-2005 07:51

I'll try now.
Thanks :up:

btw, if it works... where can i put the print when they try to buy?
like "This server is running with RuneScape Mod. You cant buy anything!"

XunTric 03-09-2005 08:04

It works! :D

But where do i place that print? (I tryed at the end of the function, but then i get 4 errors)

People can go on the menu and choose weapon, but then it comes "Counter-Terrorits cant buy weapons on this map" (or something like that... just like on fy maps)
Is there anyway to make it so they cant even get in to the menu?

XxAvalanchexX 03-09-2005 15:14

I don't think you can stop it from coming up at all. You could try registering the text message that says CTs can't buy weapons on this map and then use your own client_print on print_center to override it.

TotalNoobScripter 03-09-2005 16:40

you could register the buy command, and make it do a PLUGIN_HANDLED

also btw...

RuneScape mod? me is interested.

Sp4rt4n 03-09-2005 17:15

off topic section... sounds cool

xeroblood 03-09-2005 19:15

Hrmm, you could try doing what Avalanche said as well as searching for and deleting any "func_buyzone" entities... Some maps dont have them and use the user spawns as a buyzone radius, but maybe that will help?


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

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