Raised This Month: $ Target: $400
 0% 

HELP - with /gravity for admins


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pexu
Junior Member
Join Date: Dec 2011
Old 12-19-2011 , 04:39   HELP - with /gravity for admins
Reply With Quote #1

Hello guys im new on Allied Modders, Im polish and i need help with /gravity for VIP's.

So I'v searched everywhere and I managed to find it but there are a few things I would like to change.

This is what i found, it works fine but it resets in new round, and you need to type it in two times before enableing it.

I need:
-type /gravity or /grav to enable or disable gravity
-Dont want it to reset untill admin types in /gravity or /grav again

Thank you all for your help and time, im sorry if there are some spelling mistakes as i sed im from poland and english is my second language

Here: https://forums.alliedmods.net/showthread.php?p=847780

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

#define MAX_PLAYERS 32

#define ADMIN_LEVEL ADMIN_SLAY
#define ADMIN_GRAV 250.0

new g_bHasGrav[MAX_PLAYERS+1]
new sv_gravity

public plugin_init()
{
    sv_gravity = get_cvar_pointer("sv_gravity")

    register_clcmd("say /grav", "cmdGrav", ADMIN_LEVEL)
    register_clcmd("say /gravity", "cmdGrav", ADMIN_LEVEL)
}

public client_putinserver(id)
{
    g_bHasGrav[id] = false
}

public cmdGrav(id)
{
    if( get_user_flags(id) & ADMIN_LEVEL )
    {
        if( (g_bHasGrav[id] = !g_bHasGrav[id]) )
        {
            set_user_gravity(id, ADMIN_GRAV / get_pcvar_float(sv_gravity))
            client_print(id, print_chat, " * You Have Enabled Low Gravity")
        }
        else
        {
            set_user_gravity(id)
            client_print(id, print_chat, " * You Have Disabled Low Gravity")
        }
    }
    return PLUGIN_HANDLED
} 



Last edited by Pexu; 12-19-2011 at 04:40.
Pexu is offline
 


Thread Tools
Display Modes

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 12:06.


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