Display a msg above the head
Code:
function displayNotification(event, playerObjectId, color, text) {
var notificationPacket = event.createPacket(ID_NOTIFICATION);
notificationPacket.objectId = playerObjectId;
notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
notificationPacke*****lor = color;
event.sendToClient(notificationPacket);
}
Yellow text
Code:
function serveralert(event, playerObjectId, color, text) {
var textPacket = event.createPacket(ID_TEXT);
textPacket.name = "WC"; //ornge txt
textPacket.objectId = -1;
textPacket.numStars = 70;
textPacket.bubbleTime = 0;//The time the bubble stays
textPacket.recipient = "";
textPacket.text = text;
textPacket.cleanText = "";
event.sendToClient(textPacket);
}
Red text (error)
Code:
function failurealert(event,text){ //This is used to draw the "# has left"
var failurePacket = event.createPacket(ID_FAILURE);
failurePacket.errorId = 99;
failurePacket.errorDescription = text;
event.sendToClient(failurePacket);
}