Post: Need Help with code on of function anyone???
12-29-2015, 02:59 AM #1
UkHazeOG
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); Hello My name is callum and i am new to gsc SCRIPTING i seem to have got the codes correct but i am missing somthing that enables the function to turn on and off for EG: i load up my game open menu press function (INFINATE GAME) it works then i turn it off and then try enable it again and it just keeps saying OFF in the bottom left hand side this is my code if you could give me any infomation atall on what i am doing wrong it would be really appreciated thank you for your time Smile



Inf_Game()
{
if(self.ingame==false)
{
self.ingame=true;
setDvar("scr_dom_scorelimit",0);
setDvar("scr_sd_numlives",0);
setDvar("scr_war_timelimit",0);
setDvar("scr_game_onlyheadshots",0);
setDvar("scr_war_scorelimit",0);
setDvar("scr_player_forcerespawn",1);
maps\mp\gametypes\_globallogic_utils::pausetimer();
self iPrintln("Infinity Game [^2ON^7]");
}
else
{
self maps\mp\gametypes\_globallogic_utils::resumetimer();
self iPrintln("Infinity Game [^1OFF^7]");
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
12-29-2015, 03:03 AM #2
jwm614
NextGenUpdate Elite
Originally posted by OhhTxrgetzHD View Post
Hello My name is callum and i am new to gsc SCRIPTING i seem to have got the codes correct but i am missing somthing that enables the function to turn on and off for EG: i load up my game open menu press function (INFINATE GAME) it works then i turn it off and then try enable it again and it just keeps saying OFF in the bottom left hand side this is my code if you could give me any infomation atall on what i am doing wrong it would be really appreciated thank you for your time Smile



Inf_Game()
{
if(!self.ingame)
{
self.ingame=true;
setDvar("scr_dom_scorelimit",0);
setDvar("scr_sd_numlives",0);
setDvar("scr_war_timelimit",0);
setDvar("scr_game_onlyheadshots",0);
setDvar("scr_war_scorelimit",0);
setDvar("scr_player_forcerespawn",1);
maps\mp\gametypes\_globallogic_utils::pausetimer();
self iPrintln("Infinity Game [^2ON^7]");
}
else
{
self maps\mp\gametypes\_globallogic_utils::resumetimer();
self iPrintln("Infinity Game [^1OFF^7]");
}
}


    
Inf_Game()
{
if(!self.ingame)
{
self.ingame=true;
setDvar("scr_dom_scorelimit",0);
setDvar("scr_sd_numlives",0);
setDvar("scr_war_timelimit",0);
setDvar("scr_game_onlyheadshots",0);
setDvar("scr_war_scorelimit",0);
setDvar("scr_player_forcerespawn",1);
maps\mp\gametypes\_globallogic_utils:ausetimer();
self iPrintln("Infinity Game [^2ON^7]");
}
else
{
self.ingame=false;//needed this
self maps\mp\gametypes\_globallogic_utils::resumetimer( );
self iPrintln("Infinity Game [^1OFF^7]");
}
}
12-29-2015, 03:06 AM #3
UkHazeOG
Bounty hunter
Originally posted by jwm614 View Post
    
Inf_Game()
{
if(!self.ingame)
{
self.ingame=true;
setDvar("scr_dom_scorelimit",0);
setDvar("scr_sd_numlives",0);
setDvar("scr_war_timelimit",0);
setDvar("scr_game_onlyheadshots",0);
setDvar("scr_war_scorelimit",0);
setDvar("scr_player_forcerespawn",1);
maps\mp\gametypes\_globallogic_utils:ausetimer();
self iPrintln("Infinity Game [^2ON^7]");
}
else
{
self.ingame=false;//needed this
self maps\mp\gametypes\_globallogic_utils::resumetimer( );
self iPrintln("Infinity Game [^1OFF^7]");
}
}


Thank you for your reply its just simply needing to know how to make the function turn on and off when you enable it and disable it it comes on then goes off but wont come on again that is all i need help with if you have any idea what my problem is ?
12-29-2015, 03:07 AM #4
jwm614
NextGenUpdate Elite
Originally posted by OhhTxrgetzHD View Post
Thank you for your reply its just simply needing to know how to make the function turn on and off when you enable it and disable it it comes on then goes off but wont come on again that is all i need help with if you have any idea what my problem is ?


i fixed it an commented where i added

The following user thanked jwm614 for this useful post:

UkHazeOG
12-29-2015, 03:10 AM #5
UkHazeOG
Bounty hunter
Sorry i didnt see the code you attached thank you for your help its really appreciated bro !!
12-29-2015, 04:41 PM #6
EternalHabit
Former Staff
Originally posted by OhhTxrgetzHD View Post
Sorry i didnt see the code you attached thank you for your help its really appreciated bro !!


This is what I use. It's much better

    Inf_Game()
{
if(!level.ingame)
{
level.ingame=1;

if(getDvar("g_gametype")== "tdm" || getDvar("g_gametype")== "dom" || getDvar("g_gametype")== "dm")
registerScoreLimit(999999, 999999);

level thread maps\mp\gametypes\_globallogic_utils::pausetimer();

iPrintln("Unlimited Game ^2ON");
}
else
{
level.ingame=0;

if(getDvar("g_gametype")== "tdm")
registerScoreLimit(75, 75);
if(getDvar("g_gametype")== "dom")
registerScoreLimit(200, 200);
if(getDvar("g_gametype")== "dm")
registerScoreLimit(30, 30);

level thread maps\mp\gametypes\_globallogic_utils::resumetimer();

iPrintln("Unlimited Game ^1OFF");
}
}
12-29-2015, 04:43 PM #7
UkHazeOG
Bounty hunter
Originally posted by xTurntUpLobbies View Post
This is what I use. It's much better

    Inf_Game()
{
if(!level.ingame)
{
level.ingame=1;
if(getDvar("g_gametype")== "tdm" || getDvar("g_gametype")== "dom" || getDvar("g_gametype")== "dm")registerScoreLimit(999999, 999999);
level thread maps\mp\gametypes\_globallogic_utils::pausetimer();
if(getDvar("customgametype") == "stealth") self iPrintln("Unlimited Game ^2ON");
else iPrintln("Unlimited Game ^2ON");
}
else
{
level.ingame=0;
if(getDvar("g_gametype")== "tdm")registerScoreLimit(75, 75);
if(getDvar("g_gametype")== "dom")registerScoreLimit(200, 200);
if(getDvar("g_gametype")== "dm")registerScoreLimit(30, 30);
level thread maps\mp\gametypes\_globallogic_utils::resumetimer();
if(getDvar("customgametype") == "stealth") self iPrintln("Unlimited Game ^1OFF");
else iPrintln("Unlimited Game ^1OFF");
}
}


Nice Code I Have Used a Couple Of Your Codes In My Menu i Am Working On Now and They Are Soo Much Easier To Understand And ( Dont Worry Credits are in order bro Winky Winky )
12-29-2015, 08:58 PM #8
BullyWiiPlaza
Climbing up the ladder
Originally posted by xTurntUpLobbies View Post
This is what I use. It's much better
Are you sure registering the score limit in mid-game works? I believe that it needs to be applied in the init() function during loading screen.
12-29-2015, 09:30 PM #9
EternalHabit
Former Staff
Originally posted by BullyWiiPlaza View Post
Are you sure registering the score limit in mid-game works? I believe that it needs to be applied in the init() function during loading screen.


it doesnt =p

The following user thanked EternalHabit for this useful post:

BullyWiiPlaza
12-29-2015, 10:06 PM #10
BullyWiiPlaza
Climbing up the ladder
Originally posted by xTurntUpLobbies View Post
it doesnt =p

Alright but the score limit set to 0 is for real infinity. Just saying :P

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo