Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Player Paused (https://forums.graalonline.com/forums/showthread.php?t=77010)

Switch 10-02-2007 05:05 PM

Player Paused
 
Is there a function on command for a player being paused? I don't mean something like "if (playerpaused) {}"

BonzaiXxXSRStudios 10-11-2007 04:36 PM

If it was a function woudnt be an event, so in that case why in Gods sweet strawberry slushy would you start with "if" anyway. XD but maybe you can find your answer here.. http://wiki.graal.net/index.php/Crea...ns:_NPC_Server.

Good luck!

BonzaiXxXSRStudios 10-11-2007 04:37 PM

Quote:

Originally Posted by BonzaiXxXSRStudios (Post 1352366)
If it was a function woudnt be an event, so in that case why in Gods sweet strawberry slushy would you start with "if" anyway. XD but maybe you can find your answer here.. http://wiki.graal.net/index.php/Crea...ns:_NPC_Server.

Good luck!

Edit-If it was a function, woudnt be an event? So in that case why in Gods sweet strawberry slushy would you start with "if" anyway. XD but maybe you can find your answer here.. http://wiki.graal.net/index.php/Crea...ns:_NPC_Server.

Crow 10-11-2007 04:51 PM

Well, why dont you use "if (playerpaused)". I doubt theres a function for that, just check the if one in a timeout.

xAndrewx 10-11-2007 05:13 PM

to my knowledge there isn't one. would be cool though !! :)

Kyranki 10-12-2007 12:34 AM

I believe ispaused is a variable of the player object.

xXziroXx 10-12-2007 03:25 PM

Quote:

Originally Posted by Kyranki (Post 1352449)
I believe ispaused is a variable of the player object.

True.

Meaning, you could do something like:

PHP Code:

//#CLIENTSIDE
function onCreated() setTimer(.05);

function 
onTimeOut()
{
  if (
player.ispaued) {
    
// What would happen if the player paused? Hmmm...
  
}
  
setTimer(.05);



BonzaiXxXSRStudios 10-12-2007 10:01 PM

Quote:

Originally Posted by xXziroXx (Post 1352524)
True.

Meaning, you could do something like:

PHP Code:

//#CLIENTSIDE
function onCreated() setTimer(.05);

function 
onTimeOut()
{
  if (
player.ispaued) {
    
// What would happen if the player paused? Hmmm...
  
}
  
setTimer(.05);




At the end of your script...why set the timer again? thats in fact if you did set the timer again.

DustyPorViva 10-12-2007 10:20 PM

Because player.ispaused is a boolean, not an event. So you have to check it in an event, most likely one that is looped.

BonzaiXxXSRStudios 10-12-2007 11:03 PM

Quote:

Originally Posted by DustyPorViva (Post 1352585)
Because player.ispaused is a boolean, not an event. So you have to check it in an event, most likely one that is looped.

So it this script will timeout when you first log in for .5 seconds, do an action during the script, then at the end of that function, time you out for .5 more seconds, right?

coreys 10-12-2007 11:41 PM

Quote:

Originally Posted by BonzaiXxXSRStudios (Post 1352588)
So it this script will timeout when you first log in for .5 seconds, do an action during the script, then at the end of that function, time you out for .5 more seconds, right?

That would be the nature of a timeout loop.

xXziroXx 10-13-2007 01:44 AM

Quote:

Originally Posted by BonzaiXxXSRStudios (Post 1352588)
So it this script will timeout when you first log in for .5 seconds, do an action during the script, then at the end of that function, time you out for .5 more seconds, right?

To be more precise..

When you first login, or the script gets updated, the onCreated() event will trigger and call the event onTimeOut() after 0.5 seconds. Once onTimeOut() is called, it will call itself after 0.5 seconds over and over again.

Switch 10-13-2007 02:07 AM

Quote:

Originally Posted by BonzaiXxXSRStudios (Post 1352366)
If it was a function woudnt be an event, so in that case why in Gods sweet strawberry slushy would you start with "if" anyway. XD but maybe you can find your answer here.. http://wiki.graal.net/index.php/Crea...ns:_NPC_Server.

Then why have "onPlayerChats" and "player.chat"? It's so that it doesn't come out of nowhere and that you don't need timers going every second like I did in the cript I was using.


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

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