mes "[NPC]";mes "Enter a name of a player.";next;input .@playername$;mes "[NPC]";mes "Enter a message.";next;input .@message$;set .@playerid,getcharid(3,.@playername$); // retrieve rid of another playerset .@invokeid,getcharid(3); // retrieve rid of the current playerdetachrid; // detaches the current player, // although not necessary before attachridif(.@playerid && attachrid(.@playerid)) // playerid is 0 if player is offline{ dispbottom .@message$"; // Displays the message to second player}else{ set .@playerid,0; // indicate attachrid failure}if(attachrid(.@invokeid)) // attach back to the first player{ if(.@playerid) { mes "I have said " + .@message$ + " to "+.@playername$+"."; } else { mes "I was not able to reach "+.@playername$+"."; } close;}end;
We use essential cookies to make this site work, and optional cookies to enhance your experience.