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"); //Wow, this is so messy fix it up...
self VisionSetNakedForPlayer("cheat_chaplinnight", 1);
self hide();
}
else
{
self.testvar = 0; //Why would you need this? It's already set
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;
}
}
}
Just found syntax errors (and a bit messy scripting, but that part is up to you ), no unknown function...
Oh, "default" dosen't exist...
Edit: Yay, 500 posts :P