Quote:
Originally Posted by Emera
This is a solution, but if you had lots of hats and you made a weapon for EVERY hat, then your weapons list would start to look like testbeds. Surely there is another way to go about doing this?
|
Use flags instead
Example (using clientr.hats you need to add all the hats you want to your self):
PHP Code:
//#CLIENTSIDE
function onWeaponFired
//The following is just GUI stuff
new GuiWindowCtrl("TaylorWindow01") {
profile = GuiBlueWindowProfile;
x = 10;
y = 10;
canminimize = canmaximize = canresize = false;
canclose = canmove = true;
width = 180;
height = 90;
text = "Simple Hat setter";
new GuiPopUpMenuCtrl("TaylorLister01") {
profile = GuiBluePopUpMenuProfile;
textprofile = GuiBlueTextListProfile;
scrollprofile = GuiBlueScrollProfile;
x = 10;
y = 30;
width = 160;
height = 20;
text = player.attr[1];
clearRows();
for (temp.value: clientr.hats) //from here
{
addRow(0, temp.value);
} //to here is the part to list the hats
sort();
}
new GuiButtonCtrl("TaylorButton01") {
profile = GuiBlueButtonProfile;
position = {10, 50};
extent = {88, 20};
text = "Load";
}
}
}
function TaylorButton01.onAction(){ //you pressed the button TaylorButton01
player.attr[1] = TaylorButton01.text; //sets the hat you choosed
}
Sure there are a lot of other ways you can do it. This was just a simple one so you see how it generally works.