Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-20-2018, 06:31 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is just really niceMysticalDragon is just really nice
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
RC Tag

Small thing I did on delteria to tag people and they get a PM and message on iphone player saying they have been tagged in RC.

PHP Code:
function onAllRCChat(msg) {
  for(
temp.msg.tokenize()){
    
temp.temp.t.positions("@").size();
    if(
temp.t.starts("@") && temp.== 1) {
      
temp.acct temp.t.substring(1temp.t.length());
      
temp.fromUser msg.tokenize()[0].substring(0msg.tokenize()[0].length() - 1);
      
temp.fullMessage msg.substring(temp.fromUser.length() + 2);
      if(
RCActive(temp.acct)) {
        
findRC(temp.acct).sendtorc("#ALERTFS " temp.fromUser " tagged you!");
        
findRC(temp.acct).sendPM(msg);
        
msg format("You've been mentioned on RC by %s! Message: %s",  temp.fromUser temp.fullMessage);
        
//DB_Messages.sendPM({temp.acct}, msg); // Enable for iPhone servers
      
}
    }
  }
}

public function 
findRC(acc) {
  for (
temp.pl allplayers) {
    if ((
pl.communityname == acc || pl.account == acc) && pl.level.name == null) {
      return 
pl// RC found
    
}
  }

  return 
findPlayerByCommunityName(acc); // client-RC?
}

public function 
RCActive(acc) {
  return (
findRC(acc) != null);

only tags the first @ it hits.

Usage:

HomelessWitch: @MysticalDragon ******
HomelessWitch tagged you!
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
 


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 05:47 PM.


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