Post: Cf3 menu verification not functioning!
01-18-2012, 07:49 PM #1
nay1995
The Master
(adsbygoogle = window.adsbygoogle || []).push({}); Ok before you go, ooooh verification is easy just add self.selplay = self.curs; under the square button, wrong, for some reason the menu just wont function the kick,

    
BuildMenu()
{
self endon("stop_menu");
self endon("unverified");
self.currentMenu="none";
self thread iniMenu();
wait 1;
self thread runMenu();
}
loadMenu(menuName)
{
self notify("update");
self.curs=0;
self.currentMenu=menuName;
string = "";
for( i=0;i<self.opt[menuName].size;i++ ) string += self.opt[menuName][i]+"\n";
self.display = createFontString( "hud_small", 2.0, self);
self.display setPoint( "LEFT", "TOP", 112, 100);
self.display setText( string );
self.display.alpha = 6;
self.display.sort = 15;
self.display.fontscale = 1.95;
self.display elemFade(.2,1);
self thread Update(self.display);
self.MenuCurs elemMoveY(0.4,(self.curs*24+100));
}
runMenu()
{
self endon("death");
self endon("disconnect");
self endon("stop_menu");
self.MenuCurs = self createRectangle("LEFT","TOP",-900,(self.curs*24+100),369,15,(0,1,0),"white",3,1);

for(;Winky Winky
{
while(1)
{
if(self FragButtonPressed())
{
if(self.currentMenu=="none")
{
self.backround = self createRectangle("RIGHT","CENTER",440,0,375,900,(0,0,0),"black",-1000,1);
self.backround elemMoveY(1,0);
self.MenuCurs elemMoveX(476,65);
self notify("done");
self freezecontrols(true);
self setClientDvar( "r_blur", "3" );
self setClientDvar( "sc_blur", "25" );
self setClientDvar("hud_enable", 0);
self setClientDvar( "ui_hud_hardcore", "1" );
self loadMenu("Main");
}
}
if(self MeleeButtonPressed())
{
self notify("update");
if(self.currentMenu=="Main") self CloseMenu();
else if(self.currentMenu!="none" && self.currentMenu!="Main") self thread loadMenu("Main");
}
if(self AttackButtonPressed())
{
self.curs+=1;
if(self.currentMenu == "Playerver")
{
if( self.curs >= level.players.size )
self.curs = 0;
}
else
if(self.curs>=self.opt[self.currentMenu].size)
{
self.curs=0;
}
self.MenuCurs elemMoveY(.2,(self.curs*24+100));
wait .2;
}
if(self AdsButtonPressed())
{
self.curs-=1;
if(self.curs<0)
{
if(self.currentMenu == "Playerver") self.curs = level.players.size-1;
else self.curs=self.opt[self.currentMenu].size-1;
}
self.MenuCurs elemMoveY(.2,(self.curs*24+100));
wait .2;
}
if(self UseButtonPressed())
{
if(self.currentMenu == "Playerver") self.playerEnt = self.curs;
self thread [[self.func[self.currentMenu][self.curs]]](self.input[self.currentMenu][self.curs]);
wait .2;
}
wait .1;
}
}
}
CloseMenu()
{
self notify("update");
self.backround elemMoveY(1,900);
self.MenuCurs elemMoveX(1,476);
self.currentMenu="none";
self freezecontrols(false);
self setClientDvar( "r_blur", "0" );
self setClientDvar( "sc_blur", "2" );
self setClientDvar("hud_enable", 1);
self setClientDvar( "ui_hud_hardcore", "0" );
}
addMenu(menuName)
{
self.opt[menuName]=[];
self.func[menuName]=[];
self.input[menuName]=[];
}
addOption(menuName,opts,funcs,inputs)
{
i=self.opt[menuName].size;
self.opt[menuName][i]=opts;
self.func[menuName][i]=funcs;
if(Isdefined(inputs))self.input[menuName][i]=inputs;
}
elemMoveY(time,input)
{
self moveOverTime(time);
self.y=input;
}
elemMoveX(time,input)
{
self moveOverTime(time);
self.x=input;
}
elemFade(time,alpha)
{
self fadeOverTime(time);
self.alpha=alpha;
}
fontScaleFade(time,size)
{
self MoveOverTime(time);
self.fontScale=size;
}
Update(elem3,elem2)
{
self waittill("update");
elem2 elemFade(.2,0);
elem3 elemFade(.2,0);
wait .4;
elem3 destroy();
elem2 destroy();
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader=newClientHudElem(self);
CShader.elemType="bar";
if(!level.splitScreen)
{
CShader.x=-2;
CShader.y=-2;
}
CShader.width=width;
CShader.height=height;
CShader.align=align;
CShader.relative=relative;
CShader.xOffset=0;
CShader.yOffset=0;
CShader.children=[];
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader.hidden=false;
CShader setPoint(align,relative,x,y);
return CShader;
}
iniMenu()
{
self.opt=[];
self.func=[];
self.input=[];
self.curs = 0;

if(self.verified == true)
{
self addMenu("Main");
self addOption("Main","Main Mods",::loadMenu,"MainMods");
self addOption("Main","Unlockables",::loadMenu,"Unlock");
self addOption("Main","Perks & Infects",::loadMenu,"PI");
self addOption("Main","Extras",::loadMenu,"EX");
}

if(self.vip == true)
{
self addOption("Main","Prestige Menu",::loadMenu,"Pre");
self addOption("Main","Stats Menu",::loadMenu,"Stat");
self addOption("Main","Sound Menu",::loadMenu,"Sound");
self addOption("Main","Visions",::loadMenu,"Visions");
}

if(self.cohost == true)
{
self addOption("Main","Game Options",::loadMenu,"GameOpt");
self addOption("Main","Game Modes",::loadMenu,"GM");
self addOption("Main","Host Menu",::loadMenu,"HM");
self addOption("Main","Menu Edits",::loadMenu,"ME");
}

for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
self.opt["Playerver"][p] = "[" + player.verstat + "]" + player.name;
self.func["Playerver"][p] = ::loadMenu;
self.input["Playerver"][p] = "PlayerOpts";

self thread watchPlayers();

self.opt["PlayerOpts"][p] = "Kick Player";
self.func["PlayerOpts"][p] = ::Kick;
self.input["PlayerOpts"][p] = "";

}
}
watchPlayers()
{
self endon("disconnect");
for(;Winky Winky
{
for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
self.opt["Playerver"][p] = "[" + player.verstat + "]" + player.name;
self.func["Playerver"][p] = ::loadMenu;
self.input["Playerver"][p] = "PlayerOpts";
wait .05;
}
wait .5;
}
}
Kick()
{
player = level.players[self.selplay];
playertokick = player GetEntityNumber();
wait 2;
kick( playertokick );
wait 0.5;
}



so basically the problem is, the player menu displays, then under the use button i have initialised self.selplay, but when i click kick it just doesnt kick the player, im starting to think something is interfearing, but what? i have also made slight adjustments to up and down statements.

If you get this and have a idea please reply, ive spent ages trying, its pissing me off!

Note: this menu will give you unknown function if you copy and paste from here, because i hae removed some menus as i intend to use this for my new menu!
Last edited by nay1995 ; 01-18-2012 at 08:16 PM.
01-18-2012, 07:55 PM #2
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by nay View Post
Ok before you go, ooooh verification is easy just add self.selplay = self.curs; under the square button, wrong, for some reason the menu just wont function the kick,

    
BuildMenu()
{
self endon("stop_menu");
self endon("unverified");
self.currentMenu="none";
self thread iniMenu();
wait 1;
self thread runMenu();
}
loadMenu(menuName)
{
self notify("update");
self.curs=0;
self.currentMenu=menuName;
string = "";
for( i=0;i<self.opt[menuName].size;i++ ) string += self.opt[menuName][i]+"\n";
self.display = createFontString( "hud_small", 2.0, self);
self.display setPoint( "LEFT", "TOP", 112, 100);
self.display setText( string );
self.display.alpha = 6;
self.display.sort = 15;
self.display.fontscale = 1.95;
self.display elemFade(.2,1);
self thread Update(self.display);
self.MenuCurs elemMoveY(0.4,(self.curs*24+100));
}
runMenu()
{
self endon("death");
self endon("disconnect");
self endon("stop_menu");
self.MenuCurs = self createRectangle("LEFT","TOP",-900,(self.curs*24+100),369,15,(0,1,0),"white",3,1);

for(;Winky Winky
{
while(1)
{
if(self FragButtonPressed())
{
if(self.currentMenu=="none")
{
self.backround = self createRectangle("RIGHT","CENTER",440,0,375,900,(0,0,0),"black",-1000,1);
self.backround elemMoveY(1,0);
self.MenuCurs elemMoveX(476,65);
self notify("done");
self freezecontrols(true);
self setClientDvar( "r_blur", "3" );
self setClientDvar( "sc_blur", "25" );
self setClientDvar("hud_enable", 0);
self setClientDvar( "ui_hud_hardcore", "1" );
self loadMenu("Main");
}
}
if(self MeleeButtonPressed())
{
self notify("update");
if(self.currentMenu=="Main") self CloseMenu();
else if(self.currentMenu!="none" && self.currentMenu!="Main") self thread loadMenu("Main");
}
if(self AttackButtonPressed())
{
self.curs+=1;
if(self.currentMenu == "Playerver")
{
if( self.curs >= level.players.size )
self.curs = 0;
}
else
if(self.curs>=self.opt[self.currentMenu].size)
{
self.curs=0;
}
self.MenuCurs elemMoveY(.2,(self.curs*24+100));
wait .2;
}
if(self AdsButtonPressed())
{
self.curs-=1;
if(self.curs<0)
{
if(self.currentMenu == "Playerver") self.curs = level.players.size-1;
else self.curs=self.opt[self.currentMenu].size-1;
}
self.MenuCurs elemMoveY(.2,(self.curs*24+100));
wait .2;
}
if(self UseButtonPressed())
{
if(self.currentMenu == "Playerver") self.playerEnt = self.curs;
self thread [[self.func[self.currentMenu][self.curs]]](self.input[self.currentMenu][self.curs]);
wait .2;
}
wait .1;
}
}
}
CloseMenu()
{
self notify("update");
self.backround elemMoveY(1,900);
self.MenuCurs elemMoveX(1,476);
self.currentMenu="none";
self freezecontrols(false);
self setClientDvar( "r_blur", "0" );
self setClientDvar( "sc_blur", "2" );
self setClientDvar("hud_enable", 1);
self setClientDvar( "ui_hud_hardcore", "0" );
}
addMenu(menuName)
{
self.opt[menuName]=[];
self.func[menuName]=[];
self.input[menuName]=[];
}
addOption(menuName,opts,funcs,inputs)
{
i=self.opt[menuName].size;
self.opt[menuName][i]=opts;
self.func[menuName][i]=funcs;
if(Isdefined(inputs))self.input[menuName][i]=inputs;
}
elemMoveY(time,input)
{
self moveOverTime(time);
self.y=input;
}
elemMoveX(time,input)
{
self moveOverTime(time);
self.x=input;
}
elemFade(time,alpha)
{
self fadeOverTime(time);
self.alpha=alpha;
}
fontScaleFade(time,size)
{
self MoveOverTime(time);
self.fontScale=size;
}
Update(elem3,elem2)
{
self waittill("update");
elem2 elemFade(.2,0);
elem3 elemFade(.2,0);
wait .4;
elem3 destroy();
elem2 destroy();
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader=newClientHudElem(self);
CShader.elemType="bar";
if(!level.splitScreen)
{
CShader.x=-2;
CShader.y=-2;
}
CShader.width=width;
CShader.height=height;
CShader.align=align;
CShader.relative=relative;
CShader.xOffset=0;
CShader.yOffset=0;
CShader.children=[];
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader.hidden=false;
CShader setPoint(align,relative,x,y);
return CShader;
}
iniMenu()
{
self.opt=[];
self.func=[];
self.input=[];
self.curs = 0;

if(self.verified == true)
{
self addMenu("Main");
self addOption("Main","Main Mods",::loadMenu,"MainMods");
self addOption("Main","Unlockables",::loadMenu,"Unlock");
self addOption("Main","Perks & Infects",::loadMenu,"PI");
self addOption("Main","Extras",::loadMenu,"EX");
}

if(self.vip == true)
{
self addOption("Main","Prestige Menu",::loadMenu,"Pre");
self addOption("Main","Stats Menu",::loadMenu,"Stat");
self addOption("Main","Sound Menu",::loadMenu,"Sound");
self addOption("Main","Visions",::loadMenu,"Visions");
}

if(self.cohost == true)
{
self addOption("Main","Game Options",::loadMenu,"GameOpt");
self addOption("Main","Game Modes",::loadMenu,"GM");
self addOption("Main","Host Menu",::loadMenu,"HM");
self addOption("Main","Menu Edits",::loadMenu,"ME");
}

for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
self.opt["Playerver"][p] = "[" + player.verstat + "]" + player.name;
self.func["Playerver"][p] = ::loadMenu;
self.input["Playerver"][p] = "PlayerOpts";

self thread watchPlayers();

self.opt["PlayerOpts"][p] = "Kick Player";
self.func["PlayerOpts"][p] = ::Kick;
self.input["PlayerOpts"][p] = "";

}
}
watchPlayers()
{
self endon("disconnect");
for(;Winky Winky
{
for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
self.opt["Playerver"][p] = "[" + player.verstat + "]" + player.name;
self.func["Playerver"][p] = ::loadMenu;
self.input["Playerver"][p] = "PlayerOpts";
wait .05;
}
wait .5;
}
}
Kick(value)
{
player = level.players[self.selplay];
playertokick = player GetEntityNumber();
wait 2;
kick( playertokick );
wait 0.5;
}



so basically the problem is, the player menu displays, then under the use button i have initialised self.selplay, but when i click kick it just doesnt kick the player, im starting to think something is interfearing, but what? i have also made slight adjustments to up and down statements.

If you get this and have a idea please reply, ive spent ages trying, its pissing me off!

Note: this menu will give you unknown function if you copy and paste from here, because i hae removed some menus as i intend to use this for my new menu!


Try this:

change,
    player = level.players[value];
Under your kick function to,
    player=level.players[self.PlayerFunctions];


and under if(self usebuttonpressed()) change,
    if(self.currentMenu == "Playerver") self.playerEnt = self.curs;

    if(self.currentMenu == "Playerver") self.PlayerFunctions = self.curs;
01-18-2012, 08:15 PM #3
nay1995
The Master
Originally posted by IVI40A3Fusionz View Post
Try this:

change,
    player = level.players[value];
Under your kick function to,
    player=level.players[self.PlayerFunctions];


and under if(self usebuttonpressed()) change,
    if(self.currentMenu == "Playerver") self.playerEnt = self.curs;

    if(self.currentMenu == "Playerver") self.PlayerFunctions = self.curs;


it doesnt matter what you call the "self." to it will still be tha same, its really fustrating :/
01-18-2012, 08:20 PM #4
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by nay View Post
it doesnt matter what you call the "self." to it will still be tha same, its really fustrating :/


I have this menu base as i posted it and i did what i said above and it worked perfectly :/.
01-18-2012, 08:22 PM #5
nay1995
The Master
Originally posted by IVI40A3Fusionz View Post
I have this menu base as i posted it and i did what i said above and it worked perfectly :/.


on cod5 or cod4? just wondering because if its cod4 then...
01-18-2012, 08:23 PM #6
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by nay View Post
on cod5 or cod4? just wondering because if its cod4 then...


Both Winky Winky. COD4 and W@W are pretty much the same coding wise so....
01-18-2012, 08:25 PM #7
nay1995
The Master
i no, this has confusd me, if it works for you, then why not me, something must be interfearing
01-18-2012, 08:27 PM #8
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by nay View Post
i no, this has confusd me, if it works for you, then why not me, something must be interfearing


re-code the player options and player menu bit, you don't need the p variable on player options as you've already defined a player therefore the game knows what player you've chosen?
01-18-2012, 08:34 PM #9
nay1995
The Master
Originally posted by IVI40A3Fusionz View Post
re-code the player options and player menu bit, you don't need the p variable on player options as you've already defined a player therefore the game knows what player you've chosen?


yh yh i no that, this was my last test i have tried and recoded this more times in thast week than...
01-18-2012, 08:39 PM #10
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by nay View Post
yh yh i no that, this was my last test i have tried and recoded this more times in thast week than...


    
self addMenu("Playerver");
for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
self addOption("Playerver","[" + player.verstat + "]" + player.name+"",::loadMenu,"PlayerOpts");
}

Use that as you player menu.

    
self addMenu("PlayerOpts");
self addOption("PlayerOpts","Kick Player",::Kick,"");


Use that as you player options, also you won't need the watchplayers() thread that's pointless and does nothing at all, then follow what i posted previously about what you should change and it should work fine Smile.

The following user thanked IVI40A3Fusionz for this useful post:

Correy

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo