Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Public Chat Help (https://forums.graalonline.com/forums/showthread.php?t=85689)

Struggler 05-23-2009 05:18 AM

Public Chat Help
 
okay, I have a weapon that is to be voice commanded, but not by the player who wields the weapon, by me. How would I do this? Allow me to say something and function within someone elses weapon is to be executed?
i was thinking
PHP Code:

public function onChats() 

but i dont think thats right.

cbk1994 05-23-2009 06:49 AM

PHP Code:

//#CLIENTSIDE
function onRemotePlayerChats(pl) {
  if (
pl.account == "whatever") {
    if (
pl.chat == "death") {
      
player.chat "I have been death'd.";
    }
  }


I guess that would work, but you're probably better off going serverside. I don't know exactly what you're trying t odo.

Pelikano 05-23-2009 10:21 AM

Quote:

Originally Posted by cbk1994 (Post 1493276)
PHP Code:

//#CLIENTSIDE
function onRemotePlayerChats(pl) {
  if (
pl.account == "whatever") {
    if (
pl.chat == "death") {
      
player.chat "I have been death'd.";
    }
  }


I guess that would work, but you're probably better off going serverside. I don't know exactly what you're trying t odo.

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.

cbk1994 05-23-2009 06:52 PM

Quote:

Originally Posted by Pelikano (Post 1493317)
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(cmdacc) {
  switch (
cmd) {
    case 
"summon": {
      
findPlayerByCommunityName(acc).setlevel2(player.level.nameplayer.xplayer.y);
      break; 
// etc
    
}
  }
}
//#CLIENTSIDE
function onPlayerChats() {
  
temp.cmds = {"summon""disconnect"};
  
  
temp.tokens player.chat.tokenize();
  if (
tokens[0].substring(1in cmds) {
    
triggerserver("gui"nametokens[0].substring(1), tokens);
  }




All times are GMT +2. The time now is 04:26 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.