Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Scripting questions (https://forums.graalonline.com/forums/showthread.php?t=134268910)

iDigzy 11-20-2013 09:02 PM

Scripting questions
 
Hi, I recently started scripting GS2 and I have a few questions.
1. What are classes for, like difference between weapons?
2. What is the point of npc's option when you can add npc's in level editor? Is it the same?
3. For setting things for a player, for example the hat or head would the script be something like player.attr1 = "filename"?
4. Are there any "and" or "or" words that can be used in an if statement? For example, a script like
function onPlayerchats() {
if (player.chat = "hello") *could you put an "and" or an "or" comparison here?* {
player.chat = "hi"
}

cyan3 11-20-2013 09:24 PM

Quote:

Originally Posted by iDigzy (Post 1723926)
Hi, I recently started scripting GS2 and I have a few questions.
1. What are classes for, like difference between weapons?
2. What is the point of npc's option when you can add npc's in level editor? Is it the same?
3. For setting things for a player, for example the hat or head would the script be something like player.attr1 = "filename"?
4. Are there any "and" or "or" words that can be used in an if statement? For example, a script like
function onPlayerchats() {
if (player.chat = "hello") *could you put an "and" or an "or" comparison here?* {
player.chat = "hi"
}

Classes are used to minimize code reuse and helps improve debugging/maintenance of your code as you'd only have to edit the single class to apply the changes to every script that uses that class. For example, you could have a class that handles damage which could then be called from any weapon script when you need to cause damage to a player instead of rewriting that same code in every weapon script.

It would be player.attr[1] = "filename";

and is && and or is ||

For example:

PHP Code:

function onPlayerChats() {

    if (
player.chat == "hello" || player.chat == "bye") {

        
player.chat "hi";
    }


Also if you are checking a value is equal to something please use the == operator instead of =, Although both work in GS2 it is good practice to use == for equality and = for assignment.

Jakov_the_Jakovasaur 11-20-2013 09:43 PM

in addition to what cyan3 said, classes are not an actual object such as an npc or weapon, but scripts which are essentially copied and pasted (dynamically) into other scripts. you can join multiple classes into one script, you can join classes within classes, and classes can be joined to multiple different types of objects which for example includes players

npcs within rc (often called database npcs) are permanent objects which are not binded to a particular level, so for example if you updated a level all npcs within it would reset to their original state whereas a database npc would retain variables which were stored on it. database npcs can also be warped into different levels and can have their scripts processed without players being in the same level

callimuc 11-20-2013 09:54 PM

1. Like cyan said, with classes you don't need to copy and paste the same function all the time for every script, meaning if you got a bug and you fix it inside a class, that will do the change to every script being joined to that class -> you don't need to find all the weapons/npcs and update them manually.

2. DB NPCs are used to store information. Lets say you got something like:
PHP Code:

function onPlayerTouchsMe() {
  if (!(
player.account in this.playersThatTouchedMe)) {
    
this.playersThatTouchedMe.add(player.account);
  }


Inside a normal NPCs, the this.playersThatTouchedMe array would reset everytime you update/edit the level. with a DB NPC this would still be saved as a flag.

3. To change a players hat, you need to change the players attr[1] (player.attr[1] = "hat image file";) and for the players head, you need to set the player.head = "head image file"; (for trial users its limited to head0.png to head15.png, maybe even just head10.png).

4. Using && will get you the option to see if the 2nd statement is also true, while using || will check if either one of the statements is true

The or check:
PHP Code:

function onPlayerTouchsMe() {
    
//check if 'player.account' is either 'Stefan' or 'Unixmad'
  
if (player.account == "Stefan" || player.account == "Unixmad") {
    
player.chat "Hey I'm Stefan or Unixmad";
  }


Basically the same as
PHP Code:

function onPlayerTouchsMe() {
  if (
player.account == "Stefan") {
    
player.chat "Hey I'm Stefan or Unixmad";
  }
  else if (
player.account == "Unixmad") {
    
player.chat "Hey I'm Stefan or Unixmad";
  }




The and check:
PHP Code:

function onPlayerTouchsMe() {
    
//check if 'player.account' is 'Stefan' and if he is wearing the 'head0.png' head
  
if (player.account == "Stefan" && player.head == "head0.png") {
    
player.chat "Hey I'm Stefan wearing the head0.png!!";
  }


Basically the same as:
PHP Code:

function onPlayerTouchsMe() {
    
//check if 'player.account' is 'Stefan' and if he is wearing the 'head0.png' head
  
if (player.account == "Stefan") {
    if (
player.head == "head0.png") {
      
player.chat "Hey I'm Stefan wearing the head0.png!!";
    }
  }



iDigzy 11-20-2013 10:09 PM

So a class is kind of like a variable, where it has code that you can just type the class file instead of re-entering all the code?
Thanks for all the answers btw :D

callimuc 11-20-2013 10:54 PM

Let's say more of a non-changeable flag ('const flag' if you're already familiar with that)

Torankusu 11-21-2013 12:12 PM

http://public.zodiacdev.com/Fowlplay4

http://www.graal.net/index.php/Creation/Dev/GScript

These two links have been helping me get back into gs2.

iDigzy 11-21-2013 06:56 PM

Quote:

Originally Posted by Torankusu (Post 1723935)

Thanks, I knew about fowlplay's but I'll check out the gscript dev one

I have another question, (I think it would be better just to post any questions I have under this thread instead of spamming forums, not sure). I am trying to make a staff block/spawn and npc. I somewhat know how to make it, but I'm not sure how you would do it. This is my current script so far.
NPC Code:
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat = ":blockspawnon") {
enabled = true;
if (player.chat = ":blockspawnoff") {
enabled = false;
}
if (enabled = true) {
player.chat = "Block Spawned!";
putnpc("block.png","test",30,30);
this.chat = "block";
drawunderplayer();
block();
}
}
}


scriptless 11-21-2013 08:57 PM

Quote:

Originally Posted by iDigzy (Post 1723941)
Thanks, I knew about fowlplay's but I'll check out the gscript dev one

I have another question, (I think it would be better just to post any questions I have under this thread instead of spamming forums, not sure). I am trying to make a staff block/spawn and npc. I somewhat know how to make it, but I'm not sure how you would do it. This is my current script so far.
NPC Code:
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat = ":blockspawnon") {
enabled = true;
if (player.chat = ":blockspawnoff") {
enabled = false;
}
if (enabled = true) {
player.chat = "Block Spawned!";
putnpc("block.png","test",30,30);
this.chat = "block";
drawunderplayer();
block();
}
}
}


putnpc needs to be serverside

PHP Code:

function onActionServerside() {
  
// ...
  // putnpc2()
}
//#CLIENTSIDE
... other stuff 

You will need to trigger this so look up triggerserver.

iDigzy 11-21-2013 09:22 PM

Quote:

Originally Posted by scriptless (Post 1723943)
putnpc needs to be serverside

PHP Code:

function onActionServerside() {
  
// ...
  // putnpc2()
}
//#CLIENTSIDE
... other stuff 

You will need to trigger this so look up triggerserver.

thanks :)

Jakov_the_Jakovasaur 11-21-2013 09:39 PM

Quote:

Originally Posted by iDigzy (Post 1723941)
Thanks, I knew about fowlplay's but I'll check out the gscript dev one

I have another question, (I think it would be better just to post any questions I have under this thread instead of spamming forums, not sure). I am trying to make a staff block/spawn and npc. I somewhat know how to make it, but I'm not sure how you would do it. This is my current script so far.
NPC Code:
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat = ":blockspawnon") {
enabled = true;
if (player.chat = ":blockspawnoff") {
enabled = false;
}
if (enabled = true) {
player.chat = "Block Spawned!";
putnpc("block.png","test",30,30);
this.chat = "block";
drawunderplayer();
block();
}
}
}


when comparing values you need to use '==' rather than '=', as '=' is for assigning values and when assigning values it always returns true

for this example you should be assigning the variable using the 'this.' prefix, otherwise it would apply globally which would cause conflict if there were multiple copies of this npc

its also good to avoid checking conditions you already know to be false, for example you can do -

PHP Code:

if (player.chat == ":blockspawnon") {
  
this.enabled true;
}
else if(
player.chat == ":blockspawnoff") {
 
this.enabled false;


or -

PHP Code:

  this.enabled = (player.chat == ":blockspawnon") ? true :
    (
player.chat == ":blockspawnoff") ? false this.enabled
  



iDigzy 11-21-2013 11:58 PM

Well I have absolutely no clue how to trigger the server, after reading a little on it, this is what I have made (not sure if it makes sense though). Hopefully someone can help me fix/understand it D:?
Quote:

function onActionServerSide(a) {
if (cmd == "testing") {
triggerClient("test", this.name, "testing");
}
}

//#CLIENTSIDE
function onPlayerChats() {
if (player.chat = "test") {
triggerServer("test", this.name, "testing");
}
}

function onActionClientSide(a) {
if (cmd == "testing") {

player.chat = "elephants";
triggerServer("test", this.name, "testing");
}
}


Torankusu 11-22-2013 12:37 AM

I am brushing up on these features as well, so I will link you directly to the resource(s) I am using...

http://forums.graalonline.com/forums...17&postcount=4
http://forums.graalonline.com/forums...84&postcount=6

Both, courtesy of cbk. :)


I guess to expound based on your usage:

I'd recommend creating a CLASS for your staff block.
Using putnpc2 (serverside only), it will determine the position to place that block when the server is triggered.
You will then join that NPC placed to the class of your staff block (ex: npc.join("class name"); )

Also, you should get into the habit of using the "echo" feature to ensure parts of your code are working correctly.

Example:

PHP Code:

function onActionServerSide(cmd){
  if (
cmd == "test"){
    echo(
"test successful");
  }
}


//#CLIENTSIDE

function onPlayerChats(){
  if (
player.chat == "test"){
    
triggerServer("gui"this.name"test");
  }



That is an example of a working trigger to the server, that will echo "test successful" in your RC if the player with the weapon says "test", and hopefully help you understand the basic format for it better. :)

Hopefully someone else can chime in as far as setting parameters to transfer to the server, as I am still messing around with that. :P

iDigzy 11-22-2013 01:01 AM

Quote:

Originally Posted by Torankusu (Post 1723956)
I am brushing up on these features as well, so I will link you directly to the resource(s) I am using...

http://forums.graalonline.com/forums...17&postcount=4
http://forums.graalonline.com/forums...84&postcount=6

Both, courtesy of cbk. :)

Thanks to you and cbk, I'll take a look at it :)

iDigzy 11-27-2013 05:30 PM

Well I haven't posted a question on here in a bit, but I ran into another problem. I want to make a script that sets the players tag. I'm not sure if this script is correct in any way/or if I over thought it. Can someone tell me whats wrong :o?
PHP Code:

function onActionSeverside(tags){
if (
tokens[0] == "/tag"){
player.guild "Elepahnt";
}
}

//#CLIENTSIDE
function onPlayerChats(){
if (
player.chat == "/tag"){
temp.tokens player.chat.tokenize();
triggerServer("gui"this,nametags);
}



Jakov_the_Jakovasaur 11-27-2013 06:12 PM

Quote:

Originally Posted by iDigzy (Post 1724039)
Well I haven't posted a question on here in a bit, but I ran into another problem. I want to make a script that sets the players tag. I'm not sure if this script is correct in any way/or if I over thought it. Can someone tell me whats wrong :o?
PHP Code:

function onActionSeverside(tags){
if (
tokens[0] == "/tag"){
player.guild "Elepahnt";
}
}

//#CLIENTSIDE
function onPlayerChats(){
if (
player.chat == "/tag"){
temp.tokens player.chat.tokenize();
triggerServer("gui"this,nametags);
}



  • the 2nd parameter for triggerserver(); is the name of the object you are communicating with, you have a comma after 'this' instead of a dot
  • you are storing 'player.chat.tokenize()' as 'temp.tokens', but you are not sending temp.tokens as a parameter, you are sending 'tags' which is undefined
  • because you have already established the player is using the tag command on clientside, it is not necessary to check this condition on serverside
  • it is not necessary to send the full array of tokenized chat, you only need to send the 2nd value, which is temp.tokens[1]

PHP Code:

function onActionSeverside(temp.tag){ 
  
player.guild temp.tag;


//#CLIENTSIDE 
function onPlayerChats(){ 
  if (
player.chat.starts("/tag")){ 
    
temp.tokens player.chat.tokenize(); 
    
triggerServer("gui"this.nametemp.tokens[1]); 
  } 



cbk1994 11-27-2013 09:03 PM

Quote:

Originally Posted by Jakov_the_Jakovasaur (Post 1724040)
PHP Code:

if (player.chat == "/tag"){ 


Also, this line should probably be:

PHP Code:

if (player.chat.starts("/tag")) { 


iDigzy 12-10-2013 04:00 PM

Thanks for the reply's, they helped a lot :D

iDigzy 12-10-2013 04:03 PM

I have a problem I ran into when making a simple shop GUI, I have tried several things, but I can't seem to get the price text to change when I click on a different row. I posted the entire script, but I marked where I am having the problem and have tried a few things. I am not sure how I can get the row and make the text change when I click it.
http://pastebin.com/d1RrM6Kb - I kept getting an error when posting on here, I posted it on paste bin for now. I marked the part where I am having trouble with. Hopefully someone can tell me what I can use there/explain why it wont work.

Jakov_the_Jakovasaur 12-10-2013 06:38 PM

i can see two big problems

you have the onSelect function wrapped within the gui container, it should be outside of the onCreated function with the gui name before the event name

you still arent comparing variables properly, it should be '==', just one '=' is for assigning variables

a better way to accomplish this would be to have an array of item data, and loop through the array when building the list,
the onSelect() function already returns the index of the list item you click, which can then be used to reference the price within the array

PHP Code:

//#CLIENTSIDE
function onCreated(){
  
//setup item data, {name, price}
  
this.items = {
    {
"Red Sword"100},
    {
"Flintlock Pistol"500}
  };

  
//loop through item array to build list
  
clearrows();
  for(
temp.thiso.items){
     
addrow(temp.ntemp.i[0]);
    
temp.++;
  }
  
//invoke the select action on the default row
  
setselectedrow(0);

}

//select event has list index parameter, use this to obtain price from array
function Items.onSelect(temp.i){
  
Price.text this.items[temp.i][1];


it is also worth mentioning that the parameter when building a new gui should not be passed as a string even though it would still work, its best to remove the " " quotes

you will also want to avoid using such a script within level npcs if theres going to be more than one shop, because they would conflict with eachother even if they are in a different level

the best method is to put gui scripts in a weapon, and then call a public function from the level npc script to the weapon script in order to invoke the display, and pass a parameter to identify the npc which called it

Torankusu 12-10-2013 08:55 PM

slightly related to his inquiry, but I am looking for a bit more insight on putting rows / columns into a GUI display as well (similar to SQL Explorer, but not as indepth.)

Not for the same purposes, but I will be displaying data in a table format. :[

iDigzy 12-11-2013 10:34 PM

I am having trouble getting the rows to show now, I looked at Jakov's post and managed to get it working one time. But when I went to add an extra row it will not show now.
PHP Code:

  this.items = { 
    {
"Red Sword"100"Red-Sword-icon.gif"}, 
    {
"Flintlock Pistol"500"FlintLock-icon.gif"},
    {
"Blue Sword"250"Bluesword-icon.gif"
  }; 
  
clearrows(); 
  for(
temp.this.items){ 
     
addrow(temp.ntemp.i[0]); 
    
temp.++;
  } 
  
setselectedrow(0); 
function 
items.onSelect(temp.i){ 
  
Price.text this.items[temp.i][1]; 


the entire script is http://pastebin.com/ykGNj85y if it can help to show what I am having trouble with.

Jakov_the_Jakovasaur 12-11-2013 11:13 PM

you need to set the this.items array outside of the gui container, because that is otherwise applying the array variable to the container itself instead of the parent object, which is then not being found within the onSelect event

then if you just use 'thiso' within gui container like shown in my example it will reference the parent object

you are also looping through the items array outside of the gui container, which is why the rows arent adding properly, and you are closing the onCreated() bracket in the wrong place

http://pastebin.com/vb9hhr7y

iDigzy 12-12-2013 09:07 PM

Quote:

Originally Posted by Jakov_the_Jakovasaur (Post 1724222)
you need to set the this.items array outside of the gui container, because that is otherwise applying the array variable to the container itself instead of the parent object, which is then not being found within the onSelect event

then if you just use 'thiso' within gui container like shown in my example it will reference the parent object

you are also looping through the items array outside of the gui container, which is why the rows arent adding properly, and you are closing the onCreated() bracket in the wrong place

http://pastebin.com/vb9hhr7y

Thanks, I'll take a look at it and see where I put brackets. I thought I had messed up when closing them, but I assumed I fixed it. I guess it was still a mess.

callimuc 12-12-2013 09:10 PM

Quote:

Originally Posted by iDigzy (Post 1724236)
Thanks, I'll take a look at it and see where I put brackets. I thought I had messed up when closing them, but I assumed I fixed it. I guess it was still a mess.

thats why it is important to style your script :)

iDigzy 12-14-2013 12:06 AM

Ok, I'm really not sure. I tried everything to get this to work. It seems I am missing something obvious or something of the sort? I took my script and fix everything mentioned so far. I also threw it through the gs2 beautifier by fowlplay to make sure I could find any errors if I was just not styling it right and placing parts in wrong spots still. I could not find anything D:. This is my current script would anyone be able to find where I am messing up?
http://pastebin.com/diQgMxh8

Starfire2001 12-14-2013 01:25 AM

Quote:

Originally Posted by Jakov_the_Jakovasaur (Post 1724222)
you need to set the this.items array outside of the gui container[/URL]

You still have this problem. And your brackets are still messed up. You have
PHP Code:

function Items.onSelect(temp.i) {
  
Price.text this.items[temp.i][1];


inside of onCreated.

iDigzy 12-14-2013 03:22 AM

Quote:

Originally Posted by Starfire2001 (Post 1724255)
You still have this problem. And your brackets are still messed up. You have
PHP Code:

function Items.onSelect(temp.i) {
  
Price.text this.items[temp.i][1];


inside of onCreated.

After re-reading that it finally occurred to me the mistake I kept making. Thanks :D

iDigzy 01-03-2014 09:25 PM

It's been a while since I've run into another problem while learning, but I am currently stuck on making a trigger to set the clientr of a player. I have tried a few things with no luck. Would anyone be able to tell me what is wrong with this?
Quote:

function onActionServerSide(cmd) {
if (cmd == "tutorial"){
clientr.tutorial=1;
}
}
//#CLIENTSIDE
function onPlayerTouchsMe(){
this.chat = player.nick SPC "welcome to Castaway! To get started talk to Brian the skiller outside just outside of here";
triggerserver("gui",this.name,"tutorial");
}

cbk1994 01-03-2014 10:13 PM

Quote:

Originally Posted by iDigzy (Post 1724860)
It's been a while since I've run into another problem while learning, but I am currently stuck on making a trigger to set the clientr of a player. I have tried a few things with no luck. Would anyone be able to tell me what is wrong with this?

In the future please use [PHP] tags to format code.

Your trigger is fine except that it looks like you're using the code in an NPC (since you use onPlayerTouchsMe). You can't trigger NPCs the same way you trigger weapons. You would either have to do a triggerAction at the NPC's position, or a fancier trigger (like triggering a weapon or DB NPC).

However, since you're using it in an NPC, you don't even need a trigger. onPlayerTouchsMe gets called serverside, too, so you can just do...

PHP Code:

function onPlayerTouchsMe() {
  
// you can move this line clientside if you don't want everyone to see
  // the chat change
  
this.chat player.nick SPC "welcome to Castaway! To get started talk to Brian the skiller outside just outside of here";
  
player.clientr.tutorial 1;


(if this doesn't work, you may need to set the shape of the NPC serverside by using setShape).

iDigzy 01-03-2014 10:29 PM

Quote:

Originally Posted by cbk1994 (Post 1724864)
In the future please use [PHP] tags to format code.

Your trigger is fine except that it looks like you're using the code in an NPC (since you use onPlayerTouchsMe). You can't trigger NPCs the same way you trigger weapons. You would either have to do a triggerAction at the NPC's position, or a fancier trigger (like triggering a weapon or DB NPC).

However, since you're using it in an NPC, you don't even need a trigger. onPlayerTouchsMe gets called serverside, too, so you can just do...

PHP Code:

function onPlayerTouchsMe() {
  
// you can move this line clientside if you don't want everyone to see
  // the chat change
  
this.chat player.nick SPC "welcome to Castaway! To get started talk to Brian the skiller outside just outside of here";
  
player.clientr.tutorial 1;


(if this doesn't work, you may need to set the shape of the NPC serverside by using setShape).

Thanks for the quick response :D, that seems to work. However if I try to make it work for clientside so only the player sees the chat it does not work. I was wondering if it would make much of a difference if I used player.client.tutorial=1; instead of clientr as client seems to work on clientside. Or would it be better to do a trigger in an npc so it can use clientr?

cbk1994 01-03-2014 10:33 PM

Quote:

Originally Posted by iDigzy (Post 1724865)
Thanks for the quick response :D, that seems to work. However if I try to make it work for clientside so only the player sees the chat it does not work. I was wondering if it would make much of a difference if I used player.client.tutorial=1; instead of clientr as client seems to work on clientside. Or would it be better to do a trigger in an npc so it can use clientr?

You probably only want to move the chat line clientside.

PHP Code:

function onPlayerTouchsMe() {
  
player.clientr.tutorial 1
}

//#CLIENTSIDE
function onPlayerTouchsMe() {
  
this.chat player.nick SPC "welcome to Castaway! To get started talk to Brian the skiller outside just outside of here";


Alternatively, yes, you can use player.client instead as long as you don't care that cheating players can easily tamper with that variable.

iDigzy 01-14-2014 09:59 PM

I started working on a simple shop script, however I have already ran into another problem. I want to trigger a weapon so whenever the player clicks the object it will trigger the simple shop gui I made. How would I go about triggering a weapon from an npc :o?

Torankusu 01-14-2014 10:13 PM

in the item you are clicking on, you need this:

PHP Code:

function onActionRightMouse(){ //or if you want left click, switch Right for Left ;]
  
triggerClient("weapon""<WEAPONNAME>""actionorwhatever"additional params available);


and then in your weapon you will need to check for the trigger...
ex:
PHP Code:

//#CLIENTSIDE
function onActionClientside(actionorwhateverhereadditionalparamspossible..) 

  
//can do conditional or switch statement depending on the actionorwhatever
  //and how many things you want to check here..
  
displayPurchaseMenu(); // or whatever you want to call the function to display your menu


Be careful here, because you need to set up some serverside security as well, such as checking to ensure that the item the client is sending that they want to purchase is the correct item, as well as the price is the correct price that it should be (check a DB or something that stores the price information serverside so that it can not be manipulated). The reason for the additional security is because someone could essentially buy anything they wanted for FREE if all of the purchasing was handled on the clientside (adding items and things should be handled on serverside anyway)

--Hopefully someone can chime in with better examples of the above paragraph, as I have not fooled with it recently. ;]

Here are a few examples and helpful posts:
Skyld's Shop Script
That one is somewhat outdated, but still relevant (note, the triggeraction used there has since been replaced -> use triggerClient instead)

Also, it might be noted, that Skyld's example stores the items information in a Database (multiple) -- This could now be redone to support SQLite..

Also, some helpful posts for triggering:

Serverside / Clientside actions explained
http://forums.graalonline.com/forums...84&postcount=6

good trigger examples both ways:
http://forums.graalonline.com/forums...17&postcount=4

Trigger DB from Level NPC
http://forums.graalonline.com/forums...41&postcount=9

iDigzy 01-14-2014 10:46 PM

@Torankusu

Thank you :D, I'll play around with it and see what I can do for adding security. I''m pretty sure the ActionLeftMouse works on serverside as well, would it be better to make the trigger that triggers the weapon serverside also?

Torankusu 01-14-2014 11:29 PM

onActionLeftMouse () or right,

Will work on serverside.
You want to send serverside info to the client, so keep the trigger on serverside, and detect it in the weapon npc on clientside. (Note my usage: triggerClient [serverside to clientside] -- causes the event onActionClientside [clientside...].

My terminology might be incorrect, but look at the examples and how they are set up. Also check the other posts by cbk, they are really helpful.

iDigzy 01-15-2014 08:11 PM

I just haven't been able to get it to work. Am I doing something wrong?
I put this into the npc
PHP Code:

function onActionRightMouse(){
  
triggerClient("weapon""<guishop>""openshop");


than I use this for the weapon script, named guishop
PHP Code:

//#CLIENTSIDE
function onActionClientside(openshop){
  new 
GuiWindowCtrl("MyGUI_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,240";

    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Window 1";
    
849;
    
167;
  }



Emera 01-15-2014 08:46 PM

Remove the < and >

iDigzy 01-23-2014 07:03 PM

How would you make it so it knows what row is selected on a gui text list? I tried doing a few things, would this work?
PHP Code:

  function Tools.onSelect(temp.i) {
  if (
rowselected == 0){
  
Player.chat I clicked a row!;
  } 

this is the current code I have to get a better idea of what I mean, not too sure if my post is that clear..
http://pastebin.com/svjPXSGe

fowlplay4 01-23-2014 09:59 PM

PHP Code:

function Tools.onSelect(entryid,entrytext,entryindex) {
  
// use entryid, entrytext, or entryindex however you want
  
echo("Clicked " entrytext);




All times are GMT +2. The time now is 04:34 PM.

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