Unknown function (Really short code)
Hey guys. This is, I think my first port here, so... Hi.
I am new to GSC (Just started learning two days ago) and don't have much previous experience with programming (little bit of vb.net). So I'm teaching myself by doing small things, like toggles using examples from bits of code I find online.
Today I ran into my first problem I can't seem to solve and would love if somebody could help me out. I will attach only the code I have modified, however I think the problem exists in doTestToggleTwo().
I am new to GSC (Just started learning two days ago) and don't have much previous experience with programming (little bit of vb.net). So I'm teaching myself by doing small things, like toggles using examples from bits of code I find online.
Today I ran into my first problem I can't seem to solve and would love if somebody could help me out. I will attach only the code I have modified, however I think the problem exists in doTestToggleTwo().
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player"); //Waits for player spawn
self iPrintlnBold( "^3Hello World" ); //Mod name
wait 1.5;
self iPrintln( "^1MD6 ^7version ^11r1826" ); //Mod version
wait 1.5;
self iPrintln( "Instilizing ^3doSplash() ^1&& ^3doTestToggle ^1&& ^3doTestToggle2" ); //Notification
self.testvar=0; //Sets testvar to 0 for toggle
self thread doSplash(); //Instilizes doSplash()
self thread doTestToggle(); //Instilizes doTestToggle
self thread doTestToggleTwo(); //Instilizes doTestToggle2
wait 1.5;
self iPrintln( "Instilized" ); //Notification
}
}
doSplash()
{
self endon("disconnect");
self endon("death");
wait 1;
notifyData = spawnstruct();
notifyData.iconName = "rank_prestige10"; //Icon, 10th prestige
notifyData.titleText = "^5GSC ^7by ^2uPayme^0iFixit"; //Line 1
notifyData.notifyText = "^3Hello World"; //Line 2
notifyData.notifyText2 = "Press ^1actionslot2 ^7for mods"; //Line 3
notifyData.glowColor = (2.55, 0.0, 0.0); //RGB Color array divided by 100
notifyData.sound = "veh_ac130_sonic_boom"; //Sound, level up sound here
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}
doTestToggle()
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand("1", "+actionslot 2"); //Aparantly this is needed when using button press
for(;;){ //for(;;) allows a loop
self waittill("1"); //Waits for actionslot 2 to be pressed
if (self.testvar==0) //Begin my favorite toggle logic :D
{
self.testvar=1;
self iPrintLnBold("^3doTestToggle() ^6DVARS ^7set to ^1!= ^7standard");
self VisionSetNakedForPlayer("cheat_chaplinnight", 1);
self hide();
}
else
{
self.testvar=0;
self iPrintLnBold("^3doTestToggle() ^6DVARS ^7set to ^1==");
self VisionSetNakedForPlayer( getDvar("mapname"), 1);
self show();
}
}
}
doTestToggleTwo()
{
selfnotifyOnPlayerCommand("2", "+actionslot 1");
for(;;){
self waittill("2");
self.testvartwo+=1;
switch(self.testvartwo)
{
case 1:
self iPrintlnBold( self.testvartwo );
break;
case 2:
self iPrintlnBold( self.testvartwo );
break;
case 3:
self iPrintlnBold( self.testvartwo );
break;
default:
self iPrintlnBold( self.testvartwo );
self.testvartwo=0;
break;
}
}
}

), no unknown function...