Quacked420
Veteran
- Messages
- 58
- Reaction score
- 10
- Points
- 793
- Thread starter
- #21
Thanks trying it now.
beat me to it xDCode:changeModel(model) { self setModel(model); self iprintln("Model set to: " + model); } //Use in your menu like ::changeModel, "model name here");
Quick question is there a code like that for a weapon menu?Code:changeModel(model) { self setModel(model); self iprintln("Model set to: " + model); } //Use in your menu like ::changeModel, "model name here");
You got a code for multiplayer?
Sure, you can give weapon with this method:Quick question is there a code like that for a weapon menu?
Thanks but would this give me the weapon or another player? And where should I put the code (Sorry started making GSC yesterday :/).
Wait I'm on way at home, I will answer in a secondThanks but would this give me the weapon or another player? And where should I put the code (Sorry started making GSC yesterday :/).
Ok thank you!Wait I'm on way at home, I will answer in a second
Ok so:Ok thank you!
giveWeapon()
{
self giveWeapon("TEST_WEAPONNAME");
}
giveWeapon()
{
self giveWeapon("an94_mp");
}
giveWeapon()
{
self TakeWeapon( self getcurrentweapon() ); //Will take one weapon! Same like you pick up a dropped weapon.
self giveWeapon("an94_mp"); //Will give yourself the new weapon
self switchtoweapon("an94_mp"); //Will swtich to the new weapon
}
giveWeapon(input)
{
self TakeWeapon( self getcurrentweapon() );
self giveWeapon(input);
self switchtoweapon(input);
}
This should work right?Ok so:
First of all let's build a function to give yourself weapons:
self - definite that you give the weapon yourselfCode:giveWeapon() { self giveWeapon("TEST_WEAPONNAME"); }
TEST_WEAPONNAME - There you can place a weapon name. You will get this weapon!
So the next step it to chose a weapon, you can find the weapons names here:
Weapon List
So let's pick a random multiplayer weapon:
an94_mp
So now we need to replace TEST_WEAPONNAME with an94_mp! It will look like this:
So you will get the weapon after you call giveWeapon();Code:giveWeapon() { self giveWeapon("an94_mp"); }
You can't use zombie weapons on Multiplayer.
Also to optimize your weapon function I recommend to do that:
Code:giveWeapon() { self TakeWeapon( self getcurrentweapon() ); //Will take one weapon! Same like you pick up a dropped weapon. self giveWeapon("an94_mp"); //Will give yourself the new weapon self switchtoweapon("an94_mp"); //Will swtich to the new weapon }
Also you can use Inputs:
So now you can call:Code:giveWeapon(input) { self TakeWeapon( self getcurrentweapon() ); self giveWeapon(); self switchtoweapon(input); }
self giveWeapon("an94_mp"); //To give the AN94!
self giveWeapon("mp7_mp"); //To give the MP7!
This makes it possible to give you any weapon with a input with only one function!
I hope this helped you a little bit! Have a nice evening!
Your CabCon!
No, in a menu structure you need to do like that:
self add_option("Weapons" , "Default Weapon", ::giveWeapon, "defaultweapon_mp");
giveWeapon(input)
{
self TakeWeapon( self getcurrentweapon() );
self giveWeapon(input);
self switchtoweapon(input);
}
Oh it works, thank you very much!No, in a menu structure you need to do like that:
Code:self add_option("Weapons" , "Default Weapon", ::giveWeapon, "defaultweapon_mp");
Use this function:
Code:giveWeapon(input) { self TakeWeapon( self getcurrentweapon() ); self giveWeapon(input); self switchtoweapon(input); }
Cheers, feel free to ask any time again!Oh it works, thank you very much!
Sorry to bother you but how would I create a submenu like:Cheers, feel free to ask any time again!
np, you need to create a structure of submenus with the 'category names' (e.g.: Snipers, Assault Rifles). After that you put inside this submenu all for example snipers.Sorry to bother you but how would I create a submenu like:
Weapons>Snipers
Weapons>Assault Rifles
etc.? Thanks
Ok so would this work?:np, you need to create a structure of submenus with the 'category names' (e.g.: Snipers, Assault Rifles). After that you put inside this submenu all for example snipers.
Yeap, do this and this should work.Ok so would this work?:
and change the doWeapon to giveWeapon?
Ok so I just started with just pistols like this:Yeap, do this and this should work.
You need to remove that:Ok so I just started with just pistols like this:
When I click Weapons the first option is just a O or 0 when I click it it just stays the same and when I try go back it stays the same you know what's wrong? Thanks.
Ok should I retry now?You need to remove that: