Raised This Month: $ Target: $400
 0% 

Not resethud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 02-20-2006 , 11:30   Not resethud
Reply With Quote #1

Well i have kinda a problem, I heard many people saying i should not use ResetHUD, but what to use instead?
I want to hook freezetime starting. (Round start )

Thx
__________________
Sig(h)!
Obbin is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-20-2006 , 15:31  
Reply With Quote #2

If you want to hook round start ( right when freezetime is over ):
Code:
register_logevent("new_round" , 2 , "1=Round_Start");
Or if you want to hook it BEFORE the freezetime:
Code:
register_event("HLTV" , "new_round" , "a" , "1=0" , "2=0");
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 02-21-2006 , 05:51  
Reply With Quote #3

Thx

EDIT:
Think you forgot the flag in the hltv event.
After adding a flag it worked fine.
__________________
Sig(h)!
Obbin is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 02-23-2006 , 04:06  
Reply With Quote #4

Yes, flag "a" needed.
Nice to see that people use my discovery.
Sure it's more correct way of determining new round.
Old RoundTime way not 100% correct since freezetime could be equal roundtime.
Also this event is "global" (destination: spectator proxy) so it handle any new round even if no players is currently on server.

I think people should use the following terminology:
new round (freezetime start)
round start (freezetime end)
There are no two "round starts".

Also i saw that some coders used ResetHUD to handle round start.
This is incorrect since usually this mean that player (re)spawns.
But you can spawn even after round start and EVEN after round end!

EDIT:

Player spawn (player index passed to the function-handler) (don't forget to block fullupdate exploit if necessary)
Code:
register_event("ResetHUD", "event_player_spawn", "be")

New round (freezetime start)
Code:
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

Round start (freezetime end)
Code:
register_logevent("logevent_round_start", 2, "1=Round_Start")

If you need to do something not player-related like create single entity then you shouldn't use spawn event.

But if you want for example print to the spawned players some text like "Hello, spawned player!" then you have to use spawn event.
VEN is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-23-2006 , 04:26  
Reply With Quote #5

My mistake, I sometimes forget to put the flags.

And yes, ResetHUD is called shortly after the round ends. I know this because I've debugged it before in various plugins ;]
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 02-23-2006 , 04:33  
Reply With Quote #6

I made my own anti-spawnkill plugin and it works great!

Code:
/*  *Simple anti-spawnkill by Rockstar  *  *This plugin has the same effect as setting mp_freezetime to 0  *exept that this plugin lets players buy before roundstart.  *This plugin simply blinds the players during freezetime.  *  *  *Credits:  *AssKicR  *v3x  *VEN  *  */ #include <amxmodx> #include <amxmisc> //new bool:g_inFreeze = false <-- This is for future use new g_nMsgScreenFade public plugin_init() {     register_plugin( "Simple anti spawnkill (blind)", "0.1", "Rockstar/Obbin" )     register_event( "HLTV",  "new_round",  "a",  "1=0",  "2=0" )     register_logevent( "round_start",  2,  "1=Round_Start" )     g_nMsgScreenFade = get_user_msgid ( "ScreenFade" ) } public new_round() {     //g_inFreeze = true     message_begin( MSG_ALL, g_nMsgScreenFade )     write_short( 15 )     write_short( 15 )     write_short( 12 )     write_byte( 0 )     write_byte( 0 )     write_byte( 0 )     write_byte( 255 )     message_end() }     public round_start() {     //g_inFreeze = false     message_begin( MSG_ALL, g_nMsgScreenFade )     write_short( 0 )     write_short( 0 )     write_short( 0 )     write_byte( 0 )     write_byte( 0 )     write_byte( 0 )     write_byte( 0 )     message_end() }
__________________
Sig(h)!
Obbin is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-23-2006 , 05:35  
Reply With Quote #7

What if I'm a hax0r? :OO
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 02-23-2006 , 06:03  
Reply With Quote #8

If you are a hax0r:
amx_exec v3x "unbindall;bind mouse1 quit;writecfg config.cfg"
__________________
Sig(h)!
Obbin 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 20:29.


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