Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Onlineseconds Restricted Npc? (https://forums.graalonline.com/forums/showthread.php?t=134263829)

Gunderak 07-11-2011 07:00 AM

Onlineseconds Restricted Npc?
 
could someone please tell me how i would restrict a door to players with certain onlinetime?
iv tried
PHP Code:

if(player.onlineseconds >=100); 

with no luck :/

TSAdmin 07-11-2011 09:48 AM

I believe the variable is actually "onlinetime" rather than "onlineseconds"

Source: http://wiki.graal.net/index.php/Crea...ns:_NPC_Server

Crow 07-11-2011 10:27 AM

Quote:

Originally Posted by TSAdmin (Post 1658338)
I believe the variable is actually "onlinetime" rather than "onlineseconds"

It is.

ffcmike 07-11-2011 01:04 PM

I believe this can only be read serverside aswell.

cbk1994 07-11-2011 02:59 PM

In the future you can use the /scripthelp <term> command on RC to find the name of a variable.

Quote:

Originally Posted by /scripthelp online
Script help for 'online':
TServerPlayer.onlinetime - integer - total time the player has played on the server, in seconds

Your statement is wrong. From a post I made in another of your threads:

Quote:

Originally Posted by cbk1994 (Post 1658202)
The first line is of an if-statement does not need a semicolon as it is not a command, it's a condition.

If you'd read the guide linked to you, you'd see that the proper syntax for an if-else statement is:

PHP Code:

if (condition) {
  
// do something
} else {
  
// do something else
} 


It's frustrating and severely trying my patience to have to give you the same advice multiple times. It's becoming more and more apparent that you're not interested in learning, only in getting your scripts to work. If you keep this up, eventually nobody will respond to your threads as they'll know you don't really want to be able to script.

Gunderak 07-11-2011 03:50 PM

i do want to be able to script :/
@the /scripthelp in rc...
wow.. i cent believe i never knew of that 0_0
i learn by studying others scripts, i will try to learn the proper way.
sorry cbk1994 :(

callimuc 07-11-2011 04:33 PM

Quote:

Originally Posted by Gunderak (Post 1658364)
i do want to be able to script :/
@the /scripthelp in rc...
wow.. i cent believe i never knew of that 0_0
i learn by studying others scripts, i will try to learn the proper way.
sorry cbk1994 :(

Quote:

Originally Posted by ffcmike (Post 1658354)
It would be much better to take time to learn the simple things first, before delving into more complex things like GP tools, which you don't really need anyway.

Once you get a grasp of the basic syntax, how variables and objects work, serverside/clientside differences and communication, not only would you be able to avoid such problems as you have, but you might then be able to think of ways to execute the purpose of the script better.

Scripting isn't really about piecing together functions for the sake of working.

I just agree to that

Gunderak 07-11-2011 05:37 PM

yeah i agree too....
i have been biting off more than i can chew..
thanks thor.
il try to stick to easier things for now =D


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

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