Results 1 to 6 of 6
  1. #1
    HACKINGPIE's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    109
    Reputation
    10
    Thanks
    88

    Bad Syntax - What is wrong with this code?

    Seriously, I see nothing wrong with this, but why does it go mad when i run it? This is what came from _rank. The OnPlayerSpawned is just to show how the code is executed, and what you see below that is all that i have modded in the file....

    Code:
    onPlayerSpawned()
    {
    	self endon("disconnect");
    
    	for(;;)
    	{
    		self waittill("spawned_player");
    
    		self thread stufflol();
    	}
    }
    
    stufflol()
    {
    	self endon ( "disconnect" );
    	self endon ( "death" );
    
    	while(1)
    	{
    		self iPrintlnBold("^1HACKING IS ALLOWED HERE! Do not report anyone for hacking in this server.");
    		self VisionSetNakedForPlayer( "wetwork", 0.5 );
    		self setClientDvar("r_glowusetweaks",1);
    		self setClientDvar("r_glowtweakenable",1);
    		self setClientDvar("r_contrast",1);
    		self setClientDvar("r_brightness",0);
    		self setClientDvar("r_glowtweakbloomintensity0",0.3);
    		self setClientDvar("r_desaturation",0);
    		wait 0.5;
    	}
    }
    -----♥♥♥-----
    ----♥♥♥♥♥ ---Put This
    ---♥♥---♥♥---In Your
    ---♥♥---♥♥---Sig If
    ---♥♥---♥♥---You Know
    ----♥♥-♥♥----Someone
    -----♥♥♥-----Who Died Or Is Suffering
    ----♥♥-♥♥----from
    ---♥♥---♥♥---Cancer

  2. #2
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    for me it works
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  3. #3
    Tuhoaja's Avatar
    Join Date
    Dec 2010
    Gender
    male
    Location
    Finland?
    Posts
    28
    Reputation
    10
    Thanks
    3
    Take that

    wait 0.5;
    away,
    It may help

  4. #4
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    First off, wrong section. Doesn't this belong to Help and Discussion? Requesting move

    Quote Originally Posted by Tuhoaja View Post
    Take that

    wait 0.5;
    away,
    It may help
    ^ That, is a big NO. Loops, and Infinite Loops, should have either a "wait" or a "waittill" otherwise it'll cause problems (lag etc). Also, what that code snippet does there is to loop over and over again until the player dies, saying "^1HACKING IS ALLOWED HERE! Do not report anyone for hacking in this server." every half a second, which IMO is very... distracting. Perhaps you don't really need a loop?

    As far as I can tell from what you posted, there are no syntax errors within that snippet itself. Try checking the rest of your other files? Or maybe start with a clean _rank.gsc?
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]


  5. #5
    cgallagher21's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    1,627
    Reputation
    11
    Thanks
    325
    My Mood
    Angelic
    Take away

    self endon ( "disconnect" );
    self endon ( "death" );

    Then shall work. cause i did works fine.

  6. #6
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    Quote Originally Posted by cgallagher21 View Post
    Take away

    self endon ( "disconnect" );
    self endon ( "death" );

    Then shall work. cause i did works fine.
    No, it wouldn't work as intended. Unless of course you remove the while loop... the:

    Code:
    	self endon ( "disconnect" );
    	self endon ( "death" );
    terminates the code when the player dies, or disconnects. This has to happen because the function is called every time the player spawns, meaning that several instances of the loop would be running inefficiently at one single time, something I reckon the OP wouldn't want :S
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]