Hey guys, I´m trying to make a GUI button which will add a flag to a player, after its pressed. The button is no problem, but the part of adding a button wont work.
This is how far I got:
PHP Code:
//#CLIENTSIDE
function onCreated() {
new GuiButtonCtrl(FShop_Purchase) {
//Here is all the GUI stuff
}
function FShop_Purchase.onAction() {
clientr.test+=1;
}
You can't alter clientr. variables from clientside. You can, however, alter client. variables clientside but these types are far less secure. It depends on your need, really.
Anyways, this is how you can alter a clientr. variable
PHP Code:
function onActionServerSide() { if (params[0] == "test") { clientr.variable = 1; } }
//#CLIENTSIDE
function GuiButton.onAction() { triggerserver("gui", this.name, "test"); }