Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Online Time Variable (https://forums.graalonline.com/forums/showthread.php?t=73061)

Loakey_P2P 03-25-2007 07:17 PM

Online Time Variable
 
first off ill explain what im trying to do , then ill explain the trouble im having . shaded legend use to have an event prize that was called "noob detector" . this npc while touching another player generated a random number then show text next to the player you were touching . the text looked like this

"50% noob"

as ive said the old one generated a random percentage number . what id like to do is make it check the players online time for this server . then depending on that , give a percentage . the problem im having is accessing that variable . ive tryed old code as well as new code to find it but ive been unsucessfull . id like to do it in new code but if i cant ill resort to GS1 . ive tryed playeronlinetime , onlinetime , playertime but i cant get the right number . has anyone tryed to access this variable and been sucessfull ?

Angel_Light 03-25-2007 07:21 PM

yes, I remember this, it's like player.onlinesecs or something

Inverness 03-25-2007 07:28 PM

TServerPlayer.onlinetime

So you would use something like findplayer("Inverness").onlinetime

xXziroXx 03-26-2007 01:15 AM

Or simply player.onlinetime.

xAndrewx 04-30-2011 05:26 PM

Sorry but is there a clientside version?

Crow 04-30-2011 05:38 PM

Quote:

Originally Posted by xAndrewx (Post 1646675)
Sorry but is there a clientside version?

For online seconds? Should be the same. If that doesn't work for other players then it's probably not synced with the clientside for all players.

fowlplay4 04-30-2011 05:40 PM

Quote:

Originally Posted by xAndrewx (Post 1646675)
Sorry but is there a clientside version?

No but you could set a clientr/client variable and use:

player.onlinetime = clientr.login_onlinetime + (timevar2 - this.login_timevar2);

Serverside:
clientr.login_onlinetime = player.onlinetime;

Clientside:
this.login_timevar2 = timevar2;

It won't be perfectly precise (may vary by a few seconds), but close enough for what you plan to do I bet.

xAndrewx 04-30-2011 05:47 PM

ah its ok- I wondered if there was a global flag =p

thanks fp4


All times are GMT +2. The time now is 09:24 AM.

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