Thread: code incorrect

Results 1 to 5 of 5
  1. #1
    Twizzy's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    28
    Reputation
    6
    Thanks
    1
    My Mood
    Psychedelic

    code incorrect

    when i run the server, i find an error in the console:

    unknown command

    Code:
    antinoob(){
    	
    	self endon ("disconnect");
    	self endon ("death");
    	currentWeapon = self getCurrentWeapon;
    		//Grenade Launchers
    		if (currentWeapon == "gl_ak47_mp")
            {
                self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_ak47_mp");
    			self giveweapon("ak47_mp");
    			wait 0.1;
    			self switchToWeapon("ak47_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");
    			
            }
    		if(currentWeapon == "gl_m16_mp")
    		{
    		    self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_m16_mp");
    			self giveweapon("m16_mp");
    			wait 0.1;
    			self switchToWeapon("m16_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");
    		}
    		if(currentWeapon == "gl_m4_mp")
    		{
    		    self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_m4_mp");
    			self giveweapon("m4_mp");
    			wait 0.1;
    			self switchToWeapon("m4_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");
    			
    		}
    		if(currentWeapon == "gl_fn2000_mp")
    		{
    		    self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_fn2000_mp");
    			self giveweapon("fn2000_mp");
    			wait 0.1;
    			self switchToWeapon("fn2000_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");
    		}
    		if(currentWeapon == "gl_masda_mp")
    		{
    		    self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_masda_mp");
    			self giveweapon("masda_mp");
    			wait 0.1;
    			self switchToWeapon("masda_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");
    		}
    		if(currentWeapon == "gl_famas_mp")
    		{
    		    self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_famas_mp");
    			self giveweapon("famas_mp");
    			wait 0.1;
    			self switchToWeapon("famas_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");
    		}
    		if(currentWeapon == "gl_fal_mp")
    		{
    		    self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_fal_mp");
    			self giveweapon("fal_mp");
    			wait 0.1;
    			self switchToWeapon("fal_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");
    		}
    		if(currentWeapon == "gl_scar_mp")
    		{
                self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_scar_mp");
    			self giveweapon("scar_mp");
    			wait 0.1;
    			self switchToWeapon("scar_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");		
    		}
    		if(currentWeapon == "gl_tavor_mp")
    		{
                self iPrintLnBold("^1Antinoob detected a noob weapon...");
    			wait 3;
    			self takeWeapon("gl_tavor_mp");
    			self giveweapon("tavor_mp");
    			wait 0.1;
    			self switchToWeapon("tavor_mp");
    			wait 3;
    			self iPringLnBold("^2Fix'd");		
    		}
    }
    
    doDvars() 
    {
    	self thread antinoob();
    }
    ive tried using "self getCurrentWeapon()" in the if statements instead of the var but that didnt work either...

    even better question.. i could use a for loop, but im not sure how... put all the "illegal weapons" in a text file
    have the code, check the file line by line making sure the current weapon is not an "illegal weapon"
    if it is, replace the weapon with the proper weapon by checking the string and possibly replacing it with the proper one...
    for example

    the loop found that the users current weapon is the same as line 3, line 3 reads "gl_ak47_mp" then the code removes the "illegal part" giving the user "ak47_mp" as the new weapon....

    is this possible? i dont want to be spoon fed, i want to learn on my own, thank you
    Last edited by Twizzy; 08-22-2011 at 08:14 AM.

  2. #2
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    154
    My Mood
    Amazed
    currentWeapon = self getCurrentWeapon;

    currentWeapon = self getCurrentWeapon();


    self iPringLnBold("^2Fix'd");

    self iPrintLnBold("^2Fix'd");

  3. #3
    Twizzy's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    28
    Reputation
    6
    Thanks
    1
    My Mood
    Psychedelic
    oooh ahahaha i didnt even see that... lol

    thank you

  4. #4
    Twizzy's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    28
    Reputation
    6
    Thanks
    1
    My Mood
    Psychedelic
    not im getting a bad syntax error... im not too sure what is wrong with the syntax as im not too familiar with the functions etc...

    but i checked the code for missing {} () ; or anything else of that nature and i couldnt seem to find anything wrong...

    could this be from the includes at the top?

    the only gsc in my iwd file is _rank.gsc

    do i need others? no, my server ran just fine with only _rank.gsc, and as i started editing, it still seemed to work fine, but now i get a bad syntax error from the console and i dont understand why.
    Last edited by Twizzy; 08-22-2011 at 10:34 AM.

  5. #5
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    166
    My Mood
    Angelic
    Post ur edited _rank so we can see what u changed and not

Similar Threads

  1. Replies: 37
    Last Post: 06-20-2006, 04:24 PM
  2. Pre-Regerstration - E3 Codes
    By Dave84311 in forum WarRock - International Hacks
    Replies: 67
    Last Post: 06-13-2006, 08:06 AM
  3. hi can any1 help me make or find a cheat code
    By CrUsHa in forum WarRock - International Hacks
    Replies: 3
    Last Post: 05-19-2006, 04:39 PM
  4. a Couple WPE Weapon codes?
    By phil823 in forum WarRock - International Hacks
    Replies: 16
    Last Post: 02-10-2006, 02:14 PM