Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   add a flag after button pressed (https://forums.graalonline.com/forums/showthread.php?t=134261897)

callimuc 01-30-2011 07:57 AM

add a flag after button pressed
 
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;


I checked my flags but I couldnŽt find anything.

Twinny 01-30-2011 08:09 AM

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");



callimuc 01-30-2011 08:13 AM

Ok thx IŽll try. Its just for a shopping GUI :P


All times are GMT +2. The time now is 06:01 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.