1) When I write the following command over the game, I will create a model for the map.
/create
2) Looking at this model, I want to operation on the player when I press the e key.
This is not working where am I making a mistake?
/create
2) Looking at this model, I want to operation on the player when I press the e key.
Код:
#include <amxmodx>
#include <reapi>
#include <xs>
new const MODELS[] = "models/iMac_big.mdl"
new modelsindexs
public plugin_init() {
register_plugin("", "", "")
register_clcmd("say /bring","entityBring")
}
public plugin_precache()
{
modelsindexs = precache_model(MODELS)
}
public entityBring(id)
{
new ent = rg_create_entity("func_button")
new Float:Konum[3]
get_entvar(id,var_origin,Konum)
Konum[2] += 100.0
set_entvar(ent,var_origin,Konum)
set_entvar(ent, var_model, MODELS)
set_entvar(ent, var_modelindex, modelsindexs)
size_model(ent)
SetUse(ent, "push_entity");
}
public push_entity(ent,id)
{
client_print(id,print_chat,"Operation")
}
size_model(ent)
{
new Float:size[3],Float:mins[3],Float:maxs[3]
mins[0] = -16.2
maxs[0] = 16.2
mins[1] = -16.2
maxs[1] = 16.2
mins[2] = -0.0
maxs[2] = 30.0
set_entvar(ent, var_mins, mins)
size[0] = (xs_fsign(mins[0]) * mins[0]) + maxs[0]
size[1] = (xs_fsign(mins[1]) * mins[1]) + maxs[1]
size[2] = (xs_fsign(mins[2]) * mins[2]) + maxs[2]
set_entvar(ent, var_maxs, maxs)
set_entvar(ent, var_size, size)
}