Posts: 916
Threads: 65
Joined: Jun 2011
Just a simple code to make a weapon list (tell me where to put the weapon name please)
also is it possible to make 2 weapons list and link weapons together like I will show an example of what I mean
List:
1:ak47_mp
2:l96_mp
3
pas12_mp
List2:
1:ballistic knife
2:makarov
3:python
ak47_mp is linked to ballistic knife
l96_mp is linked to makarov
etc...
Posts: 916
Threads: 65
Joined: Jun 2011
07-26-2011, 00:16
(This post was last modified: 07-26-2011, 01:00 by Scripts18.)
I will post the code Im using it for and you will tell me if its possible to do what I want
Code:
do_knife()
{
self endon( "death" );
self endon ("disconnect");
clip_ammo = self GetWeaponAmmoClip( self.name );
clip_max_ammo = WeaponClipSize( self.name );
while(1)
{
if(self FragButtonPressed() && self getcurrentweapon("Normalknife_sp"))
{
self waittill(!self getcurrentweapon("ThrowingNormalKnife_Sp"));
self takeweapon("Normalknife_sp");
self giveWeapon("rebirth_hands_sp");
wait 0.05;
if(self hasweapon("rebirth_hands_sp"))
{
self switchtoweapon("rebirth_hands_sp");
}
else
{
self thread do_next();
}
}
if(self hasweapon("rebirth_hands_sp"))
{
wait 0.1;
self takeweapon("NormalKnife_sp");
}
if(self GetAmmoCount("ThrowingNormalKnife_sp") >= 1)
{
self giveweapon("NormalKnife_sp");
self takeweapon("rebirth_hands_sp");
}
if(self usebuttonpressed())
{
self switchtoweapon("NormalKnife_sp");
}
if(self GetAmmoCount("ThrowingNormalKnife_sp") == 0)
{
self takeweapon("NormalKnife_sp");
}
wait 0.01;
}
}
(I dont recommend any one to use this code it has issues yet and Its for my own use, ask me before using it or any part of it :S)I wanna link the NormalKnife_sp (in this case) with the ThrowingNormalKnife_sp
but I have also like 7 other same thread like this with other weapons (including their throwing variants) I wanna link them so it doesnt mess up the whole code and to have less threads and so I can take many knives without bugging it all
Posts: 184
Threads: 11
Joined: May 2011
Reputation:
1
Still not quite understand you.. but I think you mean. Whenever you want to take away weapon X, you want to give them weapon Y? Or when take away weapon X, you also want to take away weapon Y?
In which case the code I gave should work. Just put weaponlist1[0] anmd weaponlist2[0] to be the weapons you want `linked`. Add me on steam/xfire madnesslink5 if you need more help.