Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-23-2009, 05:18 AM
Struggler Struggler is offline
Zone Repulser =D
Struggler's Avatar
Join Date: May 2006
Posts: 54
Struggler is an unknown quantity at this point
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.
Reply With Quote
  #2  
Old 05-23-2009, 06:49 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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.
__________________
Reply With Quote
  #3  
Old 05-23-2009, 10:21 AM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by cbk1994 View Post
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.
Reply With Quote
  #4  
Old 05-23-2009, 06:52 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Pelikano View Post
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);
  }

__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:39 PM.


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