Raised This Month: $ Target: $400
 0% 

Solved Menu Option Turn On Off


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
polimpo4
Member
Join Date: Jan 2017
Old 04-16-2018 , 23:16   Re: Menu Option Turn On Off
Reply With Quote #1

Quote:
Originally Posted by fysiks View Post
And what exactly do you think speed will contain after this?

Code:
new speed = set_user_maxspeed(id,320.0);
It has no return value.

Have you tried get_user_maxspeed() and then checking that value accordingly?
I Create All New Plugin Just To Be Easy To Understand What I Want...

I Need To Click 2 And Activate And When I Press 2 Again Deactivate. I Made It But Only Works If You Change That Keywords:

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


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"adminmenu.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

polimpo4 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 04:33.


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