Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-23-2012, 12:42 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
trigger client in a DB NPC

PHP Code:

function onCreated(){
  
trigWeapon("Test");
}

function 
trigWeapon(trig){
  
triggerClient("npc","Blue_Temp","triggar",trig);
}

//#CLIENTSIDE

function onActionClientSide(){
  if(
params[0] == "triggar"){
    
findWeapon("Blue/Temp").trigger(params[1], "");
  }

And then ofcourse in Blue/Temp (weapon) I would have on clientside
function onTest(){ player.chat = "test"; }

Anyone have an idea why its not triggering?
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #2  
Old 03-23-2012, 12:59 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by BlueMelon View Post
PHP Code:

function onCreated(){
  
trigWeapon("Test");
}

function 
trigWeapon(trig){
  
triggerClient("npc","Blue_Temp","triggar",trig);
}

//#CLIENTSIDE

function onActionClientSide(){
  if(
params[0] == "triggar"){
    
findWeapon("Blue/Temp").trigger(params[1], "");
  }

And then ofcourse in Blue/Temp (weapon) I would have on clientside
function onTest(){ player.chat = "test"; }
Anyone have an idea why its not triggering?
Triggerclient does not work within any form of NPC, it works within Weapons.
That aside, there would be no player object within the onCreated event, you would have to do:

PHP Code:
findplayer("account").triggerClient(params); 
Reply With Quote
  #3  
Old 03-23-2012, 06:19 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by ffcmike View Post
Triggerclient does not work within any form of NPC, it works within Weapons.
That aside, there would be no player object within the onCreated event, you would have to do:

PHP Code:
findplayer("account").triggerClient(params); 
So there is no way to do it fully in the DB NPC?
Meh, I guess I could do that.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #4  
Old 03-23-2012, 07:07 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
NVM problem solved.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #5  
Old 03-23-2012, 11:09 PM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by BlueMelon View Post
NVM problem solved.
Can you post how in case people have the same problem in the future?
Reply With Quote
  #6  
Old 03-24-2012, 12:55 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by MattKan View Post
Can you post how in case people have the same problem in the future?
I would have if it wouldn't have been posted in this thread.

I used triggerclient to a players weapon.
__________________
http://i.imgur.com/OOJbW.jpg
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 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.