Quote:
Originally Posted by sssssssssss
I fixed the case problems, still nothing.
I missed the case problems, but I understand the triggers and what they do, but as you said as well, cant use triggerserver or client in a level npc.
For whatever reason still, its not getting sent to the server.
|
When you use triggerAction() it doesn't work like triggerServer() where the first parameter is the action name. In the serverside your script is always going to call the
return unless you said "playmidi midi" since params[0] in this case would equal whatever it is that you're sending in the triggerAction()
command (i.e tokens[1] or t[1] in your case).
Also, on the clientside part when you're doing this:
PHP Code:
function onActionenter(p0,p1)
if (p1=="midi")onPlayerenters();
You need to use brackets and you need to take into account what I said above about passing parameters using triggerAction(), so you would end up with this:
PHP Code:
function onActionenter(p0) {
if (p0 == "midi") onPlayerenters();
}
If it's important for you to do an action name check, then you'll need to pass an extra parameter with just that action name, so you would do this:
PHP Code:
triggerAction(this.x+1, this.y+1, "midi", "midi", t[1]);
And then you could do this:
PHP Code:
function onActionmidi(p0) {
if (p0 != "midi") return;
}
The same would apply for the triggerAction() that leads back to clientside. You need to manually pass the action name as a parameter when using triggerAction() (it is automatically passed when you use
triggerServer()).