Post: [RELEASE] Easy + Short Way To Give A Weapon
01-20-2012, 04:58 PM #1
IVI40A3Fusionz
Former Gaming Squad Member
(adsbygoogle = window.adsbygoogle || []).push({}); NOTE: Firstly all the 'good' or more experienced modders will know this and it is very old, it is simply for the newer coders to learn off.

I've been looking in some other peoples W@W and COD4 patches and i still see people doing this when they give a weapon and they do this for every weapon they want to give.
    
GiveWeapon()
{
self giveWeapon( "WEAPONNAME_mp", 0, false );
}


However you can shorten this very easily using this function:
    
GiveWep(Weapon)
{
self giveWeapon( Weapon, 0, false );
}


You simple do this:

Function = GiveWep
Input = "WEAPONNAME_mp"

Example using Karoolus' menu base:
    
self.option[0][0] = "Default Weapon";
self.function[0][0] = ::GiveWep;
self.opt[0][0] = "defaultweapon_mp";


So now instead of creating a new function for every weapon you wanna give you just use one leaving you with more space Winky Winky.

.Choco's Version:
    GiveGun(gun)
{
self setClientDvar("activeAction", "give "+gun);
}

Have a good day and enjoy Smile.

Weapons List: You must login or register to view this content.
Press Ctrl + F and type [C035] to see all the weapon codes Smile.
Last edited by IVI40A3Fusionz ; 01-20-2012 at 05:37 PM.

The following user thanked IVI40A3Fusionz for this useful post:

thatbrat
02-02-2012, 08:57 PM #11
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Karoolus View Post
& end up with a smoke grenade :lol:

sup man, long time no see ? how've you been ?


You should think about making a W@W patch, you done some amazing things and pretty much turned around COD4 Modding with help from DaftVader imagine what you could do now to W@W considering your first W@W menu was awesome.
02-02-2012, 09:00 PM #12
Karoolus
I'm the W@W Menu Guy !
Originally posted by IVI40A3Fusionz View Post
You should think about making a W@W patch, you done some amazing things and pretty much turned around COD4 Modding with help from DaftVader imagine what you could do now to W@W considering your first W@W menu was awesome.


1. i don't make patches anymore

2. what was amazing ? i used my brain to do something ppl did all the time on MW2

3. my menu now is still my first menu, just slightly edited.. the COD4 menu people use, is STILL the very same menu, i just added 2 things:
addoption/addmenu & overflow fix (which imo should be used in WAW as well, just to save precious hud elements Winky Winky )

4. i'm still here if you want/need help
02-02-2012, 09:03 PM #13
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Karoolus View Post
1. i don't make patches anymore

2. what was amazing ? i used my brain to do something ppl did all the time on MW2

3. my menu now is still my first menu, just slightly edited.. the COD4 menu people use, is STILL the very same menu, i just added 2 things:
addoption/addmenu & overflow fix (which imo should be used in WAW as well, just to save precious hud elements Winky Winky )

4. i'm still here if you want/need help


1. Awww man :(.

2. I just loved your menu lol simple to use, small (on screen) made it look 'cute' :p, MW2 menus were exactly the same all the time e.g DConnors menu base.

3. Exactly you pretty much changed how everyone mods COD4 using addoption and overflow fix etc. (Even though people may have caught on to it).

4. Yay Smile.
02-02-2012, 09:14 PM #14
nay1995
The Master
Originally posted by Karoolus View Post
& end up with a smoke grenade :lol:

sup man, long time no see ? how've you been ?


he he ive been bashing mw3, i got to #19 at domination, #27 at kills and #148 at score, im good anyway how are you?

---------- Post added at 04:14 PM ---------- Previous post was at 04:10 PM ----------

ahhh well if you wanted that then strTok the weapns then notify the function e.g.
02-03-2012, 07:38 AM #15
Correy
I'm the Original
Originally posted by nay View Post
or you just do this

getonmylevel()
{
RandomWeap=level.weaponList[randomint(level.weaponList.size)];
self giveWeapon(RandomWeap);
self switchToWeapon(RandomWeap);
}


you'd need a short wait in there or it wouldn't switch to it

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo