AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to check vacant place (https://forums.alliedmods.net/showthread.php?t=143139)

Jacob 11-14-2010 21:37

how to check vacant place
 
PHP Code:

stock is_hull_vacant(Float:origin[3], hull) {
 
engfunc(EngFunc_TraceHulloriginorigin0hull00)
 if (!
get_tr2(0TR_StartSolid) && !get_tr2(0TR_AllSolid) && get_tr2(0TR_InOpen)) return true;
 return 
false;


hull = (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN

now i want to check that if there is an ent(not human) on this location,how to change the code. :)

Exolent[jNr] 11-14-2010 23:41

Re: how to check vacant place
 
Quote:

Originally Posted by Jacob (Post 1349710)
PHP Code:

stock is_hull_vacant(Float:origin[3], hull) {
 
engfunc(EngFunc_TraceHulloriginorigin0hull00)
 if (!
get_tr2(0TR_StartSolid) && !get_tr2(0TR_AllSolid) && get_tr2(0TR_InOpen)) return true;
 return 
false;


hull = (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN

now i want to check that if there is an ent(not human) on this location,how to change the code. :)

It already does that. Have you even tested it?

Jacob 11-15-2010 02:54

Re: how to check vacant place
 
sorry,i don't understand this code:
PHP Code:

hull = (pev(idpev_flags) & FL_DUCKING) ? HULL_HEAD HULL_HUMAN 

HULL_HUMAN,is it only for human?

Exolent[jNr] 11-15-2010 03:02

Re: how to check vacant place
 
HULL_HUMAN is the hull size for a player standing.
HULL_HEAD is the hull size for a player ducking.

Both of them are for players.

Jacob 11-15-2010 04:24

Re: how to check vacant place
 
Quote:

Originally Posted by Exolent[jNr] (Post 1349797)
HULL_HUMAN is the hull size for a player standing.
HULL_HEAD is the hull size for a player ducking.

Both of them are for players.

is there any way to check common entity?


All times are GMT -4. The time now is 11:27.

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