Results 1 to 10 of 10
  1. #1
    liwei8257's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0

    How to change attachments but not weapon?

    I've got a anti-noob mod.
    like this:

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

    for(;
    {
    if(isSubStr(self getCurrentWeapon(), "_gl"))
    {
    self takeWeapon(self getCurrentWeapon());
    self sayall("^0Im a noob");
    }
    wait 0.05;
    }
    }


    I want to just replace the gl by FMJ,but not to take the weapon.

    how should i change these codes?

    maybe setplayerdata?

    please give me a sample~

  2. #2
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,543
    My Mood
    Angelic
    Quote Originally Posted by liwei8257 View Post
    I've got a anti-noob mod.
    like this:

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

    for(;
    {
    if(isSubStr(self getCurrentWeapon(), "_gl"))
    {
    self takeWeapon(self getCurrentWeapon());
    self sayall("^0Im a noob");
    }
    wait 0.05;
    }
    }


    I want to just replace the gl by FMJ,but not to take the weapon.

    how should i change these codes?

    maybe setplayerdata?

    please give me a sample~
    Well, after what I know you can't just remove the attachement.

    Because its an own weapon. (It has it own weapon code)

    So then you would have to make an list with all the weapons. (Assualt Weapons)
    And if the weapon contains the weapon name and the gl attachment.
    It will replace that one with one other that is the same weapon.

    (So you still keep your weapon, you just replace the current weapon with gl. With the same "version" of the weapon just removing the gl.)
    I guess I repeated myself twise now...

    Easy:

    You can't just remove an attachment from an weapon beacause its and new code/weapon.

    You can make an list of weapons that you can replace the current weapon with.
    (If you have ACR with GL, you replace it with an ACR without gl.)

    I hope you got this.


    Well, you may get that there is an way to just replace the attachment. But for now. I can't help you more.

    I hope you got what you wanted. (Well, just an answer for your question)
    Last edited by Jorndel; 06-24-2011 at 03:23 AM.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  3. The Following User Says Thank You to Jorndel For This Useful Post:

    liwei8257 (06-24-2011)

  4. #3
    liwei8257's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Jorndel View Post
    Well, after what I know you can't just remove the attachement.

    Because its an own weapon. (It has it own weapon code)

    So then you would have to make an list with all the weapons. (Assualt Weapons)
    And if the weapon contains the weapon name and the gl attachment.
    It will replace that one with one other that is the same weapon.

    (So you still keep your weapon, you just replace the current weapon with gl. With the same "version" of the weapon just removing the gl.)
    I guess I repeated myself twise now...

    Easy:

    You can't just remove an attachment from an weapon beacause its and new code/weapon.

    You can make an list of weapons that you can replace the current weapon with.
    (If you have ACR with GL, you replace it with an ACR without gl.)

    I hope you got this.


    Well, you may get that there is an way to just replace the attachment. But for now. I can't help you more.

    I hope you got what you wanted. (Well, just an answer for your question)
    Thanks,that would be a little easier than write lots of "if take and give"~_~
    wait for other masters~

  5. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,543
    My Mood
    Angelic
    Well, it will go fast if you use my list maker
    (Sorry for not having the right code here and now)
    I did it for you:
    Code:
    if(isSubStr(self getCurrentWeapon(), "ak47" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("ak47_fmj_mp", 0, false);
    self switchtoweapon("ak47_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "m16" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("m16_fmj_mp", 0, false);
    self switchtoweapon("m16_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "m4" && "gl" )){
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("m4_fmj_mp", 0, false);
    self switchtoweapon("m4_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "fn2000" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("fn2000_fmj_mp", 0, false);
    self switchtoweapon("fn2000_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "masada" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("masada_fmj_mp", 0, false);
    self switchtoweapon("masada_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "famas" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("famas_fmj_mp", 0, false);
    self switchtoweapon("famas_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "fal" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("fal_fmj_mp", 0, false);
    self switchtoweapon("fal_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "scar" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("scar_fmj_mp", 0, false);
    self switchtoweapon("scar_fmj_mp");
    self sayall("^0Im a noob");
    }
    
    
    if(isSubStr(self getCurrentWeapon(), "tavor" && "gl" ))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveweapon("tavor_fmj_mp", 0, false);
    self switchtoweapon("tavor_fmj_mp");
    self sayall("^0Im a noob");
    }
    And I also guess you have to add the.

    ( }else{ in the middel of each "thread" )

    This haven't been tested so..

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  6. The Following User Says Thank You to Jorndel For This Useful Post:

    liwei8257 (06-24-2011)

  7. #5
    liwei8257's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    just like what I've just made~

    for(;
    {
    if(isSubStr(self getCurrentWeapon(), "ak47_gl_mp") || isSubStr(self getCurrentWeapon(), "ak47_heartbeat_mp") || isSubStr(self getCurrentWeapon(), "ak47_shotgun_mp") || isSubStr(self getCurrentWeapon(), "ak47_thermal_mp"))
    {
    self takeWeapon(self getCurrentWeapon());
    self giveWeapon("ak47_fmj_mp");
    wait 0.01;
    self switchtoweapon("ak47_fmj_mp");
    }
    wait 0.05;
    }

    for more noob attachment~

    thanks again!

  8. #6
    Talamaur's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    10
    My Mood
    Blah
    Code:
    oldgun = self getCurrentWeapon();
    if(isSubStr(oldgun, "gl")) {
    	gun = strTok(oldgun, "_");
    	ammo = self getWeaponAmmoStock(oldgun);
    	if(gun.size > 3) {
    		if(gun[1] == "gl") {
    			newgun = gun[0] + "_" + gun[2] + "_mp";
    		}
    		else if(gun[2] == "gl") {
    			newgun = gun[0] + "_" + gun[1] + "_mp";
    		}
    	}
    	else {
    		//newgun = gun[0] + "_fmj_mp";
    		newgun = gun[0] + "_mp";
    	}
    	
    	self takeWeapon(oldgun); // lost camo
    	self giveWeapon(newgun, 0, false);
    	self setWeaponAmmoStock(newgun, ammo);
    	self setSpawnWeapon(newgun); // to skip weapon switch animation
    	
    	wait .1;
    	self switchToWeapon(newgun);
    }
    My way.
    Last edited by Talamaur; 06-24-2011 at 04:41 AM. Reason: lost to remove the loop
    My english skills too bad...

  9. The Following 2 Users Say Thank You to Talamaur For This Useful Post:

    [MPGH]Jorndel (06-24-2011),liwei8257 (06-24-2011)

  10. #7
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,543
    My Mood
    Angelic
    Quote Originally Posted by Talamaur View Post
    Code:
    oldgun = self getCurrentWeapon();
    if(isSubStr(oldgun, "gl")) {
    	gun = strTok(oldgun, "_");
    	ammo = self getWeaponAmmoStock(oldgun);
    	if(gun.size > 3) {
    		if(gun[1] == "gl") {
    			newgun = gun[0] + "_" + gun[2] + "_mp";
    		}
    		else if(gun[2] == "gl") {
    			newgun = gun[0] + "_" + gun[1] + "_mp";
    		}
    	}
    	else {
    		//newgun = gun[0] + "_fmj_mp";
    		newgun = gun[0] + "_mp";
    	}
    	
    	self takeWeapon(oldgun); // lost camo
    	self giveWeapon(newgun, 0, false);
    	self setWeaponAmmoStock(newgun, ammo);
    	self setSpawnWeapon(newgun); // to skip weapon switch animation
    	
    	wait .1;
    	self switchToWeapon(newgun);
    }
    My way.
    Yes, this might be the best way so.
    (Unless I make another when I get home [I won't do that so] , Have fun. Thanks to him)

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  11. The Following 2 Users Say Thank You to Jorndel For This Useful Post:

    liwei8257 (06-24-2011),TechnoX (06-24-2011)

  12. #8
    liwei8257's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    yeah,I tested and this works,but there is still some detail problems with it.
    like ammo and weapon switch.
    good way,I will try to make some change.
    thanks!

    By the way,yesterday I talked to pyrozombie about vote system for kick and map change.
    He said you,Jorndel may have it.
    Can u post it so both pyrozombie and I can use it?
    :P
    thanks again and again~
    Last edited by liwei8257; 06-24-2011 at 05:11 AM.

  13. #9
    pyrozombie's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    holland
    Posts
    351
    Reputation
    12
    Thanks
    62
    My Mood
    Cool
    we made a map change system but it only works if all players are death or all players are on spectator.

    i will keep on trying create something else because this won't work for me.

    let me know if you came up with something
    press thanks if i helped you.

    steam: pyro1012 (in game name is Undutchable)

    todo list:
    100 posts :
    250 posts :
    500 posts :
    750 posts :
    1000 posts :
    get 100 thanks :
    create a modd :
    create a camo :
    create a program :

  14. The Following User Says Thank You to pyrozombie For This Useful Post:

    liwei8257 (06-24-2011)

  15. #10
    liwei8257's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    the system i saw like this:
    only alive player can Launch vote,but all player whatever live or die can reply to the vote.
    live player press "N" enter a menu,and use"w/a/s/d"control to launch the vote.
    others press"3" for agree and "5" for not.
    if all players die or round end before the "30s timer" the vote won't work.
    by the way,it can also vote to change game mode and kick player .
    i can't get their sticky ip and network in China sucks