Raised This Month: $ Target: $400
 0% 

Solved Menu Option Turn On Off


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
polimpo4
Member
Join Date: Jan 2017
Old 04-16-2018 , 19:14   Menu Option Turn On Off
Reply With Quote #1

I Need One Option Key Like I Already Made (2) For Activate And The Same Key To Deactivate The Function Like Godmode If I Press 2 It Turns On And If I Press 2 Again It Turns Off How I Can Make It With Speed?!?!? I Made A New Plugin To Make It Short And Easy to Understand (debug)

The Code
PHP Code:
/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <amxmisc> 
#include <fun> 

#define PLUGIN "teste speed menu" 
#define VERSION "1.0" 
#define AUTHOR "_|Polimpo4|_" 

#define ADMIN_ACESS ADMIN_KICK    // 

#define Keysmenu_1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) //Keys: 1234567890 

// Tag Do Clan 
new const g_Client[] = "[PlayMeNow]"

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    
register_dictionary"speedmenu.txt"); 
     
    
register_cvar("write_log_file","1"); 
     
    
register_concmd("speedmenu""ShowSpeedMenu"ADMIN_ACESS"Open Admin Menu #1"
     
    
register_menucmd(register_menuid("menu_1"), Keysmenu_1"Pressedmenu_1"
     
    
// Add your code here... 


public 
ShowSpeedMenu(id) { 
    if (
get_user_flags(id) & ADMIN_ACESS
    { 
        
show_menu(idKeysmenu_1"\rPMN Menu #1^n^n\r1. \wMax Speed^n^n\r2. Sair", -1"menu_1"// Display menu 
     
        
return PLUGIN_CONTINUE 
    

    else 
    { 
        
client_print(idprint_chat"%s %L",g_ClientLANG_PLAYER,"MSGM_ACESSO"); 
         
        return 
PLUGIN_HANDLED
    } 
     
    return 
PLUGIN_CONTINUE 


public 
Pressedmenu_1(idkey) { 

    new 
team[32], User[32]; 
    
get_user_team(id,team,32); 
    
get_user_name(id,User,32); 
     
    switch (
key) { 
        case 
0: { // 1 
         
                
for(new i=1;i<=32;i++) 
                { 
                    if(
is_user_connected(i) && is_user_alive(i) ) 
                    { 
                        new 
name[32]; 
                        
get_user_name(id,name,31); 
                        new 
triggeroption something to trigger
                         
                        if(
triggeroption == 0
                        { 
                            
set_user_maxspeed(id,900.0); // Max speed: 500 
                            
triggeroption 1
                            
client_print(idprint_chat"%s %L",g_ClientLANG_PLAYER,"SPEED_RUN_MSG"
                             
                            if(
get_cvar_num("write_log_file") == 1
                                
log_amx("%s use a Admin Cheats: Max SPEED (500)"User); 
                        } 
                        else 
                        { 
                            
triggeroption0
                            
set_user_maxspeed(id,320.0); // Normal speed: 320 
                            
client_print(idprint_chat"%s %L",g_ClientLANG_PLAYER,"SPEED_NOT_RUN_MSG"
                            return 
PLUGIN_HANDLED
                        } 
                    } 
                    else 
                    { 
                        
client_print(idprint_chat"%s %L",g_ClientLANG_PLAYER,"DIED_MSG"
                        return 
PLUGIN_HANDLED
                    } 
                     
                    
client_cmd(id"speedmenu"
                } 
            } 
        case 
1: { // 2 
            
return PLUGIN_HANDLED
        } 
    } 
    return 
PLUGIN_HANDLED 

To Make It Working You Need Change That Keywords:

something to trigger » i used get_user_godmode(id);
triggeroption » i used ghost

Last edited by polimpo4; 04-17-2018 at 16:28. Reason: Easy To Explain
polimpo4 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 04:33.


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