Red faceHelphow to give weapon on command

Posts 1–6 of 6 · Page 1 of 1
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?
i kinda want to know how to do this also :/
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");
     }
}
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!
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;
}
}
Either way this is the code i use on my custom isnipe
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us