how to unlock the buyzone on all maps to be purchased freely in any place without time limits.
afford to buy normal weapons anywhere in the map, by pressing the B in no time limits.
Sorry for my bad English.
[Solved]
Code:
#include <amxmodx>
#include <engine>
new g_Ent
public plugin_init()
unlockzone()
public unlockzone(){
new buyzone = -1
new Float:absmin[3] = {-8191.0, -8191.0, -8191.0}
new Float:absmax[3] = {8191.0, 8191.0, 8191.0}
if ((buyzone = find_ent_by_class(buyzone, "func_buyzone")))
entity_set_size(buyzone, absmin, absmax)
else{
buyzone = create_entity("func_buyzone")
DispatchSpawn(buyzone)
entity_set_size(buyzone, absmin, absmax)
}
}
public plugin_precache(){
g_Ent = create_entity("info_map_parameters")
DispatchSpawn(g_Ent)
DispatchKeyValue(g_Ent,"buying","0")
DispatchKeyValue(g_Ent, "bombradius", "500")
entity_set_int(g_Ent, EV_INT_iuser1, 1)
}
public pfn_keyvalue(entid){
new classname[32], key[32], value[32]
copy_keyvalue(classname, 31, key, 31, value, 31)
if (equal(classname,"func_buyzone") && is_valid_ent(entid))
remove_entity(entid)
if(is_valid_ent(entid) && equal(classname,"info_map_parameters") && entity_get_int(entid,EV_INT_iuser1)!=1){
DispatchKeyValue(entid,"buying","0")
if (g_Ent){
remove_entity(g_Ent)
g_Ent = 0
}
}
}
__________________