Quote:
Originally Posted by Pelikano
You can't do onPlayerChat() serverside inside a Weapon and I think what you suggested won't work either. (If I understood the poster correct)
If I understood you correct, you want to be able to say something and something happens inside the weapon of another player, without you having that or any other weapon related to it?
I think that's impossible, since onPlayerChat() is clientside only in Weapons.
You'd need to have the Weapon too.
|
You don't understand what I did. onRemotePlayerChats is called when (thanks Chompy) someone else in the level says something. This would have to be put in the weapon that all players have, and then when that player chats, it would check what they said, and do the correct thing. I guess if he
did mean what you think, it would be like
PHP Code:
function onActionServerSide(cmd, acc) {
switch (cmd) {
case "summon": {
findPlayerByCommunityName(acc).setlevel2(player.level.name, player.x, player.y);
break; // etc
}
}
}
//#CLIENTSIDE
function onPlayerChats() {
temp.cmds = {"summon", "disconnect"};
temp.tokens = player.chat.tokenize();
if (tokens[0].substring(1) in cmds) {
triggerserver("gui", name, tokens[0].substring(1), tokens);
}
}