Raised This Month: $ Target: $400
 0% 

[HELP] set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thekiller123
Member
Join Date: Dec 2012
Old 07-27-2013 , 09:26   [HELP] set_task
Reply With Quote #1

...

Last edited by thekiller123; 07-19-2015 at 14:43.
thekiller123 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-27-2013 , 09:34   Re: [HELP] set_task
Reply With Quote #2

I doubt the plugin even compiles.

Edit: I hate when people ask for help then delete their post.

So here's the code he posted.

PHP Code:
#include <amxmodx>

new cvar_startcvar_endcvar_multizmhm

new bool:ativado

public plugin_init()
{
    
register_plugin("[ZP] Addon: Happy Hour""0.1""Junin | fiendshard")
    
register_logevent("round_start"2"1=Round_Start")
    
register_logevent("round_end"2"1=Round_End")
    
register_clcmd("say","say_happy");
    
    
hm get_cvar_num("zp_ammop_human_damaged_hp")
    
zm get_cvar_num("zp_ammop_zombie_killed")
    
    
cvar_start register_cvar("zp_hhstart""22")
    
cvar_end register_cvar("zp_hhend""08")
    
cvar_multi register_cvar("zp_hhx""2"
    
}
public 
plugin_cfg()
{
    
set_task(200.0"propaganda"0)
}
public 
propaganda()
{
    new 
data[3]
    
get_time("%H"data2)
    if(
get_pcvar_num(cvar_end) > str_to_num(data) >= get_pcvar_num(cvar_start))
    {
        
client_printcolor(0"^4[INZ HappyHour]^1 Em Andamento !!!! Todos estao ganhando^3 Ammo Packs^4 x%d vezes^1.",get_pcvar_num(cvar_multi))
    }
    else 
        
client_printcolor(0"^4[INZ HappyHour 2]^1 Sistema de Double Packs eh Ativado Automaticamente das ^4%d ^1as ^4%d ^1da manha."get_pcvar_num(cvar_start), get_pcvar_num(cvar_end))        
}
public 
round_start()
{
    new 
data[3]
    
get_time("%H"data2)
    if(
get_pcvar_num(cvar_end) > str_to_num(data) >= get_pcvar_num(cvar_start))
    {
        
set_cvar_num("zp_ammop_human_damaged_hp",hm / (get_cvar_num("zp_hhx")))
        
set_cvar_num("zp_ammop_zombie_killed",zm * (get_cvar_num("zp_hhx")))
        
set_cvar_num("zp_zombie_infect_reward"6);
        
set_cvar_num("zp_human_damage_reward"200);
        
        
        
        
ativado true
        
        
    
}
    else if(
06 >= str_to_num(data))
    {
        
        if(
ativado)
        {
            
client_printcolor(0"^4[INZ HappyHour]^1 Encerrado !!!! Todos estao ganhando^3 Ammo Packs^4 Normalmente^1.")        
            
set_cvar_num("zp_ammop_human_damaged_hp",250)
            
set_cvar_num ("zp_ammop_zombie_killed"1)
            
set_cvar_num("zp_zombie_infect_reward"1);
            
set_cvar_num("zp_human_damage_reward"750);
            
ativado false  
        
}
        
    }
    
}
public 
client_putinserver(id)
    
set_task(20.0"mensagem"id__,_0)

public 
round_end() 
{
    
set_cvar_num("zp_ammop_human_damaged_hp",1800)
    
set_cvar_num ("zp_ammop_zombie_killed"1)
    
}
public 
mensagem(id)
{
    if(!
ativado)
    {
        
client_printcolor(0"^4[INZ HappyHour]^1 Sistema de Double Packs eh Ativado Automaticamente das ^4%d ^1as ^4%d ^1da manha."get_pcvar_num(cvar_start), get_pcvar_num(cvar_end))    
    }
}
public 
mensagem2(id)
{
    new 
hora[3]
    
get_time("%H"hora3)
    
        
set_task(20.0"mensagem2"id__,_0)
    if(
ativado==false)
    
client_printcolor(0"^4[INZ HappyHour]^1 O ^3HappyHour^1 comeca daqui a ^3%d ^1horas."22 str_to_num(hora))    
    
    return 
PLUGIN_CONTINUE
}
public 
say_happy(id)
{
    new 
said[32]
    
read_argv(1,said,31);
    
    if (
containi(said"happy") != -1
    {
        
mensagem2(id)
    }
    return 
PLUGIN_HANDLED
}

stock client_printcolor(const id, const input[], any:...)
{
        new 
count 1players[32]
        static 
msg[191]
        
vformat(msg190input3)

        
replace_all(msg190"!g""^4")  // Chat Verde
        
replace_all(msg190"!y""^1")  // Chat Normal
        
replace_all(msg190"!t""^3")  // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco

        
if (idplayers[0] = id; else get_players(playerscount"ch")
        {
                for (new 
0counti++)
                {
                        if (
is_user_connected(players[i]))
                        {
                                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                                
write_byte(players[i]);
                                
write_string(msg);
                                
message_end();
                        }
                }
        }

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 07-27-2013 at 13:48.
wickedd is offline
thekiller123
Member
Join Date: Dec 2012
Old 07-27-2013 , 09:49   Re: [HELP] set_task
Reply With Quote #3

compiles ...
thekiller123 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-27-2013 , 09:50   Re: [HELP] set_task
Reply With Quote #4

So where is the rest of the plugin?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-27-2013 , 09:57   Re: [HELP] set_task
Reply With Quote #5

Now, I'm not sure what function "client_printcolor" is. But since it's prefix is "client_" I'm gonna assume the first parameter is ID, which you set to 0. You're sending it to the server instead of the player. It could possibly mean "all", I wouldn't know. Either way, double check it.
__________________
Black Rose is offline
Old 07-27-2013, 10:01
thekiller123
This message has been deleted by thekiller123.
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 06:28.


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