Results 1 to 6 of 6
  1. #1
    kerocs's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    65
    Reputation
    10
    Thanks
    3

    [help] Spawning Claymores as Equipment

    I spawned claymores with the following code:


    SpawnWeapon(WFunc,Weapon,WeaponName,Location,TakeO nce){
    //Created By: TheUnkn0wn
    self endon("disconnect");
    weapon_model = getWeaponModel(Weapon);
    if(weapon_model=="")weapon_model=Weapon;
    Wep=spawn("script_model",Location+(0,0,3));
    Wep setModel(weapon_model);
    for(;{
    foreach(player in level.players){
    Radius=distance(Location,player.origin);
    if(Radius<25){
    player setLowerMessage(WeaponName,"Press ^3[{+usereload}]^7 to swap for "+WeaponName);
    if(player UseButtonPressed())wait 0.1;
    if(player UseButtonPressed()){
    if(!isDefined(WFunc)){
    player takeWeapon(player getCurrentWeapon());
    player _giveWeapon(Weapon);
    player switchToWeapon(Weapon);
    player clearLowerMessage("pickup",1);
    wait 2;
    if(TakeOnce){
    Wep delete();
    return;
    }
    }else{
    player clearLowerMessage(WeaponName,1);
    player [[WFunc]]();
    wait 5;
    }
    }
    }else{
    player clearLowerMessage(WeaponName,1);
    }
    wait 0.1;
    }
    wait 0.5;
    }
    }

    self thread SpawnWeapon(undefined,"claymore_mp","Clay",(1800,4 80,30)+(185,85,25),0);

    The problem is that the way its spawned now its spawned as weapon and not as equipment, so if u pick it up it replaces ur current weapon and if u use the clay the weapon doesnt come back. So i would like to know how to give more then 1 clay or howto register it as equipment, or both, to prevent this problem.

  2. #2
    koliter's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    14
    Reputation
    10
    Thanks
    1
    My Mood
    Innocent
    put a unlimited ammo

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

    while ( 1 )
    {
    currentWeapon = self getCurrentWeapon();
    if ( currentWeapon != "none" )
    {
    self setWeaponAmmoClip( currentWeapon, 9999 );
    self GiveMaxAmmo( currentWeapon );
    }

    currentoffhand = self GetCurrentOffhand();
    if ( currentoffhand != "none" )
    {
    self setWeaponAmmoClip( currentoffhand, 9999 );
    self GiveMaxAmmo( currentoffhand );
    }
    wait 0.05;
    }
    }

  3. #3
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    8,643
    Reputation
    748
    Thanks
    1,818
    My Mood
    Doh
    Quote Originally Posted by kerocs View Post
    I spawned claymores with the following code:


    SpawnWeapon(WFunc,Weapon,WeaponName,Location,TakeO nce){
    //Created By: TheUnkn0wn
    self endon("disconnect");
    weapon_model = getWeaponModel(Weapon);
    if(weapon_model=="")weapon_model=Weapon;
    Wep=spawn("script_model",Location+(0,0,3));
    Wep setModel(weapon_model);
    for(;{
    foreach(player in level.players){
    Radius=distance(Location,player.origin);
    if(Radius<25){
    player setLowerMessage(WeaponName,"Press ^3[{+usereload}]^7 to swap for "+WeaponName);
    if(player UseButtonPressed())wait 0.1;
    if(player UseButtonPressed()){
    if(!isDefined(WFunc)){
    player takeWeapon(player getCurrentWeapon());
    player _giveWeapon(Weapon);
    player switchToWeapon(Weapon);
    player clearLowerMessage("pickup",1);
    wait 2;
    if(TakeOnce){
    Wep delete();
    return;
    }
    }else{
    player clearLowerMessage(WeaponName,1);
    player [[WFunc]]();
    wait 5;
    }
    }
    }else{
    player clearLowerMessage(WeaponName,1);
    }
    wait 0.1;
    }
    wait 0.5;
    }
    }

    self thread SpawnWeapon(undefined,"claymore_mp","Clay",(1800,4 80,30)+(185,85,25),0);

    The problem is that the way its spawned now its spawned as weapon and not as equipment, so if u pick it up it replaces ur current weapon and if u use the clay the weapon doesnt come back. So i would like to know how to give more then 1 clay or howto register it as equipment, or both, to prevent this problem.

    paste the code of the script in the middle of this:
    [code][code]
    add a / before code in the second for IE
    "[/co..]"
    Quote Originally Posted by KING View Post
    Stop FACKING SUMMONING ME TO THESE FUCKTARDS CONVOS.
    DAFUQ IS DIS FACKING SHYT.
    SHYT MAKES NO SENSE.

    On a side note. You fags are fucking hatting.
    You guys don't know shyt about spam.
    Danny would post on everysingle post every fucking hour, you couldnt tell which post was recent or anything. It was a fuck fest, he wouldnt have shyt to say....cares he posted like a fag he is.

    Josh made mutiple threads a day. And not just G, everywhere. That why everyone liked that dumb nikka.

    @Richard Nixon -Are you Endrat? @REAP @Digits2012 @Ghost -Son...I am dissapoint @Sjoerd -SMD @Canadian @FrosK -Dumb name is dumb @Nebulaa @That_Kid -Man Up @The XXX Devil -Oh look another joker avatar-how original and neat

    The rest who I didn't mention comment....Suck my left nut....but not to hard...it hurts.

  4. #4
    dheir's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Florida
    Posts
    376
    Reputation
    13
    Thanks
    228
    My Mood
    Amused
    I just want to say the you guys are in a terrible habit of writing the ugliest code, it is so fucking unreadable. No wonder you guys have so many issues with syntax and finding issues with your code. This is based on C++, an OOP programming style, while not demanded, is going to assist you in your debugging, and the success of your project.
    Learn to properly space your code, and make it more readable, then people will be able to assist you better.

    I've never seen so much left margin code in my life.

  5. #5
    GrenadeLaunchers's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    88
    Reputation
    10
    Thanks
    10
    Quote Originally Posted by dheir View Post
    I just want to say the you guys are in a terrible habit of writing the ugliest code, it is so fucking unreadable. No wonder you guys have so many issues with syntax and finding issues with your code. This is based on C++, an OOP programming style, while not demanded, is going to assist you in your debugging, and the success of your project.
    Learn to properly space your code, and make it more readable, then people will be able to assist you better.

    I've never seen so much left margin code in my life.

    I KNOW!! MY GOD!!!
    /agree

  6. #6
    B4M's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Real World
    Posts
    6,939
    Reputation
    478
    Thanks
    1,746
    My Mood
    Bored
    Moved to help.


    Back in '10



    Got a question?PM/VM me!
    I read them all.
    Also contact me via MSN.
    vlad@mpgh.net

    Minion since:07-04-2010
    Mod since:08-31-2010
    Till : 05.07.2011

Similar Threads

  1. [Help Request] spawn Tactical insert in mapedit /help
    By ghost123456 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 5
    Last Post: 08-12-2011, 05:34 AM
  2. [HELP] Where is the Care Package Spawn Mod
    By crazorfrazor in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 1
    Last Post: 08-24-2010, 08:13 AM
  3. [help] Spawn weapons that shoot models
    By kerocs in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 9
    Last Post: 08-12-2010, 07:00 PM
  4. [Help] Howto spawn functioning miniguns (turrets)
    By kerocs in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 1
    Last Post: 08-09-2010, 06:23 AM
  5. Mine To Claymore help!
    By grscn in forum Combat Arms Mod Discussion
    Replies: 1
    Last Post: 02-08-2010, 08:44 PM