Unstuck by mouse aim with bind for admins only

Unpaid Requests, Public Plugins
Post Reply
Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

Unstuck by mouse aim with bind for admins only

#1

Post by Zjox » 5 years ago

Hello,
I want plugin that i can unstuck anyone by command from it with aim
I aim on player stucked and i bind the command will you make then he get unstucked, hope you get my idea
Same as Slay Aim, Thanks a lot!

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#2

Post by Night Fury » 5 years ago

Working on it.

Edit:

Aim to anyone & say in the chat ( normal chat ) "/ze_unstuck".
It requires unstuck plugin by Raheem.
( Sorry for being late, i'd connection issues ).
  1. #include <zombie_escape>
  2. #include <ze_unstuck>
  3.  
  4. #define ADMIN_ACCESS ADMIN_IMMUNITY
  5.  
  6. new g_iStuckPlayerId
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("[ZE] Unstuck on aim", "1.0", "Jack GamePlay")
  11.     register_event("StatusValue", "getId", "be", "1=2", "2!0")
  12.     register_event("StatusValue", "removeId", "be", "1=1", "2=0")
  13.     register_clcmd("say /ze_unstuck", "Cmd_Unstuck")
  14. }
  15.  
  16. public getId()
  17. {
  18.     g_iStuckPlayerId = read_data(2)
  19. }
  20.  
  21. public removeId()
  22. {
  23.     g_iStuckPlayerId = 0
  24. }
  25.  
  26. public Cmd_Unstuck(id)
  27. {
  28.     if (!(get_user_flags(id) && ADMIN_ACCESS))
  29.         return PLUGIN_HANDLED
  30.  
  31.     if (is_user_alive(g_iStuckPlayerId))
  32.     {
  33.         if (is_user_stuck(g_iStuckPlayerId))
  34.         {
  35.             ze_unstuck_player(g_iStuckPlayerId)
  36.         }
  37.         else
  38.         {
  39.             new szName[32]
  40.             get_user_name(g_iStuckPlayerId, szName, charsmax(szName))
  41.             ze_colored_print(id, "!g%s !tis not stuck!y.", szName)
  42.             return PLUGIN_HANDLED
  43.         }
  44.     }
  45.     else if (g_iStuckPlayerId == 0)
  46.     {
  47.         ze_colored_print(id, "!tYou need to aim to alive player!y.")
  48.         return PLUGIN_HANDLED
  49.     }
  50.     else
  51.     {
  52.         ze_colored_print(id, "!tPlayer must be alive.")
  53.         return PLUGIN_HANDLED
  54.     }
  55.  
  56.     return PLUGIN_CONTINUE
  57. }
  58.  
  59. stock is_user_stuck(id)
  60. {
  61.     new Float:fOrigin[3], iHull
  62.  
  63.     get_entvar(id, var_origin, fOrigin)
  64.     iHull = (get_entvar(id, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN
  65.  
  66.     engfunc(EngFunc_TraceHull, fOrigin, fOrigin, 0, iHull, id, 0)
  67.    
  68.     if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
  69.         return true
  70.  
  71.     return false
  72. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#3

Post by Zjox » 5 years ago

Jack GamePlay wrote: 5 years ago Working on it.
OK, I am waiting you

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#4

Post by Night Fury » 5 years ago

Zjox wrote: 5 years ago
Jack GamePlay wrote: 5 years ago Working on it.
OK, I am waiting you

Updated: viewtopic.php?p=8810#p8810
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#5

Post by Zjox » 5 years ago

Jack GamePlay wrote: 5 years ago Working on it.

Edit:

Aim to anyone & say in the chat ( normal chat ) "/ze_unstuck".
It requires unstuck plugin by Raheem.
( Sorry for being late, i'd connection issues ).
  1. #include <zombie_escape>
  2. #include <ze_unstuck>
  3.  
  4. #define ADMIN_ACCESS ADMIN_IMMUNITY
  5.  
  6. new g_iStuckPlayerId
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("[ZE] Unstuck on aim", "1.0", "Jack GamePlay")
  11.     register_event("StatusValue", "getId", "be", "1=2", "2!0")
  12.     register_event("StatusValue", "removeId", "be", "1=1", "2=0")
  13.     register_clcmd("say /ze_unstuck", "Cmd_Unstuck")
  14. }
  15.  
  16. public getId()
  17. {
  18.     g_iStuckPlayerId = read_data(2)
  19. }
  20.  
  21. public removeId()
  22. {
  23.     g_iStuckPlayerId = 0
  24. }
  25.  
  26. public Cmd_Unstuck(id)
  27. {
  28.     if (!(get_user_flags(id) && ADMIN_ACCESS))
  29.         return PLUGIN_HANDLED
  30.  
  31.     if (is_user_alive(g_iStuckPlayerId))
  32.     {
  33.         if (is_user_stuck(g_iStuckPlayerId))
  34.         {
  35.             ze_unstuck_player(g_iStuckPlayerId)
  36.         }
  37.         else
  38.         {
  39.             new szName[32]
  40.             get_user_name(g_iStuckPlayerId, szName, charsmax(szName))
  41.             ze_colored_print(id, "!g%s !tis not stuck!y.", szName)
  42.             return PLUGIN_HANDLED
  43.         }
  44.     }
  45.     else if (g_iStuckPlayerId == 0)
  46.     {
  47.         ze_colored_print(id, "!tYou need to aim to alive player!y.")
  48.         return PLUGIN_HANDLED
  49.     }
  50.     else
  51.     {
  52.         ze_colored_print(id, "!tPlayer must be alive.")
  53.         return PLUGIN_HANDLED
  54.     }
  55.  
  56.     return PLUGIN_CONTINUE
  57. }
  58.  
  59. stock is_user_stuck(id)
  60. {
  61.     new Float:fOrigin[3], iHull
  62.  
  63.     get_entvar(id, var_origin, fOrigin)
  64.     iHull = (get_entvar(id, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN
  65.  
  66.     engfunc(EngFunc_TraceHull, fOrigin, fOrigin, 0, iHull, id, 0)
  67.    
  68.     if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
  69.         return true
  70.  
  71.     return false
  72. }
It's not compiling,
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// Unstuck_By_Aim.sma
//
// G:\ZE Sources\scripting\Unstuck_By_Aim.sma(2) : fatal error 100: cannot read from file: "ze_unstuck"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file G:\ZE Sources\scripting\compiled\Unstuck_By_Aim.amx (compile failed).
//
// Compilation Time: 0.41 sec
// ----------------------------------------

Press enter to exit ...
How to fix this? and when i type /ze_unstuck it will be hidden ? i want it to be hidden no one see it. and Thanks a lot :)

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#6

Post by Zjox » 5 years ago

@Jack, I have question can you discover that player are AFK in case he is crouching? and make for all afk's crouching automatic unstucking for a period time, is it possible or not?

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#7

Post by Raheem » 5 years ago

Zjox wrote: 5 years ago @Jack, I have question can you discover that player are AFK in case he is crouching? and make for all afk's crouching automatic unstucking for a period time, is it possible or not?
Won't be very accurate, but we can make something like: If player have speed <= 1.0 for X seconds then unstuck him. One more thing that we can detect the stuck of player with any enitiy but if we make auto unstuck if you have semiclip and player go inside another player he will get unstuck.
If you are not running semiclip or running fixed version so it's simple to use auto unstuck here: https://forums.alliedmods.net/showthread.php?p=441576

Jack, you can make if he pressed button like E when aiming to any player to get auto unstuck. Or admin will need to bind for example b to say /unstuck.
He who fails to plan is planning to fail

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#8

Post by Zjox » 5 years ago

Raheem wrote: 5 years ago
Zjox wrote: 5 years ago @Jack, I have question can you discover that player are AFK in case he is crouching? and make for all afk's crouching automatic unstucking for a period time, is it possible or not?
Won't be very accurate, but we can make something like: If player have speed <= 1.0 for X seconds then unstuck him. One more thing that we can detect the stuck of player with any enitiy but if we make auto unstuck if you have semiclip and player go inside another player he will get unstuck.
If you are not running semiclip or running fixed version so it's simple to use auto unstuck here: https://forums.alliedmods.net/showthread.php?p=441576

Jack, you can make if he pressed button like E when aiming to any player to get auto unstuck. Or admin will need to bind for example b to say /unstuck.
I want unstuck bind for admins only, what jack made is not compiling can you please fix it :D

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#9

Post by Night Fury » 5 years ago

Change "say /ze_unstuck" with any word but add before it +.
Ex: +unstuck
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#10

Post by Zjox » 5 years ago

Jack GamePlay wrote: 5 years ago Change "s#include <zombie_escape>
#include <ze_unstuck>

#define ADMIN_ACCESS ADMIN_IMMUNITY

new g_iStuckPlayerId

public plugin_init()
{
register_plugin("[ZE] Unstuck on aim", "1.0", "Jack GamePlay")
register_event("StatusValue", "getId", "be", "1=2", "2!0")
register_event("StatusValue", "removeId", "be", "1=1", "2=0")
register_clcmd("+Unstuck", "Cmd_Unstuck")
}

public getId()
{
g_iStuckPlayerId = read_data(2)
}

public removeId()
{
g_iStuckPlayerId = 0
}

public Cmd_Unstuck(id)
{
if (!(get_user_flags(id) && ADMIN_ACCESS))
return PLUGIN_HANDLED

if (is_user_alive(g_iStuckPlayerId))
{
if (is_user_stuck(g_iStuckPlayerId))
{
ze_unstuck_player(g_iStuckPlayerId)
}
else
{
new szName[32]
get_user_name(g_iStuckPlayerId, szName, charsmax(szName))
ze_colored_print(id, "!g%s !tis not stuck!y.", szName)
return PLUGIN_HANDLED
}
}
else if (g_iStuckPlayerId == 0)
{
ze_colored_print(id, "!tYou need to aim to alive player!y.")
return PLUGIN_HANDLED
}
else
{
ze_colored_print(id, "!tPlayer must be alive.")
return PLUGIN_HANDLED
}

return PLUGIN_CONTINUE
}

stock is_user_stuck(id)
{
new Float:fOrigin[3], iHull

get_entvar(id, var_origin, fOrigin)
iHull = (get_entvar(id, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN

engfunc(EngFunc_TraceHull, fOrigin, fOrigin, 0, iHull, id, 0)

if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
return true

return false
}ay /ze_unstuck" with any word but add before it +.
Ex: +unstuck
Same Problem: why you are not testing it before giving me, you just wastes the time yours and my !!!! :(

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#11

Post by Night Fury » 5 years ago

Zjox wrote: 5 years ago Same Problem:
why you are not testing it before giving me, you just wastes the time yours and my !!!! :(
Have you read this line?!
It requires unstuck plugin by Raheem.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#12

Post by Zjox » 5 years ago

Jack GamePlay wrote: 5 years ago
Zjox wrote: 5 years ago Same Problem:
why you are not testing it before giving me, you just wastes the time yours and my !!!! :(
Have you read this line?!
It requires unstuck plugin by Raheem.
SOS!!
I already have it, and using Automatic Unstuck and Manual Unstuck /Unstuck Coded by @Raheeem,
The problem that it's not compiling, help please!

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#13

Post by Night Fury » 5 years ago

Errors?
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#14

Post by Zjox » 5 years ago

Jack GamePlay wrote: 5 years agoErrors?
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// cUnstuck_By_Aim.sma
//
// G:\Zombie Escape\scripting\cUnstuck_By_Aim.sma(2) : fatal error 100: cannot read from file: "ze_unstuck"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file G:\Zombie Escape\scripting\compiled\cUnstuck_By_Aim.amx (compile failed).
//
// Compilation Time: 0.55 sec
// ----------------------------------------

Press enter to exit ...
Code After Edit:
  1. #include <zombie_escape>
  2. #include <ze_unstuck>
  3.  
  4. #define ADMIN_ACCESS ADMIN_IMMUNITY
  5.  
  6. new g_iStuckPlayerId
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin("[ZE] Unstuck on aim", "1.0", "Jack GamePlay")
  11.     register_event("StatusValue", "getId", "be", "1=2", "2!0")
  12.     register_event("StatusValue", "removeId", "be", "1=1", "2=0")
  13.     register_clcmd("+Unstuck", "Cmd_Unstuck")
  14. }
  15.  
  16. public getId()
  17. {
  18.     g_iStuckPlayerId = read_data(2)
  19. }
  20.  
  21. public removeId()
  22. {
  23.     g_iStuckPlayerId = 0
  24. }
  25.  
  26. public Cmd_Unstuck(id)
  27. {
  28.     if (!(get_user_flags(id) && ADMIN_ACCESS))
  29.         return PLUGIN_HANDLED
  30.  
  31.     if (is_user_alive(g_iStuckPlayerId))
  32.     {
  33.         if (is_user_stuck(g_iStuckPlayerId))
  34.         {
  35.             ze_unstuck_player(g_iStuckPlayerId)
  36.         }
  37.         else
  38.         {
  39.             new szName[32]
  40.             get_user_name(g_iStuckPlayerId, szName, charsmax(szName))
  41.             ze_colored_print(id, "!g%s !tis not stuck!y.", szName)
  42.             return PLUGIN_HANDLED
  43.         }
  44.     }
  45.     else if (g_iStuckPlayerId == 0)
  46.     {
  47.         ze_colored_print(id, "!tYou need to aim to alive player!y.")
  48.         return PLUGIN_HANDLED
  49.     }
  50.     else
  51.     {
  52.         ze_colored_print(id, "!tPlayer must be alive.")
  53.         return PLUGIN_HANDLED
  54.     }
  55.  
  56.     return PLUGIN_CONTINUE
  57. }
  58.  
  59. stock is_user_stuck(id)
  60. {
  61.     new Float:fOrigin[3], iHull
  62.  
  63.     get_entvar(id, var_origin, fOrigin)
  64.     iHull = (get_entvar(id, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN
  65.  
  66.     engfunc(EngFunc_TraceHull, fOrigin, fOrigin, 0, iHull, id, 0)
  67.    
  68.     if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
  69.         return true
  70.  
  71.     return false
  72. }
So what i can do now? Already said the error before but you don't read :(

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#15

Post by Raheem » 5 years ago

You must place ze_unstuck.inc in your includes folder, or just use this:
    1. #include <zombie_escape>
    2.  
    3. #define ADMIN_ACCESS ADMIN_IMMUNITY
    4.  
    5. native ze_unstuck_player(id)
    6.  
    7. new g_iStuckPlayerId
    8.  
    9. public plugin_init()
    10. {
    11.     register_plugin("[ZE] Unstuck on aim", "1.0", "Jack GamePlay")
    12.     register_event("StatusValue", "getId", "be", "1=2", "2!0")
    13.     register_event("StatusValue", "removeId", "be", "1=1", "2=0")
    14.     register_clcmd("+Unstuck", "Cmd_Unstuck")
    15. }
    16.  
    17. public getId()
    18. {
    19.     g_iStuckPlayerId = read_data(2)
    20. }
    21.  
    22. public removeId()
    23. {
    24.     g_iStuckPlayerId = 0
    25. }
    26.  
    27. public Cmd_Unstuck(id)
    28. {
    29.     if (!(get_user_flags(id) && ADMIN_ACCESS))
    30.         return PLUGIN_HANDLED
    31.  
    32.     if (is_user_alive(g_iStuckPlayerId))
    33.     {
    34.         if (is_user_stuck(g_iStuckPlayerId))
    35.         {
    36.             ze_unstuck_player(g_iStuckPlayerId)
    37.         }
    38.         else
    39.         {
    40.             new szName[32]
    41.             get_user_name(g_iStuckPlayerId, szName, charsmax(szName))
    42.             ze_colored_print(id, "!g%s !tis not stuck!y.", szName)
    43.             return PLUGIN_HANDLED
    44.         }
    45.     }
    46.     else if (g_iStuckPlayerId == 0)
    47.     {
    48.         ze_colored_print(id, "!tYou need to aim to alive player!y.")
    49.         return PLUGIN_HANDLED
    50.     }
    51.     else
    52.     {
    53.         ze_colored_print(id, "!tPlayer must be alive.")
    54.         return PLUGIN_HANDLED
    55.     }
    56.  
    57.     return PLUGIN_CONTINUE
    58. }
    59.  
    60. stock is_user_stuck(id)
    61. {
    62.     new Float:fOrigin[3], iHull
    63.  
    64.     get_entvar(id, var_origin, fOrigin)
    65.     iHull = (get_entvar(id, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN
    66.  
    67.     engfunc(EngFunc_TraceHull, fOrigin, fOrigin, 0, iHull, id, 0)
    68.    
    69.     if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
    70.         return true
    71.  
    72.     return false
    73. }
He who fails to plan is planning to fail

Zjox
Member
Member
Austria
Posts: 23
Joined: 5 years ago
Contact:

#16

Post by Zjox » 5 years ago

Hello,
The code @Raheem added is compiling now:
  1. #include <zombie_escape>
  2.  
  3. #define ADMIN_ACCESS ADMIN_IMMUNITY
  4.  
  5. native ze_unstuck_player(id)
  6.  
  7. new g_iStuckPlayerId
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin("[ZE] Unstuck on aim", "1.0", "Jack GamePlay")
  12.     register_event("StatusValue", "getId", "be", "1=2", "2!0")
  13.     register_event("StatusValue", "removeId", "be", "1=1", "2=0")
  14.     register_clcmd("+Unstuck", "Cmd_Unstuck")
  15. }
  16.  
  17. public getId()
  18. {
  19.     g_iStuckPlayerId = read_data(2)
  20. }
  21.  
  22. public removeId()
  23. {
  24.     g_iStuckPlayerId = 0
  25. }
  26.  
  27. public Cmd_Unstuck(id)
  28. {
  29.     if (!(get_user_flags(id) && ADMIN_ACCESS))
  30.         return PLUGIN_HANDLED
  31.  
  32.     if (is_user_alive(g_iStuckPlayerId))
  33.     {
  34.         if (is_user_stuck(g_iStuckPlayerId))
  35.         {
  36.             ze_unstuck_player(g_iStuckPlayerId)
  37.         }
  38.         else
  39.         {
  40.             new szName[32]
  41.             get_user_name(g_iStuckPlayerId, szName, charsmax(szName))
  42.             ze_colored_print(id, "!g%s !tis not stuck!y.", szName)
  43.             return PLUGIN_HANDLED
  44.         }
  45.     }
  46.     else if (g_iStuckPlayerId == 0)
  47.     {
  48.         ze_colored_print(id, "!tYou need to aim to alive player!y.")
  49.         return PLUGIN_HANDLED
  50.     }
  51.     else
  52.     {
  53.         ze_colored_print(id, "!tPlayer must be alive.")
  54.         return PLUGIN_HANDLED
  55.     }
  56.  
  57.     return PLUGIN_CONTINUE
  58. }
  59.  
  60. stock is_user_stuck(id)
  61. {
  62.     new Float:fOrigin[3], iHull
  63.  
  64.     get_entvar(id, var_origin, fOrigin)
  65.     iHull = (get_entvar(id, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN
  66.  
  67.     engfunc(EngFunc_TraceHull, fOrigin, fOrigin, 0, iHull, id, 0)
  68.    
  69.     if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
  70.         return true
  71.  
  72.     return false
  73. }
But the plugins is not working at all,
First of everything i try to Unstuck anyone by bind "t" "+Unstuck" and i doesn't works,
and it says something is not right, %s(Player Name) is not stuck and i did not aim on him,
Also i want to use Aim Unstuck while i am dead too, add this option!
i hope you @Jack test what you code, because due to not testing your codes will leads to wasting time, and too much talking!
Thanks anyway!

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest