Raised This Month: $ Target: $400
 0% 

Infinite buytime?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-05-2013 , 23:00   Infinite buytime?
Reply With Quote #1

Whell, i know about Server Cvars unlocker plugin, but i find this code in forum:

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

new const BUYTIME_CVAR[] = "mp_buytime"

#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "meTaLiCroSS"

public plugin_init() 
{
    
register_plugin("BuyTime Infinito"PLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
register_forward(FM_CVarGetFloat"fw_CVarGetFloat")
}

public 
fw_CVarGetFloat(const szCVar[])
{
    if(
equal(szCVarBUYTIME_CVAR))
    {
        
forward_return(FMV_FLOAT99999.0)
        return 
FMRES_SUPERCEDE
    
}
    
    return 
FMRES_IGNORED

And its based on this (player.cpp i think):

PHP Code:
int buyTime = ( int )CVAR_GET_FLOAT"mp_buytime" ) * 60;

    if( 
buyTime 15 )
    {
        
buyTime 15;
        
CVAR_SET_FLOAT"mp_buytime"/ ( 60 15 ) );
    }

    if( 
gpGlobals->time g_pGameRules->m_fRoundCount buyTime )
    {
        if( 
display )
            
ClientPrintpevHUD_PRINTCENTER"#Cant_buy"UTIL_dtos1buyTime ) );

        return 
false;
    } 
This will always return true when i set the buyTime to 99999.0 ??
Or it is same to set the mp_buytime var to 99999.0 ??

Anyway, has an method to set the buytime as infinite??
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-06-2013 , 01:52   Re: Infinite buytime?
Reply With Quote #2

I'm not sure, but i don't think buytime has a max value, so in that case, yes, it is the same.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-06-2013 , 02:50   Re: Infinite buytime?
Reply With Quote #3

Set buy time same as round time?
__________________
Blizzard_87 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-06-2013 , 09:57   Re: Infinite buytime?
Reply With Quote #4

Not exactly Blizzard_87, i using a function to remove bomb_targets and C4. For this the round time is "infinite" for ever. And i need to extend the buytime ..

connor:
The max value is 9999999 or 99999999 (This will make the buytime over than 4 days if i am not wrong)

Ps. If it is the same is better to only set the buytime var to 9999999 ?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 11-06-2013 at 10:02.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-06-2013 , 12:21   Re: Infinite buytime?
Reply With Quote #5

Quote:
Originally Posted by ^SmileY View Post
For this the round time is "infinite" for ever. And i need to extend the buytime ..
and never changes the map ?

Last edited by baneado; 11-06-2013 at 12:21.
baneado is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-06-2013 , 13:30   Re: Infinite buytime?
Reply With Quote #6

Quote:
Originally Posted by baneado View Post
and never changes the map ?
Is not the point, because the server Goes away and when a player connects ThE buytime has expired. Or an similar thing
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-06-2013 , 13:56   Re: Infinite buytime?
Reply With Quote #7

Quote:
Originally Posted by ^SmileY View Post
Is not the point, because the server Goes away and when a player connects ThE buytime has expired. Or an similar thing
It's the point, if map changes set buytime same as maptime
baneado is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-06-2013 , 17:00   Re: Infinite buytime?
Reply With Quote #8

Lol the map does not have any limit
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-07-2013 , 00:41   Re: Infinite buytime?
Reply With Quote #9

I think it doesn't make any difference, so, set prefer setting cvar value since you don't need any value.

I think max Float value is 3.4 * 10^38, you can represent it in pawn like this :
PHP Code:
Float:0x7F7FFFFF 
Also, i think it represents more than a human life.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-07-2013 at 00:45.
ConnorMcLeod is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-07-2013 , 05:57   Re: Infinite buytime?
Reply With Quote #10

And in seconds ^^

Ok, thanks.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 23:22.


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