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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..