Code:
#include <amxmodx>
#include <fakemeta>
new Float:lastMove[33];
public plugin_init()
{
register_forward(FM_PlayerPreThink,"fw_playerprethink",1);
}
public fw_playerprethink(id)
{
static Float:velocity[3];
pev(id,pev_velocity,velocity);
new Float:gtime = get_gametime();
if(velocity[0] || velocity[1] || velocity[2] || !(pev(id,pev_flags) & FL_ONGROUND))
lastMove[id] = gtime;
if(gtime-lastMove[id] >= 5.0)
{
client_print(id,print_chat,"* You haven't moved for five seconds!");
lastMove[id] = gtime;
}
return FMRES_IGNORED;
}
This monitors when they move (have velocity) or get off the ground (FL_ONGROUND is not a part of their entity flags). Then, it records that time. It also checks to see if it's been 5.0 seconds since the last recorded time that they moved.
You'll probably want to not check this on death, and also reset the lastMove time on spawn.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS