Raised This Month: $ Target: $400
 0% 

Check Gravity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lexzor
Veteran Member
Join Date: Nov 2020
Old 06-20-2022 , 11:51   Re: Check Gravity
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define ADMIN_FLAG "l"

#define IsValid(%0) (0 < %0 < g_iMaxPlayers)

#if !defined MAX_NAME_LENGTH
    #define MAX_NAME_LENGTH 33
#endif

new g_iMaxPlayers;

public 
plugin_init()
{
    
register_plugin("Gravity Display""1.0"" ");

    
register_clcmd("amxx_checkgravity""grvCmd"read_flags(ADMIN_FLAG), "<name>", -1false);

    
g_iMaxPlayers get_maxplayers();
}

public 
grvCmd(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED

    
new szName[MAX_NAME_LENGTH];
    
read_args(szNamecharsmax(szName));

    new 
iTarget cmd_target(idszName4);

    if(
iTarget && IsValid(iTarget) && is_user_connected(iTarget))
    {
        
get_user_name(iTargetszNamecharsmax(szName))

        if(!
is_user_alive(iTarget))
        {
            
client_print(idprint_console"[GRAVITY] Player %s is not alive"szName);
            return 
PLUGIN_HANDLED;
        }

        
client_print(idprint_console"[GRAVITY] Player %s has %i gravity"szNameget_user_gravity(iTarget));
    }
    else 
client_print(idprint_console"[GRAVITY] Player does not exists or it's not connected");

    return 
PLUGIN_HANDLED


Last edited by lexzor; 06-20-2022 at 11:52.
lexzor 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 11:30.


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