PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
public plugin_init() {
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
public fwHamPlayerSpawnPost(player) {
if (is_user_alive(player)) {
new Float:origin[3], hull
pev(player, pev_origin, origin)
hull = pev(player, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN
if (!is_hull_vacant(origin, hull,player) && !get_user_noclip(player) && !(pev(player,pev_solid) & SOLID_NOT))
{
//Player is stuck
}
}
}
stock bool:is_hull_vacant(const Float:origin[3], hull,id) {
static tr
engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, tr)
if (!get_tr2(tr, TR_StartSolid) || !get_tr2(tr, TR_AllSolid)) //get_tr2(tr, TR_InOpen))
return true
return false
}
Replace //Player is stuck with whatever action you want to do, also what do you mean you don't want to call any hooks? You at least have to hook Ham_Spawn to run the code on player spawn... You can also skip checking for noclip and non-solid players if you're sure that will never happen in your server. It might be also possible to skip checking if the player is ducking because it doesn't matter the moment the player spawns, he may not be able to duck immediately.
I took the code from this plugin
https://forums.alliedmods.net/showthread.php?p=441576