new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_wall"));
// set a name to the entity
set_pev(ent,pev_classname,g_class);
// set model
losuj = random(2);
switch(losuj)
{
case 0:
{
engfunc(EngFunc_SetModel,ent,"models/QTM_CodMod/1.mdl");
}
case 1:
{
engfunc(EngFunc_SetModel,ent,"models/QTM_CodMod/2.mdl");
}
}
// register a new var. for origin
static Float:xorigin[3];
get_user_hitpoint(id,xorigin);
// check if user is aiming at the air
if(engfunc(EngFunc_PointContents,xorigin) == CONTENTS_SKY)
{
client_print(id,print_chat,"Nie mozesz postawic bytu w powietrzu!");
return PLUGIN_HANDLED;
}
// set sizes
static Float:p_mins[3], Float:p_maxs[3];
p_mins = PALLET_MINS;
p_maxs = PALLET_MAXS;
engfunc(EngFunc_SetSize, ent, p_mins, p_maxs);
set_pev(ent, pev_mins, p_mins);
set_pev(ent, pev_maxs, p_maxs );
set_pev(ent, pev_absmin, p_mins);
set_pev(ent, pev_absmax, p_maxs );
// set the rock of origin where is user placed
engfunc(EngFunc_SetOrigin, ent, xorigin);
// make the rock solid
set_pev(ent,pev_solid,SOLID_BBOX); // touch on edge, block
// set the movetype
set_pev(ent,pev_movetype,MOVETYPE_FLY); // no gravity, but still collides with stuff
new Float:p_cvar_health = get_pcvar_float(phealth)+float(cod_get_user_intelligence(id, 1, 1, 1));
set_pev(ent,pev_health,p_cvar_health);
set_pev(ent,pev_takedamage,DAMAGE_YES);
static Float:rvec[3];
pev(id,pev_v_angle,rvec);
rvec[0] = 0.0;
set_pev(ent,pev_angles,rvec);
// drop entity to floor
fm_drop_to_floor(ent);
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
I moje pytanie jest następujące: jak sprawdzić czy byt nie zostanie utworzony w podłodze/ścianie/graczu tworzącym byt/innym graczu/czymkolwiek innym