actually looking to change someones velocity... when touching an entity...
I have this...
Code:
public client_PreThink(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE;
new flags = entity_get_int(id, EV_INT_flags);
if(haslowgrav[id])
{
if(flags & FL_ONGROUND)
{
set_pev(id,pev_gravity,1.0);
haslowgrav[id] = false;
return PLUGIN_CONTINUE;
}
}
if(hasboost[id])
{
if(flags & FL_ONGROUND)
{
set_pev(id,pev_velocity,{1.0, 1.0, 1.0});
hasboost[id] = false;
return PLUGIN_CONTINUE;
}
}
return PLUGIN_CONTINUE;
}
public fwdTouch(ent, id)
{
new Float:velocity[] = {0.0, 128.0, 0.0};
static szClassname[33];
pev(ent, pev_classname, szClassname, 32);
//...
//...
//what I am trying to do with this entity, is...
//when you touch it it will boost you forwards...
//as if you got thrown forward REALLY FAST.
//and when you land on ground you go back to normal.
else if(equali(szClassname, "booster"))
{
set_pev(id,pev_velocity,velocity);
hasboost[id] = true;
return PLUGIN_HANDLED_MAIN;
}
return PLUGIN_HANDLED_MAIN;
}
As of now when i touch my entity it just does nothing.