Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   TriggerClient() format (https://forums.graalonline.com/forums/showthread.php?t=66667)

Bl0nkt 06-13-2006 10:24 PM

TriggerClient() format
 
I've been searching for it but can't find it. Can anyone give me an example?

Here's what I currently have:

NPC Code:
function onCreated()
{
player.triggerclient("weapon name", "params");
}

//#CLIENTSIDE
function onActionClientside()
{
player.chat = "Recieved";
}


xXziroXx 06-13-2006 10:49 PM

On serverside:

triggeraction(0, 0, "clientside", name, "params");

Admins 06-14-2006 12:00 AM

It's triggerclient(objecttype, name, params)
Currently only "weapon" works as objecttype, or "gui" which is the same.

Python523 06-14-2006 09:24 AM

Quote:

Originally Posted by Stefan
It's triggerclient(objecttype, name, params)
Currently only "weapon" works as objecttype, or "gui" which is the same.

NPC Code:
player.triggerclient(weaponname,actionname,params)  ;


Is what I've been using, and it seems to work.

contiga 06-15-2006 02:43 PM

Evil, Stefan's post was at Yesterday, 12:00 AM and Jagen's was at Yesterday, 09:24 AM, what is going on?!

Skyld 06-15-2006 04:50 PM

Quote:

Originally Posted by contiga
Evil, Stefan's post was at Yesterday, 12:00 AM and Jagen's was at Yesterday, 09:24 AM, what is going on?!

stefan: 06-13-2006, 11:00 PM
python523: Yesterday 08:24 AM

Bl0nkt 06-15-2006 05:08 PM

Quote:

Originally Posted by Python523
NPC Code:
player.triggerclient(weaponname,actionname,params)  ;


Is what I've been using, and it seems to work.

Let me use an example from this.

NPC Code:
function onCreated()
{
player.triggerclient("Weapon", "Recieve", 1, 2, 3);
}
//#CLIENTSIDE
function onActionRecieve()
{
player.chat = "recieved";
}



Would this be correct?

Warcaptain 06-15-2006 05:46 PM

its triggerclient("gui",weaponname,param1,param2);

Your problem is that you are expecting it to work like triggeraction and it does not.

It will be:
NPC Code:

function onActionServerSide(){
triggerclient("gui",this.name,"dothis","forme");
}
//#CLIENTSIDE
function onCreated() triggerserver("gui",this.name,"");
function onActionClientSide(){
switch (params[0]){
case "dothis":
echo(params[1]);
}
}


xXziroXx 06-15-2006 07:53 PM

triggerclient(npcname, params); works for me.

Warcaptain 06-15-2006 09:00 PM

Quote:

Originally Posted by xXziroXx
triggerclient(npcname, params); works for me.

Probably because the default value for object type (the first parameter) is gui/weapon. But it may change (doubt it) if Stefan adds more object types.

Either way, triggerclient(objtype,name,params) is the 100% correct format.

ApothiX 06-16-2006 06:58 AM

Quote:

Originally Posted by Python523
NPC Code:
player.triggerclient(weaponname,actionname,params)  ;


Is what I've been using, and it seems to work.

I'm assuming that if you don't use 'object type' for the first parameter, it functions like a normal triggeraction. If you fill in an object type, you will not be able to specify the 'actionname', it always sends actionClientside.

Quote:

Originally Posted by Warcaptain
its triggerclient("gui",weaponname,param1,param2);

Quote:

Originally Posted by Stefan
It's triggerclient(objecttype, name, params)
Currently only "weapon" works as objecttype, or "gui" which is the same.

According to Stefan, 'weapon' works aswell.

Warcaptain 06-16-2006 07:16 AM

Quote:

Originally Posted by ApothiX
According to Stefan, 'weapon' works aswell.

Yes of course 'weapon' works... but as Stefan said 'gui' and 'weapon' are the same.

ApothiX 06-16-2006 02:17 PM

Quote:

Originally Posted by Warcaptain
Yes of course 'weapon' works... but as Stefan said 'gui' and 'weapon' are the same.

The way you worded your reply it sounded like you were criticising his 'player.triggeraction("weapon", ...' format.


All times are GMT +2. The time now is 07:49 AM.

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