Answered Does anyone know how to add time on BO2 (GSC)

Rto

Known Member
Messages
13
Reaction score
1
Points
108
addtimeshit(time)
{
level.timeLimitOverride = true;
self iprintln("1 Minute Added!");
setgameendtime(GetTime() + time * 1000 );
}

This is what I have so far. And i've tried putting the level.timeLimitOverride into my init(), and it just completely removes the timer, if someone could help me with the GSC code it would be greatly appreciated.
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
Code:
editTime( time, message )
{
     self iprintlnbold( message );
     setgametypesetting( "timelimit", getgametypesetting( "timelimit" ) + time );
     level waittill( "game_ended" );
     setgametypesetting( "timelimit", 10 );
}
PHP:
- Extinct
 

Rto

Known Member
Messages
13
Reaction score
1
Points
108
Thanks, but the code didnt seem to work for some reason. Time just doesnt get added to the timer. Could you help me figure out why, am I missing anything?

This is what im calling the add time as:

self add_option("SubMenu1", "Add 1 Minute", ::editTime, "60", "1 Minute Added");
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
Thanks, but the code didnt seem to work for some reason. Time just doesnt get added to the timer. Could you help me figure out why, am I missing anything?

This is what im calling the add time as:

self add_option("SubMenu1", "Add 1 Minute", ::editTime, "60", "1 Minute Added");
Code:
self add_option("SubMenu1", "Add 1 Minute", ::editTime, 60, "1 Minute Added");
Don't put the time between "".
 
Top