Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-13-2012, 09:56 PM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Gui Text Edit Problem

Hey Guys,

As you may understand - I have recently returned to Graal and I am trying to learn Scripting again.

My problem is probably simple, however I do not remember how to solve this:

I have two text edit boxes on my Gang System, one for account name and the other for rank. The Account works fine when adding via the add. But the problem is how do I make the account work with the rank.

Think of it like this:
Quote:
Account name: [account1.txt - Text Edit]
Rank: [rank1.txt Text Edit]

(Update Button)
I am finding the account via:
PHP Code:
 temp.pl findplayerbycommunityname(params[1]);
    if (
pl != NULL){
  }
 } 
I thought it Would be as simple as something like: pl.clientr.gangrank = rank1.txt but obviously not.

Please help me resolve this issue,

Thanks in advance,
Clarke.
__________________
Reply With Quote
  #2  
Old 08-14-2012, 02:10 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
When you click the button, send the text to serverside to set the clientr player variables.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #3  
Old 08-14-2012, 02:15 AM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Quote:
Originally Posted by BlueMelon View Post
When you click the button, send the text to serverside to set the clientr player variables.
Example please?
__________________
Reply With Quote
  #4  
Old 08-14-2012, 02:23 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by clarke119 View Post
Example please?
Almost this same question was asked a few weeks ago:

Quote:
Originally Posted by cbk1994 View Post
You can read more about serverside, clientside, and triggers here.

You can find a simple example of responding to clicks on GUI buttons here.
__________________
Reply With Quote
  #5  
Old 08-14-2012, 02:29 AM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Quote:
Originally Posted by cbk1994 View Post
Almost this same question was asked a few weeks ago:
Neither of them have what I'm looking for? Basically I'm just trying to get pl.clientr.gangrank = rank1.txt, but its deleting the clientr.gangrank flag altogether?
__________________
Reply With Quote
  #6  
Old 08-14-2012, 03:48 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by clarke119 View Post
Neither of them have what I'm looking for? Basically I'm just trying to get pl.clientr.gangrank = rank1.txt, but its deleting the clientr.gangrank flag altogether?
Both of them contain pieces of what you're looking for. Where are you stuck? Post your code so far.
__________________
Reply With Quote
  #7  
Old 08-14-2012, 03:50 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Post your source so we can help you. We are not going to spoon feed
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #8  
Old 08-14-2012, 03:19 PM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Quote:
Originally Posted by cbk1994 View Post
Both of them contain pieces of what you're looking for. Where are you stuck? Post your code so far.
This is the involved parts - not the full script. This is the last attempt I made at trying to do this..

PHP Code:
function onActionServerside(){
 if(
params[0] == "rankchanger"){
    
temp.pl findplayerbycommunityname(params[1]);
    if (
pl != NULL){
        
rank pl.clientr.gangrank;
        
rights pl.clientr.gangrights;
 }
}
      else{
      
player.chat "Player not found.";
 }
}

//#CLIENTSIDE
function onCreated() {
 new 
GuiTextEditCtrl("account1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 120;
      
70;
      
40;
    }
    new 
GuiTextEditCtrl("rank1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 120;
      
70;
      
70;
    }
new 
GuiTextEditCtrl("rights1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 30;
      
94;
      
96;
    }

function 
UpdateButton.onAction() {
 
temp.rank rank1.txt;
 
temp.rights rights1.txt;
  
triggerserver("gui",this.name,"rankchanger",account1.text,temp.rank,temp.rights);

__________________
Reply With Quote
  #9  
Old 08-14-2012, 07:50 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Good idea, we could use more gang servers.
__________________
Reply With Quote
  #10  
Old 08-14-2012, 08:46 PM
maximus_asinus maximus_asinus is offline
RIP DarkCloud_PK
Join Date: Oct 2001
Location: Canada
Posts: 3,746
maximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond repute
u scared bro? ^
__________________
Save Classic!
Reply With Quote
  #11  
Old 08-14-2012, 09:23 PM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Haha, I laughed at them two comments:L - Anyone know how to fix this then?
__________________
Reply With Quote
  #12  
Old 08-14-2012, 09:57 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
I know what the issue is, if you want help I'll do so later. My iPhone makes it difficult to help right now.
__________________
Reply With Quote
  #13  
Old 08-14-2012, 10:16 PM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Quote:
Originally Posted by Tim_Rocks View Post
I know what the issue is, if you want help I'll do so later. My iPhone makes it difficult to help right now.
Okay Thank you!
__________________
Reply With Quote
  #14  
Old 08-14-2012, 10:50 PM
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
Quote:
Originally Posted by clarke119 View Post
PHP Code:
function UpdateButton.onAction() {
 
temp.rank rank1.txt;
 
temp.rights rights1.txt;
 
triggerserver("gui",this.name,"rankchanger",account1.text,temp.rank,temp.rights);

should be
PHP Code:
 temp.rank rank1.text;
 
temp.rights rights1.text
It might be because it's just a part of the code and you cutted stuff out but you also forgot the closing bracket } for the onCreated() part.

You also should give your guis another naming. Check this thread for some help
__________________
MEEP!
Reply With Quote
  #15  
Old 08-14-2012, 11:13 PM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Quote:
Originally Posted by callimuc View Post
should be
PHP Code:
 temp.rank rank1.text;
 
temp.rights rights1.text
It might be because it's just a part of the code and you cutted stuff out but you also forgot the closing bracket } for the onCreated() part.

You also should give your guis another naming. Check this thread for some help
Yeah it's just because I took parts of code - Also It still wont work, i've fixed that stupid mistake.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:38 AM.


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