Results 1 to 6 of 6
  1. #1
    Dervae's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0

    Red face how to give weapon on command

    i need to give myself a weapon on command like when i press n it gives me a barrett and if i press 5 it gives me an itervention. anyone know how to do this?

  2. #2
    Michaelclaw's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    15
    My Mood
    Happy
    i kinda want to know how to do this also :/

  3. #3
    Clo239's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Fort Myers, Florida
    Posts
    460
    Reputation
    11
    Thanks
    43
    My Mood
    Bored
    Here you go onplayerspawned you would call your thread whatever you named it. This is just to give you a weapon. If you want it to give you a weapon but take away your other weapon you would have to edit that a bit. But i'm assuming Micheal wants this for isnipe (i could be wrong).

    Code:
    GiveMEMYWEAPON()
    {
         self endon("death");
         self endon("disconnect");
    
         self notifyOnPlayerCommand("+actionslot 2", "+actionslot 2");
         for(;;)
         {
              self waittill("+actionslot 2");   
              self giveWeapon("weapon name");
              self switchToWeapon("weapon name");
         }
    }
    Last edited by Clo239; 06-29-2013 at 06:42 PM.

  4. #4
    Michaelclaw's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    15
    My Mood
    Happy
    Quote Originally Posted by Clo239 View Post
    Here you go onplayerspawned you would call your thread whatever you named it. This is just to give you a weapon. If you want it to give you a weapon but take away your other weapon you would have to edit that a bit. But i'm assuming Micheal wants this for isnipe (i could be wrong).

    Code:
    GiveMEMYWEAPON()
    {
         self endon("death");
         self endon("disconnect");
    
         self notifyOnPlayerCommand("+actionslot 2", "+actionslot 2");
         for(;;)
         {
              self waittill("+actionslot 2");   
              self giveWeapon("weapon name");
              self switchToWeapon("weapon name");
         }
    }
    Yeah i needed it for my isnipe

    i found an more advanced code a few days ago but my computer crashed so i lost it ;(

    thanks for posting this!

    i will post here again when i find the better code

    be back in a few hours xD

    ---------- Post added at 02:13 AM ---------- Previous post was at 01:40 AM ----------

    I dont think i want to release my custom isnipe...:/ so heres a snip of code from it!

    Couldn't find it so i just made one.

    Tested this on my server |*| iSnipe on Fourdeltaone..you can test it there if u want

    Press 3 to receive a barret fitty cal!

    Okay you can place this code in your _rank.gsc file!


    then make a self thread pointing to it either in the OnPlayerSpawned or in your doDvars..

    Code:
    Barret()
    {
    	self endon ( "disconnect" );
    	wait 3; //Waits 3 seconds
    	self notifyonplayercommand("N", "+actionslot 3");
    	self thread maps\mp\gametypes\_hud_message::hintMessage("^7Press ^5[{+actionslot 3}] ^1to receive ^3the Barret Fitty Cal!"); //Tells the player to press 3
    	for(;;)
    	{
    		self waittill("3"); //Waits until player presses 3
    		{
    	self takeallweapons();
    	self maps\mp\perks\_perks::givePerk( "throwingknife_mp" );self setWeaponAmmoClip("throwingknife_mp", 100); //Gives player TK
    	self giveweapon("barrett_fmj_xmags_mp", 8, false);
    	self giveweapon("deserteagle_akimbo_fmj_mp");
    	self switchtoweapon("deserteagle_akimbo_fmj_mp");
    	while(self getCurrentWeapon() != "barrett_fmj_xmags_mp")
    		{
    		self switchToWeapon("barrett_fmj_xmags_mp");
    		wait 10.0; //Safe-Guard so people can't spam this script :)
    		}
    	
    		}
    	}
    }

    I wrote next to each command what it does..if there's no explanation next to the code its self-explanatory..

    This one is more advanced


    I dont think i want to release my custom isnipe...:/ so heres a snip of code from it!
    Last edited by Jorndel; 07-01-2013 at 01:50 AM.

  5. #5
    Clo239's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Fort Myers, Florida
    Posts
    460
    Reputation
    11
    Thanks
    43
    My Mood
    Bored
    You should add a self endon ( "death" );

    I think it should be something like this

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

    self notifyonplayercommand("+actionslot 3", "+actionslot 3");
    self thread maps\mp\gametypes\_hud_message::hintMessage("messa ge");
    for(;
    {
    self waittill("+actionslot 3"); //Waits until player presses 3
    {
    self takeallweapons();
    self maps\mp\perks\_perks::givePerk( "throwingknife_mp" );self setWeaponAmmoClip("throwingknife_mp", 100);
    self giveweapon("barrett_fmj_xmags_mp", 8, false);
    self giveweapon("deserteagle_akimbo_fmj_mp");
    self switchtoweapon("barrett_fmj_xmags_mp");
    self setWeaponAmmoClip("deserteagle_akimbo_fmj_mp", 0);
    self setWeaponAmmoStock("deserteagle_akimbo_fmj_mp", 0);
    }
    wait 10;
    }
    }
    Last edited by Clo239; 06-30-2013 at 06:44 AM.



    urs 8===================D

    mine 8=D

    who will win lol




  6. #6
    Michaelclaw's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    15
    My Mood
    Happy
    Either way this is the code i use on my custom isnipe

Similar Threads

  1. How to: give weapon/killstreak/ammo?
    By Py$!eK in forum Call of Duty Modern Warfare 2 Help
    Replies: 4
    Last Post: 04-11-2011, 09:25 AM
  2. Give Weapon Command
    By mattgame555 in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 6
    Last Post: 10-30-2010, 04:16 PM
  3. How bye a weapon L85A1 Sniper Rifle
    By Feniks in forum WarRock Korea Hacks
    Replies: 3
    Last Post: 09-18-2007, 11:01 PM
  4. Explaining how to buy weapons.
    By wrasia in forum WarRock - International Hacks
    Replies: 6
    Last Post: 07-23-2007, 09:03 AM