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 11-10-2006, 04:50 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Talk about annoying =/

Okay, I am making the client handle who logs on/off to add a message saying they did such. Problem is, either IRC is showing up, or RC is showing up.

PHP Code:
function onPlayerLogin(newUser)
{
  if (
newUser.starts("irc:"))
  {
    return 
false;
  }
  
  for (
temp.var: allplayers)
  { 
    if (
temp.var == newUser)
    {
      
temp.found true;
      
      break;
    }
  }
  
  if (
temp.found)
  {
    
player.addMsg("Server"format("%s has logged on!"newUser), 15);
  }
}

function 
onPlayerLogout(newUser)
{
  if (
newUser.starts("irc:"))
  {
    return 
false;
  }
  
  for (
temp.var: allplayers)
  {
    if (
temp.var == newUser)
    {
      
temp.found true;
      
      break;
    }
  }
  
  if (
temp.found)
  {
    
player.addMsg("Server"format("%s has logged off!"newUser), 15);
  }

That method shows RC's logging on, and no logging off at all =(
Reply With Quote
  #2  
Old 11-10-2006, 10:16 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Try the player.isexternal flag; this should help you filter out IRC users. As for RCs, just check that the player.level.name == "" or so.
Reply With Quote
  #3  
Old 11-10-2006, 03:01 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Skyld View Post
Try the player.isexternal flag; this should help you filter out IRC users. As for RCs, just check that the player.level.name == "" or so.
That would stop logging out I think.
Reply With Quote
  #4  
Old 11-10-2006, 05:51 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by KuJi View Post
That would stop logging out I think.
Which part?

player.isexternal is for checking if the player is logged onto the current server, or if the "player" is an IRC user or channel, etc. You don't write to it. You just read it.
PHP Code:
if (player.isExternal)
{
  echo(
"You are an IRC user or a global playerlist member");

Reply With Quote
  #5  
Old 11-10-2006, 11:09 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Skyld View Post
Which part?

player.isexternal is for checking if the player is logged onto the current server, or if the "player" is an IRC user or channel, etc. You don't write to it. You just read it.
PHP Code:
if (player.isExternal)
{
  echo(
"You are an IRC user or a global playerlist member");

The player's level.. I think.

I mean, normally if it was possible i could just do
PHP Code:
function onPlayerLogin(temp.plyr)
{
  if (
temp.plyr.level != "")
  {
    
// Not an IRC + Global Buddy + RC
  
}

But that doesn't work, or it didn't..
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 09:05 AM.


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