![]() |
Triggeraction from serverside to clientside?
Note: I mean in a local DB NPC, not a weapon.
I want to do something like this: (Well, what I need this for isn't for this script, but still... this is an example of the scenario) NPC Code: ... But that doesn't seem to work. Is there a way to make this work? I can't use save[#0-299], because I believe you can only transfer variables with those, unless I'm mistaken. |
Find out exactly what part doesn't work - eliminate all extraneous code.
|
Does triggeraction even work serverside? It never does for me.
|
Triggeraction does seem to work serverside, but it can't go to the clientside part of a script (unless you do it in a weapon with "triggeraction 0,0,clientside,weapon,params")
|
Exactly.
I suggest you just set client. flags and strings which the client subsequently may unset. |
Re: Triggeraction from serverside to clientside?
Quote:
Wouldn't you do triggeraction x,y,test,#v(id),#s(this.test); |
perhaps the npc is x+.55 and y+.5 from the npc triggering the action.
|
well if you trigger it on its x + y then its sending to its own NPC i believe. One of my scripts are like that.
Grab npc and it sends a script to the join npc. if (created) join pwnt; if (actiongrab) triggeraction x,y,test,pwnt; then in join class: if (actiontest) message #p(0); or something |
No. (x,y) does not point inside of the NPC. (|x+.25,x+1.75|,|y+.25,y+1.75|) (probably a greater range than that, but not to ({x,x+2},{y,y+2})) does.
Also, I don't see why an if clause with the created event is needed when using the join command... join is like an include. (Or, "require" in PHP, which is an alias of include... although PHP does have the "include" command.) |
Quote:
join pwnt; if (actiongrab) triggeraction x,y,test,pwnt; then in join class: if (actiontest) message #p(0); or something anyway u dont need it. And in PHP (I seen some php sources) your right. I think they do that in C++ also |
That script is fine for me... What isn't working?
NPC Code: |
If you test it offline, it works, because in offline mode, it doesn't care at all about clientside and serverside. Basically, the entire thing is "clientside" (although I do believe with() works in offline mode, from what I've heard). However, if you test in online mode, it does not.
Anyway, I got it to work by setting client. strings to everyone on the server (and they get deleted by the NPC when it changes that to the this. string) |
| 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.