PHP Code:
#exec Texture Import File=Textures\selectbox.bmp Name=select//GUI Texture
var int iselect;//This controls the GUI
var bool bnorecoil,bretlock,bwallhack;//Just some random bools for an example :)
function PostRender(Canvas Canvas)
{
local pawn p;
if(iselect<=0){iselect=3;}
if(iselect>=4){iselect=1;}
//The above is so the your selector doesnt disapear
SelectBool(Canvas);//This calls the GUI function
//RANDOM BOOLS\\
if(bnorecoil)
{R6PlayerController(MyController).m_bShakeactive=false;}else{R6PlayerController(MyController).m_bShakeactive=true;}
if(bretlock)
{Me.EngineWeapon.PerfectAim();}
if(bwallhack)
{
foreach mycontroller.allactors(class'pawn',p)
{
if((p!=none)&&(p!=me)&&(p.isalive()))
{
Canvas.drawactor(p2,false,true);
p.bhidden=false;
}
}
}
}
function SelectBool(Canvas Canvas)//GUI Function
{
local float PosX, PosY;
Canvas.Style=1;
PosX=10;
if(iselect==1)
{Canvas.SetDrawColor(117,117,177);} //If Selected, then use this color
else{Canvas.SetDrawColor(74,74,74);} //If not Selected, then use different color
PosY = Canvas.ClipY / 2-62;
Canvas.SetPos(PosX, PosY);
Canvas.DrawIcon(Texture'Select', 0.90);
if(iselect==2)
{Canvas.SetDrawColor(117,117,177);} //If Selected, then use this color
else{Canvas.SetDrawColor(74,74,74);} //If not Selected, then use different color
PosY = Canvas.ClipY / 2-47;
Canvas.SetPos(PosX, PosY);
Canvas.DrawIcon(Texture'Select', 0.90);
if(iselect==3)
{Canvas.SetDrawColor(117,117,177);} //If Selected, then use this color
else{Canvas.SetDrawColor(74,74,74);} //If not Selected, then use different color
PosY = Canvas.ClipY / 2-32;
Canvas.SetPos(PosX, PosY);
Canvas.DrawIcon(Texture'Select', 0.90);
//Text for the GUI
Canvas.Font=Canvas.SmallFont;
Canvas.SetDrawColor(255,239,219);
PosX=20;
PosY=Canvas.ClipY / 2-60;
Canvas.SetPos(PosX, PosY);
Canvas.DrawText("NoRecoil " $ string(bnorecoil));
PosY=Canvas.ClipY / 2-45;
Canvas.SetPos(PosX, PosY);
Canvas.DrawText("Retlock " $ string(bretlock));
PosY=Canvas.ClipY / 2-30;
Canvas.SetPos(PosX, PosY);
Canvas.DrawText("Wallhack " $ string(bwallhack));
}
function bool KeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta )
{
//To interact with the GUI
if( Action==IST_Press )
{
if (Key==IK_Up)
{
iselect-=1;//Up to lower iselect (selecting higher on the menu)
}
if (Key==IK_Down)
{
iselect+=1;//Down to raise iselect (selecting lower on the menu)
}
if(iselect==1)//IF iselect is = to 1, then right key toggles Norecoil
{
if (Key==IK_Right)
{
bnorecoil=!bnorecoil;
}
}
if(iselect==2)//IF iselect is = to 2, then right key toggles Retlock
{
if (Key==IK_Right)
{
bretlock=!bretlock;
}
}
if(iselect==3)//IF iselect is = to 3, then right key toggles Wallhack
{
if (Key==IK_Right)
{
bwallhack=!bwallhack;
}
}
}else{return false;}
}
defaultproperties
{
iselect=1//So the selector starts at the first toggle
}
Bookmarks