i updated the script, it doesn't do anything with @= tho, no response in the texteditctrl.
also added the clear and "." button.
PHP Code:
//#CLIENTSIDE
function onWeaponFired()
{
new GuiWindowCtrl("Calculator_window")
{
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "165, 200";
canmove = true;
canresize = false;
closequery = false;
destroyonhide = true;
text = "Calculator";
x = 300;
y = 200;
new GuiTextEditCtrl("Calculator_input")
{
profile = GuiBlueTextEditProfile;
x = 5;
y = 5;
width = 155;
height = 30;
text="0";
}
new GuiButtonCtrl("Calculator_clear")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "Clear";
width = 35;
x = 5;
y = 45;
}
new GuiButtonCtrl("Calculator_plusmin")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "+/-";
width = 35;
x = 45;
y = 45;
}
new GuiButtonCtrl("Calculator_divide")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "%";
width = 35;
x = 85;
y = 45;
}
new GuiButtonCtrl("Calculator_multiply")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "X";
width = 35;
x = 125;
y = 45;
}
new GuiButtonCtrl("Calculator_seven")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "7";
width = 35;
x = 5;
y = 75;
}
new GuiButtonCtrl("Calculator_eight")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "8";
width = 35;
x = 45;
y = 75;
}
new GuiButtonCtrl("Calculator_nine")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "9";
width = 35;
x = 85;
y = 75;
}
new GuiButtonCtrl("Calculator_subtract")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "-";
width = 35;
x = 125;
y = 75;
}
new GuiButtonCtrl("Calculator_four")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "4";
width = 35;
x = 5;
y = 105;
}
new GuiButtonCtrl("Calculator_five")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "5";
width = 35;
x = 45;
y = 105;
}
new GuiButtonCtrl("Calculator_six")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "6";
width = 35;
x = 85;
y = 105;
}
new GuiButtonCtrl("Calculator_add")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "+";
width = 35;
x = 125;
y = 105;
}
new GuiButtonCtrl("Calculator_one")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "1";
width = 35;
x = 5;
y = 135;
}
new GuiButtonCtrl("Calculator_two")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "2";
width = 35;
x = 45;
y = 135;
}
new GuiButtonCtrl("Calculator_three")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "3";
width = 35;
x = 85;
y = 135;
}
new GuiButtonCtrl("Calculator_equals")
{
profile = GuiBlueButtonProfile;
height = 55;
text = "=";
width = 35;
x = 125;
y = 135;
}
new GuiButtonCtrl("Calculator_zero")
{
profile = GuiBlueButtonProfile;
height = 25;
text = "0";
width = 75;
x = 5;
y = 165;
}
new GuiButtonCtrl("Calculator_dot")
{
profile = GuiBlueButtonProfile;
height = 25;
text = ",";
width = 35;
x = 85;
y = 165;
}
}
}
function Calculator_one.onAction()
{
if(input.text = 0)
{
input.text = 1;
}
else
{
input.text @= 1;
}
}
function Calculator_two.onAction()
{
if(input.text = 0)
{
input.text = 2;
}
else
{
input.text @= 2;
}
}
function Calculator_three.onAction()
{
if(input.text = 0)
{
input.text = 3;
}
else
{
input.text @= 3;
}
}
function Calculator_four.onAction()
{
if(input.text = 0)
{
input.text = 4;
}
else
{
input.text @= 4;
}
}
function Calculator_five.onAction()
{
if(input.text = 0)
{
input.text = 5;
}
else
{
input.text @= 5;
}
}
function Calculator_six.onAction()
{
if(input.text = 0)
{
input.text = 6;
}
else
{
input.text @= 6;
}
}
function Calculator_seven.onAction()
{
if(input.text = 0)
{
input.text = 7;
}
else
{
input.text @= 7;
}
}
function Calculator_eight.onAction()
{
if(input.text = 0)
{
input.text = 8;
}
else
{
input.text @= 8;
}
}
function Calculator_nine.onAction()
{
if(input.text = 0)
{
input.text = 9;
}
else
{
input.text @= 9;
}
}
function Calculator_clear.onAction()
{
input.text = 0;
}
function Calculator_dot.onAction()
{
input.text @= ".";
}