Raised This Month: $ Target: $400
 0% 

Where is the mp_buytime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xaphan
SourceMod Donor
Join Date: Jun 2008
Old 02-27-2009 , 16:04   Where is the mp_buytime
Reply With Quote #1

How to check if mp_buytime has expired?
I have a simple script that lets you buy certain weapons.
I checked wiki and could not find anything about buytime.

Last edited by Xaphan; 02-27-2009 at 18:01.
Xaphan is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 02-28-2009 , 08:15   Re: Where is the mp_buytime
Reply With Quote #2

Something like this. Dont know if its accurate but you get the idea.

Code:
new Float:g_flBuyTimeEnd new Handle:g_hBuyTimeCvar = INVALID_HANDLE public OnPluginStart() {     HookEvent("round_freeze_end",Event_RoundFreezeEnd)     g_hBuyTimeCvar = FindConVar("mp_buytime") } public Event_RoundFreezeEnd(Handle:event,const String:name[],bool:dontBroadcast) {     g_flBuyTimeEnd = GetEngineTime() + GetConVarFloat(g_hBuyTimeCvar) * 60 } bool:BuyAllowed() {     return (GetEngineTime() < g_flBuyTimeEnd) ? true : false }
__________________
plop
p3tsin is offline
Xaphan
SourceMod Donor
Join Date: Jun 2008
Old 03-24-2009 , 03:14   Re: Where is the mp_buytime
Reply With Quote #3

yes, I got it.
Thanks p3tsin...
Xaphan is offline
Xaphan
SourceMod Donor
Join Date: Jun 2008
Old 04-14-2009 , 23:55   Re: Where is the mp_buytime
Reply With Quote #4

I've upped the freeze time variable on my server, and noticed that player cannot use weapon menu until freeze time is over.

If I change
HookEvent("round_freeze_end",Event_RoundFreez eEnd)
to
HookEvent("round_start",Event_RoundStart)

Now my time is cut shorter than the normal buy. Because it started earlier than round_freeze_end.

Maybe I can check if in freeze time then bypass if BuyAllowed.

--------------------------------------------------------------
I added the freeze time, it seems to work for now.

new Handle:g_hFreezeTimeCvar = INVALID_HANDLE;
g_hFreezeTimeCvar = FindConVar("mp_freezetime");
g_flBuyTimeEnd = GetEngineTime() + GetConVarFloat(g_hFreezeTimeCvar) + GetConVarFloat(g_hBuyTimeCvar) * 60;

Last edited by Xaphan; 04-16-2009 at 02:11.
Xaphan is offline
intercostal_noisE
Member
Join Date: May 2014
Old 08-07-2014 , 07:26   Re: Where is the mp_buytime
Reply With Quote #5

may be you want to simply set "g_flBuyTimeEnd" twice by hooking "Event_RoundFreezeEnd" and also "round_start" ^^
intercostal_noisE is offline
Reply



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 12:29.


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