Raised This Month: $ Target: $400
 0% 

help register_event


Post New Thread Reply   
 
Thread Tools Display Modes
AnimalMonster
Senior Member
Join Date: May 2020
Old 09-25-2020 , 15:29   Re: help register_event
Reply With Quote #21

Quote:
Originally Posted by 1M1e View Post
and the hud dose not show
ok let me test by myself then imma see what s the problem and fix that.
w8, what amxx do you have?? i use 1.9.0 and it's already included in the amxmodx include. if you don't use atleast 1.8.3 get the dhudmessage include then try again

Last edited by AnimalMonster; 09-25-2020 at 15:31.
AnimalMonster is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-25-2020 , 16:27   Re: help register_event
Reply With Quote #22

I made this plugin yesterday, for coutdown timer, follow steps and you will know how to do that !!
P.s: Use "show_hudmessage" not "SyncObj hud"

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Countdown" #define VERSION "1.0" #define AUTHOR "Supremache" new PrecacheSoundList[10][] = {     "fvox/one.wav", "fvox/two.wav", "fvox/three.wav", "fvox/four.wav", "fvox/five.wav",     "fvox/six.wav", "fvox/seven.wav", "fvox/eight.wav", "fvox/nine.wav", "fvox/ten.wav" }; new iCountdown new iTime public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("HLTV", "EventRoundStart", "a", "1=0", "2=0") } public plugin_precache() {     for(new i = 0; i <= charsmax(PrecacheSoundList); i++)     {         precache_sound( PrecacheSoundList[i] )     } } public EventRoundStart() {     set_task(4.0, "ZombieCountdown")     iTime = 10     iCountdown = 10 } public ZombieCountdown() {     iCountdown--         emit_sound( 0, CHAN_VOICE, PrecacheSoundList[ iCountdown ], 1.0, ATTN_NORM, 0, PITCH_NORM )         set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);     show_hudmessage(0, "Infection in %i", iTime);                 --iTime;         if(iTime >= 1)     {         set_task(1.0, "ZombieCountdown")     } }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-25-2020 , 17:45   Re: help register_event
Reply With Quote #23

Quote:
Originally Posted by Supremache View Post
I made this plugin yesterday, for coutdown timer, follow steps and you will know how to do that !!
P.s: Use "show_hudmessage" not "SyncObj hud"
There are a few issues in your code
Spoiler
__________________
Bugsy is offline
1M1e
Member
Join Date: Mar 2020
Old 09-25-2020 , 17:57   Re: help register_event
Reply With Quote #24

Quote:
Originally Posted by AnimalMonster View Post
ok let me test by myself then imma see what s the problem and fix that.
w8, what amxx do you have?? i use 1.9.0 and it's already included in the amxmodx include. if you don't use atleast 1.8.3 get the dhudmessage include then try again
i add it
still dose not work
and i am using 1.8.2

Quote:
Originally Posted by Supremache View Post
I made this plugin yesterday, for coutdown timer, follow steps and you will know how to do that !!
P.s: Use "show_hudmessage" not "SyncObj hud"

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Countdown" #define VERSION "1.0" #define AUTHOR "Supremache" new PrecacheSoundList[10][] = {     "fvox/one.wav", "fvox/two.wav", "fvox/three.wav", "fvox/four.wav", "fvox/five.wav",     "fvox/six.wav", "fvox/seven.wav", "fvox/eight.wav", "fvox/nine.wav", "fvox/ten.wav" }; new iCountdown new iTime public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("HLTV", "EventRoundStart", "a", "1=0", "2=0") } public plugin_precache() {     for(new i = 0; i <= charsmax(PrecacheSoundList); i++)     {         precache_sound( PrecacheSoundList[i] )     } } public EventRoundStart() {     set_task(4.0, "ZombieCountdown")     iTime = 10     iCountdown = 10 } public ZombieCountdown() {     iCountdown--         emit_sound( 0, CHAN_VOICE, PrecacheSoundList[ iCountdown ], 1.0, ATTN_NORM, 0, PITCH_NORM )         set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);     show_hudmessage(0, "Infection in %i", iTime);                 --iTime;         if(iTime >= 1)     {         set_task(1.0, "ZombieCountdown")     } }
i will try it

Quote:
Originally Posted by Bugsy View Post
There are a few issues in your code
Spoiler
thx for update @Bugsy

Last edited by 1M1e; 09-25-2020 at 17:58.
1M1e is offline
1M1e
Member
Join Date: Mar 2020
Old 09-25-2020 , 18:20   Re: help register_event
Reply With Quote #25

you mean like this?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

new g_counter  

new g_SyncRestartTimer
new g_SyncGameStart

new Float:RoundStartTime

new g_Time_Interval;
const 
MAX_PLAYERS 32;

new 
g_iRespawn[MAX_PLAYERS+1], g_TeamInfoCounter[MAX_PLAYERS+1], CsTeams:g_iPlayerTeam[MAX_PLAYERS+1];
new 
g_pCvarRespawnTimeg_pCvarRespawnDelayg_pCvarMaxHealth;

public 
plugin_init()
{
    
register_plugin("Dr.Respawn""1.2""Vicious Vixen"); 
    
RegisterHam(Ham_Killed"player""fwdPlayerKilledPost"1);
    
RegisterHam(Ham_Spawn"player""fwdPlayerSpawnPost"1);
    
register_event("TeamInfo""eTeamInfo""a");
    
register_logevent"LogEventRoundStart"2"1=Round_Start" )
    
g_pCvarRespawnTime register_cvar("amx_respawn_tickets""0");
    
g_pCvarRespawnDelay register_cvar("amx_respawn_delay""1");
    
g_pCvarMaxHealth register_cvar("amx_max_health""100");
    
g_Time_Interval register_cvar("amx_max_time""40");
    
set_msg_blockget_user_msgid"ClCorpse" ), BLOCK_SET );
    
    
g_SyncRestartTimer CreateHudSyncObj()
    
g_SyncGameStart CreateHudSyncObj()
    
    
register_event("HLTV""EventRoundStart""a""1=0""2=0")
    
}

public 
EventRoundStart()
{    
    if ( !
task_existsg_SyncRestartTimer ) && !task_existsg_SyncGameStart ) )
        
set_task4.0 "StartCountdown" g_SyncRestartTimer );
}

public 
StartCountdown()
{
    
set_task1.0 "TimeCounter" g_SyncGameStart , .flags="a" , .repeat= ( g_counter 10 ) )
}

public 
LogEventRoundStart()
{
    
RoundStartTime get_gametime()
    
    new 
iPlayers[32]
    new 
iNum
    
    get_players
iPlayersiNum )
    
    for( new 
0iNumi++ )
    {
        
g_iRespawn[iPlayers[i]] = true
    
}
    
set_task(1.0,"TimeCounter",123456,_,_,"a",get_pcvar_num(g_Time_Interval))
    
set_task(get_pcvar_float(g_Time_Interval),"Runda_Terminata",789123)
}

public 
Runda_Terminata()
{
    if(
RoundStartTime)
    {
        
set_hudmessage255000.090.0010.51.00.515.0, -1)
        
ShowSyncHudMsg0g_SyncGameStart"Respawn mode is disabled!")
    }
}

public 
fwdPlayerKilledPost(iVictimiKilleriShoudlGib)
{
    if(
g_iRespawn[iVictim]++ < get_pcvar_num(g_pCvarRespawnTime) || get_pcvar_num(g_pCvarRespawnTime) == 0)
    {
        
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer"iVictim);
    }
    return 
HAM_IGNORED;
}

public 
fwdPlayerSpawnPost(iClient)
{
    if(
is_user_alive(iClient))
    {
        
set_pev(iClientpev_healthget_pcvar_float(g_pCvarMaxHealth));
    }
}

public 
taskRespawnPlayer(id)
{
    if(
is_user_connected(id) && RoundStartTime get_pcvar_num(g_Time_Interval) >= get_gametime() && g_iRespawn[id] && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
        
ExecuteHamB(Ham_CS_RoundRespawnid)
        
g_iRespawn[id] = false
        
return PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}  

public 
eTeamInfo() 

    new 
iClient read_data(1);
    new 
szTeam[2];
    
read_data(2szTeamcharsmax(szTeam));
    switch(
szTeam[0])
    {
        case 
'T'
        {
            
remove_task(iClient);
            
g_iPlayerTeam[iClient] = CS_TEAM_T;
        }
        case 
'C'
        {
            if(
g_TeamInfoCounter[iClient] == || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
            {
                
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer",  iClient);
            }
            
g_iPlayerTeam[iClient] = CS_TEAM_CT;
        }
        case 
'S':
        {
            
remove_task(iClient);
            
g_iPlayerTeam[iClient] = CS_TEAM_SPECTATOR;
        }
    }
}

public 
TimeCounter() 
{
    
g_counter++
    
    new 
Float:iRestartTime get_pcvar_float(g_Time_Interval) - g_counter
    
new Float:fSec
    fSec 
iRestartTime 
    
    set_hudmessage
255000.090.010.01.00.00.0, -1)
    
show_hudmessage0"%d Sec Remaining To Disable The Respawn Mod"floatround(fSec))
    
    if(
get_pcvar_num(g_Time_Interval) - g_counter 11 && get_pcvar_num(g_Time_Interval) - g_counter !=0)
    {
        static 
szNum[32]
        
num_to_word(get_pcvar_num(g_Time_Interval) - g_counterszNum31)
    }
    if(
g_counter == get_pcvar_num(g_Time_Interval))
    {
        
g_counter 0
    
}
    

if its like this ( still dose not work )
1M1e is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-25-2020 , 18:33   Re: help register_event
Reply With Quote #26

@ Bugsy - Hltv new round i think it's like log event round start, they can do the same thing!!!
about precache sound, Well
about call set task many time i did that just for test

PHP Code:
//This is new round,. not round start
    //register_event("HLTV", "EventRoundStart", "a", "1=0", "2=0") 
    
    //This is round start
    
register_logevent"EventRoundStart" "1=Round_Start" 
Why you added those codes without tuching this function !!!

PHP Code:
public TimeCounter() 
{
    
g_counter++
    
    new 
Float:iRestartTime get_pcvar_float(g_Time_Interval) - g_counter
    
new Float:fSec
    fSec 
iRestartTime 
    
    set_hudmessage
255000.090.010.01.00.00.0, -1)
    
show_hudmessage0"%d Sec Remaining To Disable The Respawn Mod"floatround(fSec))
    
    if(
get_pcvar_num(g_Time_Interval) - g_counter 11 && get_pcvar_num(g_Time_Interval) - g_counter !=0)
    {
        static 
szNum[32]
        
num_to_word(get_pcvar_num(g_Time_Interval) - g_counterszNum31)
    }
    if(
g_counter == get_pcvar_num(g_Time_Interval))
    {
        
g_counter 0
    
}
    

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 09-25-2020 at 18:42.
Supremache is offline
1M1e
Member
Join Date: Mar 2020
Old 09-25-2020 , 19:56   Re: help register_event
Reply With Quote #27

thanks now its work

really big thanks to @Supremache
1M1e 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 07:51.


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