Prevent player from spawning (just ignore him)
Hello,
if a player joins the round after 40 seconds have passed, can he just be ignored and his spawning prevented? No messages, no 3rd person camera showing his death? Thank you. |
Re: Prevent player from spawning (just ignore him)
Return HAM_SUPERCEDE on Ham_Spawn (pre).
|
Re: Prevent player from spawning (just ignore him)
Quote:
How to count 40 seconds? |
Re: Prevent player from spawning (just ignore him)
Register new round. Add there global variable (float): g_fRoundTime = get_gametime()
On spawn check if g_fRoundTime >= 40.0 |
Re: Prevent player from spawning (just ignore him)
Quote:
Thank you Sir. I will try to make something out of this code. I will post an update soon. :) |
Re: Prevent player from spawning (just ignore him)
Quote:
|
Re: Prevent player from spawning (just ignore him)
Quote:
|
Re: Prevent player from spawning (just ignore him)
Store get_gametime()'s value in a global variable on round start.
When the player joins, compare the variable with a new get_gametime() output and see if it's greater than 40: PHP Code:
|
Re: Prevent player from spawning (just ignore him)
Code:
#include <amxmodx> |
Re: Prevent player from spawning (just ignore him)
Ops my bad, dunno why i wrote that, thanks @OciXCrom for catching it
@MihailoZ, get_gametime() at the beggining was too hard for me to undestand what it does, but its fun thing, maybe this example can help you: Like OciX said, get_gametime() is getting the decimal time from the map start, so when you go with g_fRoundTime = get_gametime(), if round started like on the 10.0 sec of the map starting, g_fRoundTime will be that time. So if player connects (and spawn automatically) a little later, lets say on 30.0 sec of the map start, you must get his late-time from roundstarting to be 20.0 sec (easy logic)....so by putting it on player spawn: ( get_gametime() (<-its his 30.0sec on first spawn) - g_fRoundTime (<- already stored, first round on 10.0sec of map start) ) >= 40.0 i hope its easier for you @OciXCrom, i would aprecciate if you can make any example with get_systime (how i undestood, systime must be used for like gag/ban/similar plugins) EDIT: i think you cant go with return HAM_SUPERCEDE on POST of player spawn idk |
| All times are GMT -4. The time now is 17:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.