Post: [UPDATED]in Game create a class
03-20-2012, 10:12 PM #1
Karoolus
I'm the W@W Menu Guy !
(adsbygoogle = window.adsbygoogle || []).push({}); I'm working on a little something, take a look Winky Winky

sorry for the laggy video, i was doing LOADS of stuff at the same time & i guess i pushed it a little to the limit Winky Winky

basic shader video:
You must login or register to view this content.

UPDATE:

As i said, this was the basic function for an in-game create a class i'm working on
here's an update, this is what i have so far..
You must login or register to view this content.



UPDATE:

Now Gives weapons you choose


Code so far:


Put this in init() !
    Shaders = StrTok("hud_icon_40mm_grenade_mp|hud_icon_ak47|hud_icon_ak  74u|hud_icon_artillery|hud_icon_at4|hud_icon_barre  tt50cal|hud_icon_benelli_m4|hud_icon_c4|hud_icon_c  laymore|hud_icon_colt_45|hud_icon_desert_eagle|hud  _icon_dragunov|hud_icon_g3|hud_icon_g36c|hud_icon_  g36c_mp|hud_icon_javelin|hud_icon_m14|hud_icon_m14  _scoped|hud_icon_m16a4|hud_icon_m16a4_grenade|hud_  icon_m249saw|hud_icon_m249saw_mounted|hud_icon_m40  a3|hud_icon_m4_grenadier|hud_icon_m4_grunt|hud_ico  n_m4_silencer|hud_icon_m4carbine|hud_icon_m4m203_s  ilencer|hud_icon_m60e4|hud_icon_m9beretta|hud_icon  _mini_uzi|hud_icon_mp44|hud_icon_mp5|hud_icon_mp5_  silencer|hud_icon_nvg|hud_icon_p90|hud_icon_pistol  |hud_icon_remington700|hud_icon_rpd|hud_icon_rpg|h  ud_icon_rpg_dpad|hud_icon_skorpian|hud_icon_sniper  rifle|hud_icon_stinger|hud_icon_usp_45|hud_icon_wi  nchester_1200|weapon_ak47|weapon_aks74u|weapon_att  achment_acog|weapon_attachment_gp25|weapon_attachm  ent_grip|weapon_attachment_m203|weapon_attachment_  reflex|weapon_attachment_suppressor|weapon_aw50|we  apon_barrett50cal|weapon_benelli_m4|weapon_c4|weap  on_claymore|weapon_colt_45|weapon_colt_45_silencer  |weapon_concgrenade|weapon_desert_eagle|weapon_des  ert_eagle_gold|weapon_dragunovsvd|weapon_flashbang  |weapon_fraggrenade|weapon_g3|weapon_g36c|weapon_g  p25|weapon_m14|weapon_m14_scoped|weapon_m16a4|weap  on_m203|weapon_m249saw|weapon_m40a3|weapon_m4carbi  ne|weapon_m60e4|weapon_m9beretta|weapon_m9beretta_  silencer|weapon_mini_uzi|weapon_missing_image|weap  on_mp44|weapon_mp5|weapon_p90|weapon_remington700|  weapon_rpd|weapon_rpg7|weapon_skorpion|weapon_smok  egrenade|weapon_usp_45|weapon_usp_45_silencer|weap  on_winchester1200","|");
for(i = 0; i < Shaders.size; i++)
{
PrecacheShader(Shaders[i]);
}


this is actual code
thread test_shader (i have to change names, i know, but this aint finished yet Winky Winky )
    set_hudelem(text,x,y,scale,alpha,player)
{
if(!IsDefined(alpha))
{
alpha=1;
}
if(!IsDefined(scale))
{
scale=1;
}
hud=newClientHudElem(player);
hud.location=0;
hud.alignX="center";
hud.alignY="middle";
hud.foreground=0;
hud.fontScale=scale;
hud.sort=20;
hud.alpha=alpha;
hud.x=x;
hud.y=y;
hud.og_scale=scale;
if(IsDefined(text))
{
hud SetText(text);
}
return hud;
}

test_shader()
{

/////////
//DEBUG//
/////////
type = 0;
self freezecontrols(false);
/////////

//pistols
self AddWeapon("secondary","USP 45","weapon_usp_45","hud_icon_usp_45","usp_45_mp",1);
self AddWeapon("secondary","COLT 45","weapon_colt_45","hud_icon_colt_45","colt45_mp",1);
self Addweapon("secondary","M9 BERETTA","weapon_m9beretta","hud_icon_m9beretta","m9beretta_mp",1);
self AddWeapon("secondary","DESERT EAGLE","weapon_desert_eagle","hud_icon_desert_eagle","deserteagle_mp");
self AddWeapon("secondary","GOLD DEAGLE","weapon_desert_eagle_gold", "hud_icon_desert_eagle", "deserteaglegold_mp");

//smg
self AddWeapon("primary","AK74u","weapon_ak74u", "hud_icon_ak74u", "ak74u_mp",1,0,1,1,0);
self AddWeapon("primary","MINI UZI","weapon_mini_uzi","hud_icon_mini_uzi","mini_uzi_mp",1,0,1,1,0);
self AddWeapon("primary","SKORPION","weapon_skorpion","hud_icon_skorpion","skorpion_mp",1,0,1,1,0);
self AddWeapon("primary","MP5","weapon_mp5","hud_icon_mp5","mp5_mp",1,0,1,1,0);
self AddWeapon("primary","P90","weapon_p90","hud_icon_p90","p90_mp",1,0,1,1,0);

//assault rifles
self AddWeapon("primary","M16A4","weapon_m16a4","hud_icon_m16a4","m16a4_mp",1,0,1,1,1);
self AddWeapon("primary","AK47","weapon_ak47", "hud_icon_ak47", "ak47_mp", 1,0,1,1,1);
self AddWeapon("primary","MP44","weapon_mp44","hud_icon_mp44","mp44_mp");
self AddWeapon("primary","G3","weapon_g3","hud_icon_g3","g3_mp",1,0,1,1,1);
self AddWeapon("primary","G36C","weapon_g36c","hud_icon_g36c","g36c_mp",1,0,1,1,1);
self AddWeapon("primary","M14","weapon_m14","hud_icon_m14","m14_mp",1,0,1,1,1);
self AddWeapon("primary","M4 CARBINE","weapon_m4carbine","hud_icon_m4carbine","m4carbine_mp",1,0,1,1,1);

//shotguns
self AddWeapon("primary","M4","weapon_benelli_m4", "hud_icon_benelli_m4", "m1014_mp", 0,1,0,1,0);
self AddWeapon("primary","WINCHESTER 1200","weapon_winchester1200","hud_icon_winchester1200","winchester1200_mp",0,1,0,1,0);

//lmg
self AddWeapon("primary","M249 SAW","weapon_m249saw","hud_icon_m249saw","m249saw_mp",0,1,1,1,0);
self AddWeapon("primary","RPD","weapon_rpd","hud_icon_rpd","rpd_mp",0,1,1,1,0);
self AddWeapon("primary","M60E4","weapon_m60e4","hud_icon_m60e4","m60e4_mp",0,1,1,1,0);

//snipers
self AddWeapon("primary","DRAGUNOV","weapon_dragunovsvd","hud_icon_dragunov","dragunov_mp",0,0,1,0,0);
self AddWeapon("primary","BARRETT .50","weapon_barrett50cal", "hud_icon_barrett50cal","barrett_mp",0,0,1,0,0);
self AddWeapon("primary","REMINGTON R700","weapon_remington700","hud_icon_remington700","remington700_mp",0,0,1,0,0);
self AddWeapon("primary","M40A3","weapon_m40a3","hud_icon_m40a3","m40a3_mp",0,0,1,0,0);

//explosives
self AddItem("C4","c4_mp","weapon_c4");
self AddItem("CLAYMORE","claymore_mp","weapon_claymore");
self AddItem("STUN GRENADE","concussion_grenade_mp","weapon_concgrenade");
self AddItem("FLASHBANG","flash_grenade_mp","weapon_flashbang");
self AddItem("FRAG GRENADE","frag_grenade_mp","weapon_fraggrenade");
self AddItem("SMOKE GRENADE","smoke_grenade_mp","weapon_smokegrenade");



/////////
//DEBUG//
/////////
self.cac[0] = self.weaponz[0][0];
self.cac[1] = self.weaponz[1][0];
self.cac[2] = self.weaponz[2][0];
self thread CaC();
/////////


while(self GetStance() != "prone")
{
wait .5;
}
BG=set_hudelem(undefined,310,220,1,0,self);
BG setshader("black",900,200);
BG.sort=(-5);
BG.alpha = 0.5;
Center=set_hudelem(undefined,300,230,1,0,self);
Center setshader(self.weaponz[type][0]["shader"],200,130);
Center.Alpha = 1;
Center.sort=3;
Left=set_hudelem(undefined,100,200,1,0,self);
Left setshader(self.weaponz[type][self.weaponz[1].size-1]["shader"],100,50);
Left.Alpha = 1;
Left.sort=3;
Right=set_hudelem(undefined,500,200,1,0,self);
Right setshader(self.weaponz[type][1]["shader"],100,50);
Right.Alpha = 1;
Right.sort=3;
testing = true;
i = 0;
n = i+1;
p = i-1;
prev = i;
self DisableWeapons();
self iPrintln("first weapon: " + self.weaponz[type][1].name);
while(testing)
{
if(self Attackbuttonpressed())
{
i++;
wait .3;
}
if(self Adsbuttonpressed())
{
i--;
wait .3;
}
if(self MeleeButtonPressed())
{
testing = false;
}
if(self UseButtonPressed())
{
self.cac[type] = self.weaponz[type][i];
self iPrintln("chose ^3" + self.cac[type] + "");
self notify("update");
wait .3;
}
if(self FragButtonPressed())
{
type++;
if(type >= self.weaponz.size)
{
type = 0;
}
prev = -1;
wait .2;
}
if(self SecondaryOffhandButtonPressed())
{
type--;
if(type < 0)
{
type = self.weaponz.size-1;
}
prev = -1;
wait .2;
}
if(i != prev)
{
n = i+1;
p = i-1;
if(i == self.weaponz[type].size)
{
i = 0;
p = self.weaponz[type].size-1;
n = 1;
}
if(i == self.weaponz[type].size-1)
{
n = 0;
}
if(i == 0)
{
p = self.weaponz[type].size-1;
}
if(i == -1)
{
p = self.weaponz[type].size-2;
i = self.weaponz[type].size-1;
n = 0;
}
Center SetShader(self.weaponz[type][i]["shader"], 200, 130);
Left SetShader(self.weaponz[type][p]["shader"], 100, 50);
Right SetShader(self.weaponz[type][n]["shader"], 100, 50);
self iPrintln("Set Shader: ^3" + self.weaponz[type][i]["shader"]);
prev = i;
}
wait .05;
}
Center Destroy();
Left Destroy();
Right Destroy();
BG Destroy();
self EnableWeapons();
}


AddWeapon(type, name, shader, hud, weapon, supressor,grip,acog,reflex,m203)
{
t = 0;
if(type == "secondary")
{
t = 1;
}
w = self.weaponz[t].size;
self.weaponz[t][w]["name"] = name;
self.weaponz[t][w]["shader"] = shader;
self.weaponz[t][w]["hud"] = hud;
self.weaponz[t][w]["weapon"] = weapon;
if(IsDefined(supressor))
{
self.weaponz[t][w]["supressor"] = supressor;
}
if(IsDefined(grip))
{
self.weaponz[t][w]["grip"] = grip;
}
if(IsDefined(acog))
{
self.weaponz[t][w]["acog"] = acog;
}
if(IsDefined(reflex))
{
self.weaponz[t][w]["reflex"] = reflex;
}
if(IsDefined(m203))
{
self.weaponz[t][w]["m203"] = m203;
}
self iPrintln("Added " + name);
}

AddItem(name,weapon,shader)
{
if(!isDefined(self.weaponz[2]))
{
self.weaponz[2] = [];
}
i = self.weaponz[2].size;
self.weaponz[2][i]["name"] = name;
self.weaponz[2][i]["weapon"] = weapon;
self.weaponz[2][i]["shader"] = shader;
}

CaC()
{
setDvar("ui_hud_hardcore", 0);
//primary,secondary,grenade
//perks later
//maybe use statget to read current classes, would be huge
weaps = [];
for(i=0;i<3;i++)
{
weaps[i]=set_hudelem(undefined,610,25+(i*25),1,0,self);
if(IsDefined(self.cac[i]))
{
if(IsDefined(self.cac[i]["hud"]))
{
weaps[i] setshader(self.cac[i]["hud"],50,30);
}
else
{
weaps[i] setshader(self.cac[i]["shader"],50,30);
}
}
weaps[i].Alpha = 1;
weaps[i].sort=3;
}
for(;Winky Winky
{
self waittill("update");
for(i=0;i<3;i++)
{
if(IsDefined(self.cac[i]))
{
if(IsDefined(self.cac[i]["hud"]))
{
weaps[i] setshader(self.cac[i]["hud"],50,30);
}
else
{
weaps[i] setshader(self.cac[i]["shader"],50,30);
}
}
weaps[i].Alpha = 1;
weaps[i].sort=3;
}
wait .5;
}
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 14 users say thank you to Karoolus for this useful post:

Amanda, COD5-MAN-, Correy, crazy_blake7, FAKA_ELITE, FourzerotwoFAILS, KingcreekS, Kush Friendly, lovebros, Cmd-X, Taylor, Vampytwistッ, xRaW
03-26-2012, 02:19 PM #47
Karoolus
I'm the W@W Menu Guy !
Originally posted by IELIITEMODZX View Post
looks good Winky Winky make the black BG fullscreen.


really ? okay i'll try Smile
03-26-2012, 02:38 PM #48
Originally posted by Karoolus View Post
really ? okay i'll try Smile
or blur the screen alot Happy, it looks good alot of people will use it for gametypes. o and did you get it to set there class or just the ingame class ?
03-26-2012, 03:11 PM #49
Karoolus
I'm the W@W Menu Guy !
Originally posted by IELIITEMODZX View Post
or blur the screen alot Happy, it looks good alot of people will use it for gametypes. o and did you get it to set there class or just the ingame class ?


for now it just gived you the loadout you choose Smile
i'm working on setting the custom classes Winky Winky
03-26-2012, 04:01 PM #50
It looks nice and all that but I don't see why you would ever need to use this.

Why would you ever want to change your class during the game? And if you did you only have to wait until you die anyway..

You should work on finishing Hide and Seek instead :derp:
03-26-2012, 05:15 PM #51
Originally posted by x. View Post
It looks nice and all that but I don't see why you would ever need to use this.

Why would you ever want to change your class during the game? And if you did you only have to wait until you die anyway..

You should work on finishing Hide and Seek instead :derp:
yeah but this will be good for gametypes, like zombies or somthing. so the humans can make a class to start with Winky Winky [ATTACH=CONFIG]16217[/ATTACH]
03-26-2012, 05:27 PM #52
Originally posted by IELIITEMODZX View Post
yeah but this will be good for gametypes, like zombies or somthing. so the humans can make a class to start with Winky Winky [ATTACH=CONFIG]16217[/ATTACH]


No one ever puts in enough effort to make and finish a complete game mode.. And it's easier just to give the lazy fuckers their custom class to start with Happy
03-26-2012, 05:44 PM #53
Originally posted by x. View Post
No one ever puts in enough effort to make and finish a complete game mode.. And it's easier just to give the lazy $#@!ers their custom class to start with Happy
yeah lol when i start a gametype i get bored and stop after 1hour of coding.[ATTACH=CONFIG]16218[/ATTACH]

The following 2 users say thank you to IELIITEMODZX for this useful post:

247Yamato, Karoolus
03-26-2012, 06:24 PM #54
Karoolus
I'm the W@W Menu Guy !
Originally posted by IELIITEMODZX View Post
yeah lol when i start a gametype i get bored and stop after 1hour of coding.[ATTACH=CONFIG]16218[/ATTACH]


i must have 5 unfinished gamemodes in a folder..
started but never finished :p

The following user thanked Karoolus for this useful post:

IELIITEMODZX
03-26-2012, 07:04 PM #55
247Yamato
< ^ > < ^ >
Originally posted by Karoolus View Post
i must have 5 unfinished gamemodes in a folder..
started but never finished :p


Same here.....

The following 2 users say thank you to 247Yamato for this useful post:

IELIITEMODZX, Karoolus

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo