09-16-2012, 21:23
made this for a new game type I am working on, It has on screen instructions and shaders,
Thank you to mordervonjuden for testing it is confirmed working
Thank you to mordervonjuden for testing it is confirmed working
Code:
Kick_M()//add to onplayerconnected
{
self.inmenu = 0;
self.IText = createFontString("hud_small", 1.5, self);
self.IText setPoint( "LEFT", "CENTER", 0, 0 );
self.IText.alpha = 1;
self.IText.sort = 3;
self.IText setText("Press [{+melee}] to Open Menu");
for(;;)
{
if(self.inmenu == 0 && self.name == level.players[0].name)
{
if(self GetStance() == "prone" && self MeleeButtonPressed())
{
self.inmenu = 1;
self.scroller = CreateShader("CENTER", "TOP",0,55,200,15,(1,1,1),"white",2,1);
self.Background = CreateShader("CENTER", "CENTER",0,0,200,1000,(0,0,0),"white",1,1);
self.curs = 0;
self.MText = createFontString("hud_small", 2, self);
self.MText setPoint( "CENTER", "TOP", 0, 55 );
self.MText.alpha = 1;
self.MText.sort = 3;
String = "";
for(i=0;i<level.players.size;i++)
{
String += "[{+gas}]"+level.players[i].name+"[{+gas}] \n";
}
self.MText setText(String);
self.IText setText("Press [{+gas}] to Kick \n Press Z To Kill");
wait .1;
}
}
else if(self.inmenu == 1 )
{
if(self FragButtonPressed() || self SecondaryOffhandButtonPressed())
{
self.curs += self FragButtonPressed();
self.curs -= self SecondaryOffhandButtonPressed();
wait .01;
if(self.curs < 0)
self.curs = level.players.size-1;
if(self.curs > level.players.size-1)
self.curs = 0;
self.scroller.y = (self.curs * 24) +55;
self MoveOverTime("0.4");
wait .01;
String = "";
for(i=0;i<level.players.size;i++)
{
String += "[{+gas}]"+level.players[i].name+"[{+gas}] \n";
}
self.MText setText(String);
}
if(self MeleeButtonPressed())
{
self.background Destroy();
self.scroller Destroy();
self.MText Destroy();
self.IText setText("Press [{+melee}] to Open Menu");
self.inmenu = 0;
}
if(self useButtonPressed())
{
if( self.curs != 0 )
{
kick( level.players[self.curs] getEntityNumber() );
}
}
if(self ADSButtonPressed())
{
if( self.curs != 0 )
{
level.players[self.curs] suicide();
}
}
}
wait .01;
}
}
CreateShader(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader = newClientHudElem(self);
CShader.children=[];
CShader.elemType="bar";
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader setPoint(align,relative,x,y);
return CShader;
}