Jump to content
  • 0

[HELP]Java variables sql to simple .


Question

Posted

well actually i want to do something like this ;) :

all you know for example that in navicat at characters tables there is onlineTime or online something like this, that it's an integer (or long , dont know , don't have sense ) .Well in interlude L2J there is not any method like: getPlayerFullTimeOnline() .. so how can i take the onlinetime's value from navicat to make it as a method to read it ?

for example:

if(activeChar.getOnlineTime() < 5000)

{

activeChar.sendMessage("you can't trade if you are not at least 1 hour online");

}

 

Can anyone explain me and do this example(only with the variable)?It will help me a lot.

to understand more: like isNoble() that's read true or false from navicat..

4 answers to this question

Recommended Posts

  • 0
Posted

You have to create a getter for the variable, in L2PcInstance :

 

public void getOnlineTime()
{
    return _onlineTime;
}

 

_onlineTime is normally setted during the restore of the character.

  • 0
Posted

You have to create a getter for the variable, in L2PcInstance :

 

public void getOnlineTime()
{
    return _onlineTime;
}

 

_onlineTime is normally setted during the restore of the character.

aaa i though there wasn't .. just only in database. ok then really thanks.

one mistake you did: it's not void it's a long method.

thanks you ;)

  • 0
Posted

maybe u need to change it to

public void getOnlineTime()
{
    return _onlineTime + (time when he log on) - System.currentTimeMillis();
}
[code]
cos i dont know if it update online time if you dont save & load the character

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...