Raised This Month: $ Target: $400
 0% 

Unstuck help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PredatorBlock
AlliedModders Donor
Join Date: Apr 2020
Old 11-01-2020 , 16:24   Unstuck help
Reply With Quote #1

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.

Last edited by PredatorBlock; 11-01-2020 at 16:42.
PredatorBlock is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:20.


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