Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-06-2004, 08:46 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
actionplayer question

For the control npc on my server
I want something to happen when the player logs out.
it's not actionplayeroffline,
(which you think would work since actionplayeronline works for the login)

What is the flag triggered to the server when a player logs out?

Also is there a refrence to serverside commands and flags in a file that someone can post?
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #2  
Old 12-06-2004, 08:53 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
There isn't one, you just need to do a allplayerscount check in a loop and all that. Well, atleast untill the new version, where I'd assume something like this, if not already available, could easily be added via script.
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #3  
Old 12-06-2004, 09:26 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Something like this is a good way to check
PHP Code:
if (createdtimeout=0.1;

if (
timeout) {
  for (
a=0;a<allplayerscount;a++) {
    
with (allplayers[a]) {
      if (
strlen(#F)>0)
        
if(!strcontains(#s(this.tempplayers),#a)) addstring this.tempplayers,#a;
    
}
  }
  
logon();
  
logoff();
  
setstring this.tempplayers,;
  
timeout=1;
}
function 
logon() {
  
tokenize #s(this.tempplayers);
  
for (a=0;a<tokenscount;a++) {
    if (!
strcontains(#s(this.players),#t(a))){
      
addstring this.players,#t(a);
    
}
  }
}
function 
logoff() {
  
tokenize #s(this.players);
  
for (a=0;a<tokenscount;a++) {
    if (!
strcontains(#s(this.tempplayers),#t(a))) {
      
removestring this.players,#t(a);
    
}
  }

__________________

Reply With Quote
  #4  
Old 12-07-2004, 07:36 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by ZeroTrack
Something like this is a good way to check
PHP Code:
if (createdtimeout=0.1;

if (
timeout) {
  for (
a=0;a<allplayerscount;a++) {
    
with (allplayers[a]) {
      if (
strlen(#F)>0)
        
if(!strcontains(#s(this.tempplayers),#a)) addstring this.tempplayers,#a;
    
}
  }
  
logon();
  
logoff();
  
setstring this.tempplayers,;
  
timeout=1;
}
function 
logon() {
  
tokenize #s(this.tempplayers);
  
for (a=0;a<tokenscount;a++) {
    if (!
strcontains(#s(this.players),#t(a))){
      
addstring this.players,#t(a);
    
}
  }
}
function 
logoff() {
  
tokenize #s(this.players);
  
for (a=0;a<tokenscount;a++) {
    if (!
strcontains(#s(this.tempplayers),#t(a))) {
      
removestring this.players,#t(a);
    
}
  }

Looks VERY similar to my npc on Bravo with the exception of a few string names...
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 12-07-2004, 11:02 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
I made a nice who logged out npc before. I dont care who logs out though, so I took it down.
Reply With Quote
  #6  
Old 12-08-2004, 02:56 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
And then I made it again (not a copy just typed my own up... much like the one I put on bravo)
But Slash and I are cool so... <3
__________________
Do it with a DON!
Reply With Quote
  #7  
Old 12-08-2004, 03:07 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by zokemon
Looks VERY similar to my npc on Bravo with the exception of a few string names...
thats cause it is yours =p , MD tried to say it was his haha
__________________

Reply With Quote
  #8  
Old 12-08-2004, 08:54 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by ZeroTrack
thats cause it is yours =p , MD tried to say it was his haha
Ahh..
__________________
Do it with a DON!
Reply With Quote
  #9  
Old 01-01-2005, 02:47 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Hrm -- You shouldn't be too bothered by the players logging out -- By all case, it would case a lot of lag checking the entire list repeatedly... Perhaps make the timeout equal 5 instead of 1, if at all useful.
Reply With Quote
  #10  
Old 01-07-2005, 05:52 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
In the new scripting engine on clientside you have the event actionplayerlogout, the player object is deleted 5 seconds after the player logs out instead of immediatelly removing it. That needed to be added to make the scripted playerlist work.
Something similar will be added to npcserver sometime, although there it is a little bit more complex because both gserver and npcserver would need to keep the player object in the memory so that you can still do modifications on the player which are also saved on hard disk.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:47 PM.


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