Raised This Month: $ Target: $400
 0% 

Plugin req


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
da guns
Senior Member
Join Date: Aug 2011
Old 06-17-2013 , 15:09   Plugin req
Reply With Quote #1

Need a plugin where an admin with b flag can use this command

/grav

Can you make it so when an admin with b flag does /grav he can choice either to have 650 gravity or 600
da guns is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-17-2013 , 16:32   Re: Plugin req
Reply With Quote #2

Not Tested yet:

Ps. The "B" flag its ADMIN_LEVEL_B or ADMIN_RESERVATION?

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

new g_pGravity;

public 
plugin_init()
{
    
register_plugin("Gravity",AMXX_VERSION_STR,"Amxx Dev Team");
    
    
register_clcmd("say /grav","cmdGravity",ADMIN_RESERVATION,"Gravity menu");
    
    
g_pGravity get_cvar_pointer("sv_gravity");
}

public 
cmdGravity(id,level,cid)
{
    if(!
cmd_access(id,level,cid,1)) return PLUGIN_HANDLED;
    
    else
    {
        new 
iMenu menu_create("Change a Gravity:","iMenuHandler");
        
        
menu_additem(iMenu,"sv_gravity 600","0");
        
menu_additem(iMenu,"sv_gravity 650","1");
        
        
menu_addblank(iMenu,3);
        
menu_addblank(iMenu,4);
        
        
menu_additem(iMenu,"sv_gravity 800 (DEFAULT)","2");
        
        
menu_setprop(iMenu,MPROP_EXIT,MEXIT_NEVER);
    }
    return 
PLUGIN_HANDLED;
}

public 
iMenuHandler(id,menu,item)
{
    switch(
item)
    {
        case 
0set_pcvar_num(g_pGravity,600);
        
        case 
1set_pcvar_num(g_pGravity,650);
        
        case 
2set_pcvar_num(g_pGravity,800);
    }
    
    
client_print(id,print_chat,"[AMXX] sv_gravity changed to %d",get_pcvar_num(g_pGravity));
    
    return 
PLUGIN_HANDLED;

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-17-2013 at 16:34. Reason: Mistake on case change
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 06-17-2013 , 16:44   Re: Plugin req
Reply With Quote #3

@da guns: You need all players have low gravity or the player who have reservation flag??
If u need only the player with the selected flag, then smiley's code is wrong...
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
da guns
Senior Member
Join Date: Aug 2011
Old 06-17-2013 , 18:12   Re: Plugin req
Reply With Quote #4

Ill try fix it myself if i can if no then i post back
da guns is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 06-17-2013 , 19:29   Re: Plugin req
Reply With Quote #5

Quote:
Originally Posted by ^SmileY View Post
Not Tested yet:

Ps. The "B" flag its ADMIN_LEVEL_B or ADMIN_RESERVATION?

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

new g_pGravity;

public 
plugin_init()
{
    
register_plugin("Gravity",AMXX_VERSION_STR,"Amxx Dev Team");
    
    
register_clcmd("say /grav","cmdGravity",ADMIN_RESERVATION,"Gravity menu");
    
    
g_pGravity get_cvar_pointer("sv_gravity");
}

public 
cmdGravity(id,level,cid)
{
    if(!
cmd_access(id,level,cid,1)) return PLUGIN_HANDLED;
    
    else
    {
        new 
iMenu menu_create("Change a Gravity:","iMenuHandler");
        
        
menu_additem(iMenu,"sv_gravity 600","0");
        
menu_additem(iMenu,"sv_gravity 650","1");
        
        
menu_addblank(iMenu,3);
        
menu_addblank(iMenu,4);
        
        
menu_additem(iMenu,"sv_gravity 800 (DEFAULT)","2");
        
        
menu_setprop(iMenu,MPROP_EXIT,MEXIT_NEVER);
    }
    return 
PLUGIN_HANDLED;
}

public 
iMenuHandler(id,menu,item)
{
    switch(
item)
    {
        case 
0set_pcvar_num(g_pGravity,600);
        
        case 
1set_pcvar_num(g_pGravity,650);
        
        case 
2set_pcvar_num(g_pGravity,800);
    }
    
    
client_print(id,print_chat,"[AMXX] sv_gravity changed to %d",get_pcvar_num(g_pGravity));
    
    return 
PLUGIN_HANDLED;

forgot to add menu_display to code...

Code:
#include <amxmodx> #include <amxmisc> new g_pGravity; public plugin_init() {     register_plugin("Gravity",AMXX_VERSION_STR,"Amxx Dev Team");         register_clcmd("say /grav","cmdGravity",ADMIN_RESERVATION,"Gravity menu");         g_pGravity = get_cvar_pointer("sv_gravity"); } public cmdGravity(id,level,cid) {     if(!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED;         else     {         new iMenu = menu_create("Change a Gravity:","iMenuHandler");                 menu_additem(iMenu,"sv_gravity 600","0");         menu_additem(iMenu,"sv_gravity 650","1");                 menu_addblank(iMenu,3);         menu_addblank(iMenu,4);                 menu_additem(iMenu,"sv_gravity 800 (DEFAULT)","2");                 menu_setprop(iMenu,MPROP_EXIT,MEXIT_NEVER);         menu_display( id, iMenu );     }     return PLUGIN_HANDLED; } public iMenuHandler(id,menu,item) {     switch(item)     {         case 0: set_pcvar_num(g_pGravity,600);                 case 1: set_pcvar_num(g_pGravity,650);                 case 2: set_pcvar_num(g_pGravity,800);     }         client_print(id,print_chat,"[AMXX] sv_gravity changed to %d",get_pcvar_num(g_pGravity));         return PLUGIN_HANDLED; }
__________________
Blizzard_87 is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 06-17-2013 , 21:45   Re: Plugin req
Reply With Quote #6

Just one off topic question is it possible to make a single player have like 500 gravity, when another have for example 100?
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 06-17-2013 , 21:49   Re: Plugin req
Reply With Quote #7

Quote:
Originally Posted by quilhos View Post
Just one off topic question is it possible to make a single player have like 500 gravity, when another have for example 100?
dont you already know the answer to that question?

Code:
#include < fun > set_user_gravity( index, Float:gravity = 1.0 );
__________________

Last edited by Blizzard_87; 06-17-2013 at 21:50.
Blizzard_87 is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 06-18-2013 , 09:09   Re: Plugin req
Reply With Quote #8

I dont use the fun module very often thats why x)
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
Reply



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 10:11.


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