Raised This Month: $ Target: $400
 0% 

print wrong message value


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-19-2023 , 12:44   print wrong message value
Reply With Quote #1

The purpose of the code is that I write
!rt 9
It should show in the ad that you changed to time 9 but it says 0.00 to me


Message console/chat:
Quote:
[Cmd] CheezPuff has set RoundTime to "0.00"
"mp_roundtime" changed to "9.000000"
Code:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

enum _:CMD_STRUCT
{
    
CMD_NAME    [32],
    
CMD_INCHAT    [32],
    
CMD_SRV        [32],
    
CMD_USAGE    [128],
    
CMD_LEVEL,
};

enum _:Commands
{
    
ROUND_TIME
}

new const 
CommandsList[Commands][CMD_STRUCT] = 
{
    
// !rt     - flag o (SuperAdmin)            
    
{"RoundTime",            "rt",        "mp_roundtime"""ADMIN_LEVEL_C},
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd    ("say""HandleSay");
    
register_clcmd    ("say_team""HandleSay");
}

// Say Command Handler.
public HandleSay(client)
{
    new 
said[32];
    new 
param[32];
    new 
szMessage[charsmax(said) + charsmax(param) + 2];
   
    
read_argv(1szMessagecharsmax(szMessage));
    
argbreak(szMessagesaidcharsmax(param), paramcharsmax(param));
 
    for (new 
0Commandsi++)
    {
        if (
equali(said[1], CommandsList[i][CMD_INCHAT]))
        {
            if (!(
get_user_flags(client) & CommandsList[i][CMD_LEVEL]))
            {
                
client_print_color(clientprint_team_default"%s ^3Error^1: You don't have Access Level."PREFIX);
                continue;
            }
            
CommandSelector(iclientparam);
            return 
PLUGIN_HANDLED;
        }
    }
    return 
PLUGIN_CONTINUE;
}

// Say Command Handler (Selector).
CommandSelector(cmdclientparam[])
{
    switch(
cmd)
    {
        case 
ROUND_TIME:    CmdRoundTime    (clientparam);

    }
}

// Command: Round Time.
CmdRoundTime(clientparam[])
{
    new 
num;
    if (
CheckMinMax(clientparamnum19))
    {
        
set_pcvar_float(gCmdPointer[ROUND_TIME], float(num));
        
PrintHasSetCmd(0clientROUND_TIMEfmt("%.1f"num));
    }
   
    return;
}

PrintHasSetCmd(idclientcmdparam[])
{
    
client_print_color(idprint_team_default"%s ^3%n ^1has set ^4%s ^1to ^4^"%s^""PREFIXclientCommandsList[cmd][CMD_NAME], param);
}

// Check Min to Max.
bool:CheckMinMax(clientparam[], &num, const min, const max)
{
    
num str_to_num(param);
    if ( !( 
min <= num <= max ) || !param[0])
    {
        
client_print_color(client print_team_default"%s Value must be %d or %d"PREFIXminmax);
        return 
false;
    }
    
/*if ( !( min <= num && num <= max) || !param[0])
    {
        client_print_color(client, print_team_default, "%s Value must be between %d and %d", PREFIX, min, max);
        return false;
    }*/

    
return true;


Last edited by Fuck For Fun; 05-19-2023 at 16:40. Reason: Fixed
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
 



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 14:28.


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