View Single Post
  #4  
Old 08-21-2013, 12:25 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Control-NPC:

PHP Code:
function onActionPlayerOnline() {
  
// other code will likely be in here
  
player.join("player_functions");

class: player_functions

PHP Code:
public function sendMsg(msg) {
  
player.triggerclient("weapon""-Messages""msg"msg);

Weapon: -Messages:

PHP Code:
//#CLIENTSIDE

function onActionClientSide() {
  if (
params[0] == "msg") {
    
displayMessage(params[1])
  }
}

public function 
sendMsg(msg) {
  
displayMessage(msg);
}

function 
displayMessage(msg) {
  echo(
msg);

Example Weapon Usage:

PHP Code:
function onCreated() {
  
findplayer("Example").sendMsg("Hello!");

  
player.sendMsg("Also works."); // when player is available.
}

//#CLIENTSIDE

function onCreated() {
  (
"-Messages").sendMsg("World!");

__________________
Quote:

Last edited by fowlplay4; 08-21-2013 at 03:19 AM..
Reply With Quote