Thread: RC Tag
View Single Post
  #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 a jewel in the roughMysticalDragon is a jewel in the rough
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