Hello everyone.
Can someone help me with this.
I have a plugin which allow same team players to pass trough each other so in this way avoid blocking.
They can pass trough each other only if press key E and is hold.
Ok now i have into another plugin Unstuck option! what i am trying to do is to block execute the Unstuck code if key E is pressed ... i try with this but does not work!
Code:
stock is_player_stuck(id) { // Check if a player is stuck
if(!is_user_alive(id)) return false;
static Float:originF[3]; pev(id, pev_origin, originF)
engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0)
if(get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
return true;
return false;
}
public Auto_Unstuck(taskid)
{
new id = taskid - TASK_AUTO_UNSTUCK
new button = get_user_button(id)
// Check if key E is pressed
if((button & IN_USE))
return
if(g_isalive[id] && is_player_stuck(id) && get_pcvar_num(cvar_autounstuck))
{
// Check if player is stuck
ExecuteForward(g_forwards[UNSTUCK_PRE], g_fwDummyResult, id);
if(g_fwDummyResult >= PLUGIN_HANDLED) // The game mode didn't accept some conditions
return;
// Move to an initial spawn
if(get_pcvar_num(cvar_randspawn))
do_random_spawn(id) // random spawn (including CSDM)
else
do_random_spawn(id, 1) // regular spawn
client_print(id, print_chat, "You should be un-stucked now!")
}
}
I don't understand why the code after // Check if key E is pressed ..... is still executed?
Thank you.