I am working on making a custom chat system, and I wanted to have a gui to display previous chat from the player and other players. I managed to get most of it to work, but I am stuck on getting it to send to other players gui and have it display others text. Can someone explain what is wrong and possibly if there is a better way to find the players than by if they are in the same level?
trigger:
PHP Code:
function onPlayerChats() {
triggerserver("gui", this.name, "sendchat", player.account, player.chat, player.account);
}
serverside:
PHP Code:
function onActionServerSide() {
if (params[0] == "sendchat") {
for (pl : allplayers) {
if (pl.level == findplayer(params[3]).level) {
triggerclient("gui", this.name, "displaychat", params[1], params[2]);
}
}
}
}
the clientside that is retrieved if play is in same area:
http://pastebin.com/ts8SGipV (forum kept giving me a denial message, so I posted it there)
entire script if it helps to get an idea of what i'm doing:
http://pastebin.com/Fm0CMqGb