Resolved Unstuck Plugin

Unpaid Requests, Public Plugins
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

Unstuck Plugin

#1

Post by Spir0x » 2 Years Ago

hello i find this bug on all ze servers, on some bugged maps there's not a lot respawn places so player respawn on both places.

Image
I trynna make money, not friends.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#2

Post by johnnysins2000 » 2 Years Ago

Already discussed in this forum

Search the topic
Nobody Is That Busy If They Make Time :roll:

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 609
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#3

Post by Mohamed Alaa » 2 Years Ago

Use semipclip.
Solved.
Want your own mod edition? PM me.
Accepting web projects.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1962
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#4

Post by Raheem » 2 Years Ago

Jack GamePlay wrote:
2 Years Ago
Use semipclip.
Solved.
Best solution i can see. I'll try write unstuck plugin soon for people who still afraid to use semiclip.
You don't know? Learn and you will know.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#5

Post by Spir0x » 2 Years Ago

Yes Raheem i can't put semiclip off cuz some players block teammates! so he can use /unstuck and next update add it on ze main menu :)
I trynna make money, not friends.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1962
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#6

Post by Raheem » 2 Years Ago

Spir0x wrote:
2 Years Ago
Yes Raheem i can't put semiclip off cuz some players block teammates! so he can use /unstuck and next update add it on ze main menu :)
So why you need unstuck and you already have SemiClip?????
You don't know? Learn and you will know.

ArMaGeDDoN
Member
Member
Bosnia & Herzegovina
Posts: 4
Joined: 2 Years Ago
Has thanked: 1 time
Been thanked: 1 time
Contact:

#7

Post by ArMaGeDDoN » 2 Years Ago

Code: Select all

   /* - - - - - - - - - - -

        AMX Mod X script.

          | Author  : Arkshine
          | Plugin  : Unstick Player
          | Version : v1.0.2

        (!) Support : http://forums.alliedmods.net/showthread.php?p=717994#post717994 .
        (!) Requested by Rirre.

        This program is free software; you can redistribute it and/or modify it
        under the terms of the GNU General Public License as published by the
        Free Software Foundation; either version 2 of the License, or (at
        your option) any later version.

        This program is distributed in the hope that it will be useful, but
        WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
        General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software Foundation,
        Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

        ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~


        Description :
        - - - - - - -
            Unstick player via a client command.


        Requirement :
        - - - - - - -
            * All mods, except NS.
            * AMX Mod X 1.7x or higher.


        Modules :
        - - - - -
            * Fakemeta

            
        Credits :
        - - - - - 
            * AMX Mod X Team. ( original plugin )

            
        Changelog :
        - - - - - -
            v1.0.2 : [ 25 nov 2008 ]

                (+) Initial release.

    - - - - - - - - - - - */
    
    #include <amxmodx>
    #include <fakemeta>
    
    
    #define START_DISTANCE  32   // --| The first search distance for finding a free location in the map.
    #define MAX_ATTEMPTS    128  // --| How many times to search in an area for a free space.
    
    
    #define MAX_CLIENTS     32
    
    new Float:gf_LastCmdTime[ MAX_CLIENTS + 1 ];
    new gp_UnstuckFrequency;
    
    // --| Just for readability.
    enum Coord_e { Float:x, Float:y, Float:z };
    
    // --| Macro.
    #define GetPlayerHullSize(%1)  ( ( pev ( %1, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN )
    
    
    public plugin_init ()
    {
        register_plugin ( "Unstick Player", "1.0.2", "Arkshine" );
        
        // --| Cvars.
        gp_UnstuckFrequency = register_cvar ( "amx_unstuck_frequency", "4.0" );
        
        // --| Client command.
        register_clcmd ( "say_team /stuck"  , "ClientCommand_UnStick" );
        register_clcmd ( "say /stuck"       , "ClientCommand_UnStick" );
        register_clcmd ( "say_team /unstuck", "ClientCommand_UnStick" );
        register_clcmd ( "say /unstuck"     , "ClientCommand_UnStick" );
    }
    
    
    public ClientCommand_UnStick ( const id )
    {
        new Float:f_MinFrequency = get_pcvar_float ( gp_UnstuckFrequency );
        new Float:f_ElapsedCmdTime = get_gametime () - gf_LastCmdTime[ id ];
        
        if ( f_ElapsedCmdTime < f_MinFrequency ) 
        {
            client_print ( id, print_chat, "[AMXX] You must wait %.1f seconds before trying to free yourself.", f_MinFrequency - f_ElapsedCmdTime );
            return PLUGIN_HANDLED;
        }
        
        gf_LastCmdTime[ id ] = get_gametime ();
    
        new i_Value;
        
        if ( ( i_Value = UTIL_UnstickPlayer ( id, START_DISTANCE, MAX_ATTEMPTS ) ) != 1 )
        {
            switch ( i_Value )
            {
                case 0  : client_print ( id, print_chat, "[AMXX] Couldn't find a free spot to move you too" );
                case -1 : client_print ( id, print_chat, "[AMXX] You cannot free yourself as dead player" );
            }
        }
        
        return PLUGIN_CONTINUE;
    }
    
    
    UTIL_UnstickPlayer ( const id, const i_StartDistance, const i_MaxAttempts )
    {
        // --| Not alive, ignore.
        if ( !is_user_alive ( id ) )  return -1
        
        static Float:vf_OriginalOrigin[ Coord_e ], Float:vf_NewOrigin[ Coord_e ];
        static i_Attempts, i_Distance;
        
        // --| Get the current player's origin.
        pev ( id, pev_origin, vf_OriginalOrigin );
        
        i_Distance = i_StartDistance;
        
        while ( i_Distance < 1000 )
        {
            i_Attempts = i_MaxAttempts;
            
            while ( i_Attempts-- )
            {
                vf_NewOrigin[ x ] = random_float ( vf_OriginalOrigin[ x ] - i_Distance, vf_OriginalOrigin[ x ] + i_Distance );
                vf_NewOrigin[ y ] = random_float ( vf_OriginalOrigin[ y ] - i_Distance, vf_OriginalOrigin[ y ] + i_Distance );
                vf_NewOrigin[ z ] = random_float ( vf_OriginalOrigin[ z ] - i_Distance, vf_OriginalOrigin[ z ] + i_Distance );
            
                engfunc ( EngFunc_TraceHull, vf_NewOrigin, vf_NewOrigin, DONT_IGNORE_MONSTERS, GetPlayerHullSize ( id ), id, 0 );
            
                // --| Free space found.
                if ( get_tr2 ( 0, TR_InOpen ) && !get_tr2 ( 0, TR_AllSolid ) && !get_tr2 ( 0, TR_StartSolid ) )
                {
                    // --| Set the new origin .
                    engfunc ( EngFunc_SetOrigin, id, vf_NewOrigin );
                    return 1;
                }
            }
            
            i_Distance += i_StartDistance;
        }
        
        // --| Could not be found.
        return 0;
    }    
   
Use this if u need.
BrotherHood | Zombie Escape |
IP: 178.33.132.102:27015


Image

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#8

Post by Spir0x » 2 Years Ago

Thanks Arma :) go post it in new topic in Public plugins if you are the author of it and raheem will release it next update he can add support to main menu
Raheem yes i use semi clip and they cant move!
I trynna make money, not friends.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1962
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#9

Post by Raheem » 2 Years Ago

This won't be official because we assume all our memebrs using ReSemiClip and if you are using ReSemiClip you will never face something like that.
You don't know? Learn and you will know.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#10

Post by johnnysins2000 » 2 Years Ago

https://forums.alliedmods.net/showthrea ... 915&page=2

Here For You :p works Completely Fine for me
Nobody Is That Busy If They Make Time :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest