Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-30-2011, 07:57 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Red face 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.
Reply With Quote
  #2  
Old 01-30-2011, 08:09 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
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");

Reply With Quote
  #3  
Old 01-30-2011, 08:13 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Ok thx I´ll try. Its just for a shopping GUI :P
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:58 AM.


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