AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Infinite buytime? (https://forums.alliedmods.net/showthread.php?t=229344)

^SmileY 11-05-2013 23:00

Infinite buytime?
 
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??

ConnorMcLeod 11-06-2013 01:52

Re: Infinite buytime?
 
I'm not sure, but i don't think buytime has a max value, so in that case, yes, it is the same.

Blizzard_87 11-06-2013 02:50

Re: Infinite buytime?
 
Set buy time same as round time?

^SmileY 11-06-2013 09:57

Re: Infinite buytime?
 
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 ?

baneado 11-06-2013 12:21

Re: Infinite buytime?
 
Quote:

Originally Posted by ^SmileY (Post 2057526)
For this the round time is "infinite" for ever. And i need to extend the buytime ..

and never changes the map ?

^SmileY 11-06-2013 13:30

Re: Infinite buytime?
 
Quote:

Originally Posted by baneado (Post 2057580)
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

baneado 11-06-2013 13:56

Re: Infinite buytime?
 
Quote:

Originally Posted by ^SmileY (Post 2057611)
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

^SmileY 11-06-2013 17:00

Re: Infinite buytime?
 
Lol the map does not have any limit

ConnorMcLeod 11-07-2013 00:41

Re: Infinite buytime?
 
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.

^SmileY 11-07-2013 05:57

Re: Infinite buytime?
 
And in seconds ^^

Ok, thanks.


All times are GMT -4. The time now is 23:22.

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