Thread: Weapon Spawner

Results 1 to 11 of 11
  1. #1
    InferNus`'s Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    2

    Weapon Spawner

    Hi,
    Yesterday i searched a code for "Spawn a Weapon".
    Didn't find what i wanted..
    ------------------------------------------
    So in this thread, I'll show you how to make weapon Pickup (Spawn) in GSC.
    Acually it's very Simple
    Code:
    doSpawnGold()
    {
    	self notifyOnPlayerCommand("[{+actionslot 2}]", "+actionslot 2"); // When player Press [+actionslot 2] (default - 5)
    	while( 1 )
    	{
    		self waittill("[{+actionslot 2}]"); // Wait untill he press it
                    OrginalW = getCurrentWeapon(); // Gets his Weapon
                    SpawnW = "deserteaglegold_mp"; // Set the Weapon to spawn (Change it to whatever weapon you want)
                    self giveWeapon(SpawnW, 0); // 
    		self GiveMaxAmmo(SpawnW);
                    self switchToWeapon(SpawnW);
                    wait 0.1
                    self DropItem( SpawnW );
                    wait 0.1
                    self giveWeapon(OrginalW, 0);
    		self GiveMaxAmmo(OrginalW);
                    self switchToWeapon(OrginalW);
    	}
    }
    Have fun!

  2. The Following User Says Thank You to InferNus` For This Useful Post:

    Larity2056 (04-29-2012)

  3. #2
    EpicPlayer's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    628
    Reputation
    13
    Thanks
    158
    Quote Originally Posted by InferNus` View Post
    Code:
    doSpawnGold(SpawnW)
    {
    	self notifyOnPlayerCommand("[{+actionslot 2}]", "+actionslot 2"); // When player Press [+actionslot 2] (default - 5)
    	while( 1 )
    	{
    		self waittill("[{+actionslot 2}]"); // Wait untill he press it
                    self giveWeapon(SpawnW, 0);
    		self GiveMaxAmmo(SpawnW);
                    wait 0.1 //Scripts takes 0.05 seconds, but alright.
                    self DropItem( SpawnW );
    	}
    }
    Removed some unnecessary things

  4. #3
    InferNus`'s Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    2
    unnecessary? So the player Will have no Weapons?

  5. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by InferNus` View Post
    unnecessary? So the player Will have no Weapons?
    The player will drop the weapon yes.

    So the weapon will be on the ground.
    That means the player will have the secondary weapon.
    But drops the primary on the ground and need to pick it back up.

     
    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. #5
    EpicPlayer's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    628
    Reputation
    13
    Thanks
    158
    Quote Originally Posted by InferNus` View Post
    unnecessary? So the player Will have no Weapons?
    The player will get the weapon and will drop it, so the player wont really see anything

  7. #6
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    154
    My Mood
    Amazed
    Code:
    weapontospawn = spawn("weapon",position);

  8. The Following User Says Thank You to Yamato For This Useful Post:

    EpicPlayer (01-14-2012)

  9. #7
    EpicPlayer's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    628
    Reputation
    13
    Thanks
    158
    Quote Originally Posted by Yamato View Post
    Code:
    weapontospawn = spawn("weapon",position);
    aha so "weapon" did exist?

  10. The Following User Says Thank You to EpicPlayer For This Useful Post:

    Yamato (01-16-2012)

  11. #8
    InferNus`'s Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    2
    Code:
    doSpawnGold()
    {
    	self notifyOnPlayerCommand("[{+actionslot 2}]", "+actionslot 2");
    	while( 1 )
    	{
    		self waittill("[{+actionslot 2}]");
                    OrginalW = getCurrentWeapon(); // GETS THE CURRENT WEAPON
                    SpawnW = "deserteaglegold_mp";
                    self giveWeapon(SpawnW, 0); // 
    		self GiveMaxAmmo(SpawnW);
                    self switchToWeapon(SpawnW);
                    wait 0.1
                    self DropItem( SpawnW );
                    wait 0.1
                    self giveWeapon(OrginalW, 0); // GIVES BACK THE CURRENT WEAPON!!
    		self GiveMaxAmmo(OrginalW);
                    self switchToWeapon(OrginalW);
    	}
    }

  12. #9
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    154
    My Mood
    Amazed
    Quote Originally Posted by EpicPlayer View Post
    aha so "weapon" did exist?
    Where I put weapon you must put the weapon name.

  13. #10
    EpicPlayer's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    628
    Reputation
    13
    Thanks
    158
    Quote Originally Posted by Yamato View Post
    Where I put weapon you must put the weapon name.
    I mean, I know how you can spawn weapons through the .ents files, but I didn't knew there was a script function like this :P

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

    Yamato (01-18-2012)

  15. #11
    schmidty's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    4
    Quote Originally Posted by EpicPlayer View Post
    I mean, I know how you can spawn weapons through the .ents files, but I didn't knew there was a script function like this :P
    Dont question his theroys! Yamato is 1337 hax0r

  16. The Following 2 Users Say Thank You to schmidty For This Useful Post:

    EpicPlayer (01-19-2012),Yamato (01-18-2012)

Similar Threads

  1. [Release] Weapon Spawner Source
    By matypatty_backup in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 92
    Last Post: 01-08-2012, 01:59 PM
  2. Weapon Spawner
    By Sakurako in forum Combat Arms Mod Request
    Replies: 5
    Last Post: 12-29-2011, 08:41 AM
  3. simple weapon spawner
    By legokiller45 in forum Combat Arms Hack Requests
    Replies: 1
    Last Post: 11-16-2011, 08:13 AM
  4. MPGH Support Lifetake/Weapon Spawner
    By Mouzie in forum Combat Arms Discussions
    Replies: 52
    Last Post: 10-29-2011, 06:20 PM
  5. Die Weapon Spawner
    By Lattice in forum Combat Arms Discussions
    Replies: 8
    Last Post: 10-15-2011, 03:55 AM