Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gui_Profile [Help] (https://forums.graalonline.com/forums/showthread.php?t=134266824)

Bleachlover551 07-20-2012 06:15 AM

Gui_Profile [Help]
 
i want it to replace the defualt right click on a player ^^

PHP Code:

// Scripted by Toshi!
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowCtrl("MyGUI_Profile_Window3") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,240";

    
canmove true;
    
canresize false;
    
closequery false;
    
destroyonhide false;
    
text "Profile : @pl.nick@"//should show player nick
    
517;
    
208;

    new 
GuiTextCtrl("MyGUI_Profile_Text10") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Country :"// show display a drop list of countries
      
width 51;
      
10;
      
10;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text11") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Online-Time : @pl.onlinetime@"//show show the players online time
      
width 78;
      
9;
      
32;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text12") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Relationship :"// should show a drop down box of stuff single marries ect.
      
width 78;
      
10;
      
54;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text13") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Gralats ($) : pl.gralats "// show player money
      
width 66;
      
10;
      
74;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text14") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Health : pl.hp/pl.maxhp"// show player heart points over there max heart points like 4/5 hearts
      
width 43;
      
11;
      
95;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text15") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Align : pl.ap"// there current ap
      
width 34;
      
12;
      
116;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text16") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Kills : pl.kills"// how many kills they have
      
width 33;
      
12;
      
140;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text17") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Spar W-L :"// show show something like 1-3 wins equal 1 and loses equal 3 but like this "#-#"
      
width 59;
      
12;
      
162;
    }
    new 
GuiScrollCtrl("MyGUI_Profile_TextList1_Scroll") {
      
profile GuiBlueScrollProfile;
      
alpha 0;
      
height 115;
      
hscrollbar "alwaysOff";
      
vscrollbar "dynamic";
      
width 132;
      
willfirstrespond false;
      
187;

      new 
GuiTextListCtrl("MyGUI_Profile_TextList1") {
        
profile GuiBlueTextListProfile;
        
alpha 0;
        
fitparentwidth false;
        
height 34;
        
horizsizing "width";
        
sortcolumn 143384832;
        
width 219;
      }
    }
    new 
GuiPopUpMenuCtrl("MyGUI_Profile_Popup1") {
      
profile GuiBluePopUpMenuProfile;
      
height 20;
      
maxpopupheight 200;
      
scrollprofile "GuiTextProfile";
      
text "Country"//show have a drop down box of diff countries
      
width 120;
      
67;
      
11;
    }
    new 
GuiPopUpEditCtrl("MyGUI_Profile_PopupEdit1") {
      
profile GuiBluePopUpMenuProfile;
      
alpha 0;
      
height 20;
      
scrollprofile "GuiTextProfile"//show show a gani like a run then sword attack;
      
width 120;
      
192;
      
174;
    }
    new 
GuiScrollCtrl("MyGUI_Profile_MultiLine1_Scroll") {
      
profile GuiBlueScrollProfile;
      
alpha 0;
      
constantthumbheight true;
      
height 55;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 320;
      
willfirstrespond false;
      
184;

      new 
GuiMLTextCtrl("MyGUI_Profile_MultiLine1") {
        
profile GuiBlueMLTextProfile;
        
alpha 0;
        
height 17;
        
horizsizing "width";
        
parsetags false;
        
plaintext "Multi Line Text Field Standard Content";
        
text "Multi Line Text Field Standard Content";
        
width 217;
        
wordwrap false;
      }
    }
    new 
GuiTextEditCtrl("MyGUI_Profile_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 55;
      
hint "Status";    // make a status that stays on it     
      
width 320;
      
185;
    }
  }


heres a picture and also i want a runing gani where u see my character at.
http://bleachlover551.webs.com/yolo.PNG

cbk1994 07-20-2012 06:26 AM

What do you need help with? We can't make the whole thing for you.

Bleachlover551 07-20-2012 06:29 AM

Quote:

Originally Posted by cbk1994 (Post 1699794)
What do you need help with? We can't make the whole thing for you.

i put // on the things i need help with.

Emera 07-20-2012 10:00 AM

pl.kills, pl.app etc don't go inside a string. They go outside.
PHP Code:

this.text "Kills:" SPC pl.kills


Crow 07-20-2012 10:01 AM

Quote:

Originally Posted by Emera (Post 1699807)
pl.kills, pl.app etc don't go inside a string. They go outside.
PHP Code:

this.text "Kills:" SPC pl.kills


And referencing a pl object won't do you no good if it doesn't even exist.

Bleachlover551 07-20-2012 09:27 PM

do i?
 
Quote:

Originally Posted by Emera (Post 1699807)
pl.kills, pl.app etc don't go inside a string. They go outside.
PHP Code:

this.text "Kills:" SPC pl.kills


so all i have to do is add SPC pl.nick; SPC pl.kills; and so on?

cbk1994 07-21-2012 12:03 AM

Quote:

Originally Posted by Bleachlover551 (Post 1699842)
so all i have to do is add SPC pl.nick; SPC pl.kills; and so on?

As Crow said, pl won't have been set. Use findPlayer(account) to get the player object. Some of that info is only going to be available serverside, though, so you'll have to stuff all the data you need into an array serverside and then send it back to the client to display it.

Bleachlover551 07-22-2012 10:17 PM

O_o!
 
Quote:

Originally Posted by cbk1994 (Post 1699860)
As Crow said, pl won't have been set. Use findPlayer(account) to get the player object. Some of that info is only going to be available serverside, though, so you'll have to stuff all the data you need into an array serverside and then send it back to the client to display it.

Wow thats Hard I thought Gui Would Be Easy :-/

BlueMelon 07-23-2012 01:22 AM

Why Do You Talk Like This? Its Very Annoying. ...

Instead, you could trigger the client with the needed data, and create the GUI afterwards.

devilsknite1 07-23-2012 02:27 AM

Quote:

Originally Posted by Bleachlover551 (Post 1699954)
Wow thats Hard I thought Gui Would Be Easy :-/

Not all that hard... Try checking out this link if you're a beginner.

cbk1994 07-23-2012 02:50 AM

Quote:

Originally Posted by Bleachlover551 (Post 1699954)
Wow thats Hard I thought Gui Would Be Easy :-/

It is easy, but you can't expect to create something without spending a bit of time getting familiar with the platform.

You can read more about serverside, clientside, and triggers here.

Emera 07-23-2012 02:55 PM

Quote:

Originally Posted by Crow (Post 1699808)
And referencing a pl object won't do you no good if it doesn't even exist.

Obviously, but reading his script will show that he's put references to pl. objects into a string, so I'm making a logical assumption that they already exist.

Crow 07-23-2012 04:44 PM

Quote:

Originally Posted by Emera (Post 1699977)
Obviously, but reading his script will show that he's put references to pl. objects into a string, so I'm making a logical assumption that they already exist.

They probably don't.

xXziroXx 07-23-2012 07:40 PM

Quote:

Originally Posted by Emera (Post 1699977)
Obviously, but reading his script will show that he's put references to pl. objects into a string, so I'm making a logical assumption that they already exist.

Obviously, the more "logical" assumption would be that considering he's new to programming and how he has no idea how to do what he's trying to do, would be to assume he saw it used in another script and have no idea what he's doing with it.

Emera 07-23-2012 10:01 PM

Quote:

Originally Posted by xXziroXx (Post 1699982)
Obviously, the more "logical" assumption would be that considering he's new to programming and how he has no idea how to do what he's trying to do, would be to assume he saw it used in another script and have no idea what he's doing with it.

He's "obviously" got some idea about what he's trying to do since he actually made the profile GUI and such, and has edited it to look like what he wants it to look like. Not everybody is stupid, you know.

Crow 07-23-2012 10:53 PM

Quote:

Originally Posted by Emera (Post 1699999)
He's "obviously" got some idea about what he's trying to do since he actually made the profile GUI and such, and has edited it to look like what he wants it to look like. Not everybody is stupid, you know.

Ziro didn't say he was stupid. Creating and positioning GUI elements is as easy as pie.

xXziroXx 07-24-2012 12:20 AM

Quote:

Originally Posted by Emera (Post 1699999)
Not everybody is stupid, you know.

Yes, they are, until proven otherwise - not that I said he was stupid to begin with, I just said he probably saw it in another script and thought it'd work.

Emera 07-24-2012 03:13 PM

Quote:

Originally Posted by Crow (Post 1700002)
Ziro didn't say he was stupid. Creating and positioning GUI elements is as easy as pie.

Quote:

Originally Posted by xXziroXx (Post 1700009)
Yes, they are, until proven otherwise - not that I said he was stupid to begin with, I just said he probably saw it in another script and thought it'd work.

mhm

BlueMelon 07-24-2012 03:24 PM

You concat strings using @, so don't place it inside a string (" ")

PHP Code:

"Profile : @pl.nick@"

Would be:
PHP Code:

"Profile: " pl.nick 

Also, you are referencing 'pl' which is a uninitialized variable. Look into using the findplayer() function.

cbk1994 07-24-2012 03:26 PM

Quote:

Originally Posted by BlueMelon (Post 1700037)
You concat strings using @, so don't place it inside a string (" ")

PHP Code:

"Profile : @pl.nick@"

Would be:
PHP Code:

"Profile: " pl.nick 

Also, you are referencing 'pl' which is a uninitialized variable. Look into using the findplayer() function.

ya

Quote:

Originally Posted by Emera (Post 1699807)
pl.kills, pl.app etc don't go inside a string. They go outside.
PHP Code:

this.text "Kills:" SPC pl.kills


Quote:

Originally Posted by Crow (Post 1699808)
And referencing a pl object won't do you no good if it doesn't even exist.

Quote:

Originally Posted by cbk1994 (Post 1699860)
As Crow said, pl won't have been set. Use findPlayer(account) to get the player object. Some of that info is only going to be available serverside, though, so you'll have to stuff all the data you need into an array serverside and then send it back to the client to display it.


xXziroXx 07-24-2012 07:07 PM

Quote:

Originally Posted by Emera (Post 1700035)
mhm

I never called him personally stupid, I'm calling everyone in the world stupid until they prove otherwise, and that was after you accused me of calling him stupid.

Bleachlover551 07-24-2012 07:32 PM

I didn't try to call this annoying i really respect everyone of you for helping me. :)

Bleachlover551 08-04-2012 09:53 PM

So Would My Code Look Something Like This?

PHP Code:

// Scripted by Toshi!
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowCtrl("MyGUI_Profile_Window3") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,240";
    
canmove true;
    
canresize false;
    
closequery false;
    
destroyonhide false;
    
text ="Profile: " pl.nick;
    
517;
    
208;
    
    new 
GuiTextCtrl("MyGUI_Profile_Text10") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Country :";
      
width 51;
      
10;
      
10;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text11") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Online-Time :" SPC pl.onlinetime;
      
      
width 78;
      
9;
      
32;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text12") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Relationship :";
      
width 78;
      
10;
      
54;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text13") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Gralats ($) :" SPC pl.gralats;
      
width 66;
      
10;
      
74;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text14") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Health :" SPC pl.hp/SCP pl.maxhp;
      
width 43;
      
11;
      
95;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text15") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Align :" SPC pl.ap;
      
width 34;
      
12;
      
116;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text16") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Kills :" SPC pl.kills;
      
width 33;
      
12;
      
140;
    }
    new 
GuiTextCtrl("MyGUI_Profile_Text17") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Spar W-L :";
      
width 59;
      
12;
      
162;
    }
    new 
GuiScrollCtrl("MyGUI_Profile_TextList1_Scroll") {
      
profile GuiBlueScrollProfile;
      
alpha 0;
      
height 115;
      
hscrollbar "alwaysOff";
      
vscrollbar "dynamic";
      
width 132;
      
willfirstrespond false;
      
187;
      
      new 
GuiTextListCtrl("MyGUI_Profile_TextList1") {
        
profile GuiBlueTextListProfile;
        
alpha 0;
        
fitparentwidth false;
        
height 34;
        
horizsizing "width";
        
sortcolumn 143384832;
        
width 219;
      }
    }
    new 
GuiPopUpMenuCtrl("MyGUI_Profile_Popup1") {
      
profile GuiBluePopUpMenuProfile;
      
height 20;
      
maxpopupheight 200;
      
scrollprofile "GuiTextProfile";
      
text "Country";
      
width 120;
      
67;
      
11;
    }
    new 
GuiPopUpEditCtrl("MyGUI_Profile_PopupEdit1") {
      
profile GuiBluePopUpMenuProfile;
      
alpha 0;
      
height 20;
      
scrollprofile "GuiTextProfile";
      
width 120;
      
192;
      
174;
    }
    new 
GuiScrollCtrl("MyGUI_Profile_MultiLine1_Scroll") {
      
profile GuiBlueScrollProfile;
      
alpha 0;
      
constantthumbheight true;
      
height 55;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 320;
      
willfirstrespond false;
      
184;
      
      new 
GuiMLTextCtrl("MyGUI_Profile_MultiLine1") {
        
profile GuiBlueMLTextProfile;
        
alpha 0;
        
height 17;
        
horizsizing "width";
        
parsetags false;
        
plaintext "Multi Line Text Field Standard Content";
        
text "Multi Line Text Field Standard Content";
        
width 217;
        
wordwrap false;
      }
    }
    new 
GuiTextEditCtrl("MyGUI_Profile_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 55;
      
hint "Status";
      
width 320;
      
185;
    }
  }


anyways how would i make it so every person who right clicks the other player see ther other player stats..?

cbk1994 08-04-2012 10:01 PM

Quote:

Originally Posted by Bleachlover551 (Post 1700952)
anyways how would i make it so every person who right clicks the other player see ther other player stats..?

By reading the posts in this thread and following the advice contained in them. Get it working without dealing with right-clicking first, and then add that after everything else is working. Then you can test it easier.

Stuff it in a function like

PHP Code:

function showProfile(temp.account) {
  


and call that in onCreated with some account for easy testing.

When you're ready to start on the right-click bits, look at this thread for reference (read the posts after the OP).


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

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