 |
 |
 |
 |
| Author |
Message |
Damien
Joined: 15 Apr 2006 Posts: 65
|
Posted: Tue Jul 04, 2006 7:02 pm Post subject: Need Gump Help! |
|
|
Hello! I got this question about Gumps.
But first check the ridicolous Gump i made to make this easier.
http://img131.imageshack.us/my.php?image=gumps2gq.jpg
There it is, and to make it even easier i post the code:
| Code: |
use uo;
use os;
include "include/attributes";
program Gumpquestion( who )
var gflayout := {
"nodispose",
"nomove",
"page 0",
"resizepic 55 105 2620 290 200",
"text 145 120 32 0",
"page 1",
"text 80 160 50 1",
"text 80 175 50 2",
"text 80 190 50 3",
"text 80 205 50 4",
"text 80 245 50 5",
"button 300 240 2472 2473 ? ? ?"
};
var gfdata := {
"Gump Question!",
"My Gump Question, Read Below!",
"I would be Extremely glad",
"if someone could help me ;)",
"Read Question below please!",
"Click here to get an spellbook"
};
SendDialogGump( who, gflayout, gfdata );
endprogram
|
My question is how to do, when you click the button a spellbook will be
created in your backpack?
Do i need to use another code?
If you know where a guide is, i also would be extremely happy!
Ive already read Lystramons guide though.
But if you help me in here i would be even happier!
Please help me
Thanks. |
|
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
Burtonius
Joined: 23 Jun 2006 Posts: 4
|
Posted: Wed Jul 05, 2006 2:38 pm Post subject: |
|
|
well maybe this will help.
| Code: |
use uo;
use os;
include "include/attributes";
program Gumpquestion( who )
var gflayout := {
"nodispose",
"nomove",
"page 0",
"resizepic 55 105 2620 290 200",
"text 145 120 32 0",
"page 1",
"text 80 160 50 1",
"text 80 175 50 2",
"text 80 190 50 3",
"text 80 205 50 4",
"text 80 245 50 5",
"button 300 240 2472 2473 1 0 10" // changed the question marks to numbers
//the first 1 means when they press the button it will close the gump
//the second number 0 is the page to go to when pressed (if the button is taking the user to a new page)
//the last number 10 is the return Id
};
var gfdata := {
"Gump Question!",
"My Gump Question, Read Below!",
"I would be Extremely glad",
"if someone could help me ;)",
"Read Question below please!",
"Click here to get an spellbook"
};
var choice := SendDialogGump( who, gflayout, gfdata ); //store the return value in a var
// if I wrote this the right way you need to look up the objtype for a spellbook on your shard and plug it in for ####.
//then it should create the spellbook in the player's pack if the button is pressed
if(choice[1] = 10)
CreateItemInContainer(who.backpack, 0x####, 1);
endif
endprogram
|
I don't know if I did this right because I am not at home with my scripts in front of me. But I think you can get the idea of what is going on here. If you are curious about the return values then I would suggest sticking in some more buttons and using some print statements to see how they work. I usually do that when I forget how they are returned. Let me know if you see anything grossly wrong or can't understand what I did. |
|
 |
|
|
 |
 |
| Author |
Message |
Damien
Joined: 15 Apr 2006 Posts: 65
|
Posted: Wed Jul 05, 2006 3:30 pm Post subject: |
|
|
| Burtonius wrote: |
| Code: |
use uo;
use os;
include "include/attributes";
program Gumpquestion( who )
var gflayout := {
"nodispose",
"nomove",
"page 0",
"resizepic 55 105 2620 290 200",
"text 145 120 32 0",
"page 1",
"text 80 160 50 1",
"text 80 175 50 2",
"text 80 190 50 3",
"text 80 205 50 4",
"text 80 245 50 5",
"button 300 240 2472 2473 1 0 10" // changed the question marks to numbers
//the first 1 means when they press the button it will close the gump
//the second number 0 is the page to go to when pressed (if the button is taking the user to a new page)
//the last number 10 is the return Id
};
var gfdata := {
"Gump Question!",
"My Gump Question, Read Below!",
"I would be Extremely glad",
"if someone could help me ;)",
"Read Question below please!",
"Click here to get an spellbook"
};
var choice := SendDialogGump( who, gflayout, gfdata ); //store the return value in a var
// if I wrote this the right way you need to look up the objtype for a spellbook on your shard and plug it in for ####.
//then it should create the spellbook in the player's pack if the button is pressed
if(choice[0] == 10)
CreateItemInContainer(who.backpack, 0x0EFA, 1);
endif
endprogram
|
|
Hello again, Thanks there was some small errors which i changed, and now it works!
The error was:
| Code: |
if(choice[1] = 10) // Now if(choice[0] == 10)
CreateItemInContainer(who.backpack, 0x0EFA, 1);
endif
// Just wrote that if anyone else wanted to know :)
|
Hey i understood everything, a HUGE thanks
now i exacly now what to do.
Thanks. |
|
 |
|
|
|