Raised This Month: $32 Target: $400
 8% 

How add hours to this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-18-2017 , 15:27   How add hours to this plugin
Reply With Quote #1

Hello bros, today i want to know how I add hours tho this plugin!

Like this phrase

PHP Code:
!g[!tWIZARD!y-!tCM!g] !y- !tRonda!y: !g%!y| !tMapa!y: !g%!y| !tJogadores!y: !g%d!y/!g%Hours13:30 
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define VERSION "1.3"


new rounds_elapsed;
new 
play_sound;
new 
chat_message;
new 
g_maxplayers;
new 
g_map[32]
new 
say_text

public 
plugin_init()
{
    
/* Register plugin and author */
    
register_plugin("Vox Round Say"VERSION"God@Dorin")
    
    
    
/* Register plugin version by cvar */
    
register_cvar("round_version"VERSIONFCVAR_SERVER FCVAR_SPONLY);
    
set_cvar_string("round_version"VERSION);

    
/* Register new round events */
    
register_event("HLTV""new_round""a""1=0""2=0");
    
register_event("TextMsg""restart_round""a""2=#Game_will_restart_in");

    
/* Register language file */
    
register_dictionary("round_message.txt");

    
/* Register plugin cvars */
    
play_sound register_cvar("amx_playsound","1");
    
chat_message register_cvar("amx_chatmessage","1");
    
g_maxplayers get_maxplayers();    
    
get_mapname(g_map31)
    
    
say_text get_user_msgid("SayText");
}
public 
new_round()
{
    
rounds_elapsed += 1;
    
    new 
p_playernum;
    
p_playernum get_playersnum(1);
    
    if(
get_pcvar_num(chat_message) == 1)
    {    
        
client_printc(0,  "!g[!tWIZARD!y-!tCM!g] !y- !tRonda!y: !g%d !y| !tMapa!y: !g%s !y| !tJogadores!y: !g%d!y/!g%d"rounds_elapsedg_mapp_playernumg_maxplayers); 
    }
    if(
get_pcvar_num(play_sound) == 1)
    {
        new 
rndctstr[21]
        
num_to_word(rounds_elapsedrndctstr20);
        
client_cmd(0"spk ^"vox/round %s^"",rndctstr)
    }    
    return 
PLUGIN_CONTINUE;
}
public 
restart_round()
{
    
rounds_elapsed 0;    
}
stock client_printc(const id, const string[], {FloatSqlResul,_}:...) {
    
    new 
msg[191], players[32], count 1;
    
vformat(msgsizeof msg 1string3);
    
    
replace_all(msg,190,"!g","^4");
    
replace_all(msg,190,"!y","^1");
    
replace_all(msg,190,"!t","^3");
    
    if(
id)
        
players[0] = id;
    else
        
get_players(players,count,"ch");
    
    new 
index;
    for (new 
count i++)
    {
        
index players[i];
        
message_begin(MSG_ONE_UNRELIABLEsay_text,_index);
        
write_byte(index);
        
write_string(msg);
        
message_end();  
    }  
    
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
*/ 
__________________
FreezerPT is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 10-18-2017 , 16:03   Re: How add hours to this plugin
Reply With Quote #2

PHP Code:
new CurrentTime[32
get_time("%H:%M:%S"CurrentTime31
client_printc(0"%s"CurrentTime
__________________

Last edited by Airkish; 10-19-2017 at 03:03.
Airkish is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-18-2017 , 16:23   Re: How add hours to this plugin
Reply With Quote #3

Quote:
Originally Posted by Airkish View Post
PHP Code:
new CurrentTime [32
get_time ("% H:% M:% S"CurrentTime31
client_printc(0"%s"CurrentTime
Bro doesn´t work! When i try iniciate the server they crash!
__________________
FreezerPT is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-18-2017 , 17:59   Re: How add hours to this plugin
Reply With Quote #4

Quote:
Originally Posted by Airkish View Post
PHP Code:
new CurrentTime [32
get_time ("% H:% M:% S"CurrentTime31
client_printc(0"%s"CurrentTime
Why spaces in between? That will crash the server.

@FreezerPT - replace the second line in his code with get_time("%X", CurrentTime, charsmax(CurrentTime))
__________________

Last edited by OciXCrom; 10-19-2017 at 13:24.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 10-19-2017 , 00:08   Re: How add hours to this plugin
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Why spaces in between? That will crash the server.

@FreezerPT - replace the second line in his code with get_time("%X, CurrentTime, charsmax(CurrentTime))
get_time("%X"
__________________

Last edited by Ayman Khaled; 10-19-2017 at 00:08.
Ayman Khaled is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 10-19-2017 , 03:03   Re: How add hours to this plugin
Reply With Quote #6

Quote:
Originally Posted by FreezerPT View Post
Bro doesn´t work! When i try iniciate the server they crash!
Check my reply, edited.
__________________
Airkish is offline
Reply


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 21:54.


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