AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how block command buy and something more. (https://forums.alliedmods.net/showthread.php?t=114134)

AppStore 01-02-2010 06:27

how block command buy and something more.
 
how can I detect the next round ie for example in the zombie plague when choosing a kind of zombie, the next round will get you wanted to know how is the code ..
and wanted to know also as commands blocke purchase, this did not help me.
http://forums.alliedmods.net/showthr...ght=como+block
Thank you very much

Mxnn 01-02-2010 19:08

Re: how block command buy and something more.
 
You can change the map_parameters.. But if you wan't to change only 1 round you can't do it. When you change this you can't come back at least you restart the map..
PHP Code:

#include <engine>
#include <amxmisc>
#include <amxmodx>

public plugin_precache () {
        
//If info_map_parameters exists
        
if (find_ent_by_class(iEnt"info_map_parameters"))
            
//Change the value "buying" to 3:
            //So you know, info_map_parameters is an entity that with their
            //settings you can change the bomb radius and the buy
            //The "buying" parameter has 4 values:
            //0- All can buy
            //1- Only CT can buy
            //2- Only TT can buy
            //Neither can buy
            
DispatchKeyValue("info_map_parameters""buying""3")
        
        else {
            
//If the entity doesn't exists
            //I create the entity, i set the buying value in 3 (previously explained) and i spawn it
            
ENT_CLASS create_entity("info_map_parameters")
            
DispatchKeyValue(ENT_CLASS"buying""3")
            
DispatchSpawn(ENT_CLASS)
        }



Arkshine 01-02-2010 19:11

Re: how block command buy and something more.
 
Bad idea to use plugin_precache because the entities are not created yet. Use the keyvalue forward or hook its spawn.


All times are GMT -4. The time now is 04:07.

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