Thread: Help :(
View Single Post
  #11  
Old 08-22-2009, 07:07 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by sssssssssss View Post
tried a typical triggeraction, still nothing.
The way you type the actionname is case-sensitive with regards to catching the event, so if you do:

PHP Code:
triggerAction(this.x+1, this.y+1, "Midi", ""); 
Then the way to catch the event HAS to be like this:

PHP Code:
function onActionMidi() {
} 
If you use "midi" or any other variant, then you will have to adjust the onActionActionname() part accordingly (i.e onActionmidi() instead--case-senstive).


As for your problem, I created a quick example of how to do it:

PHP Code:
function onCreated() {
  
setshape(1, 32, 32);
}

function 
onActionTriggerServer(){
  echo(
"You triggered to the serverside!");
  
triggerAction(this.x+1, this.y+1, "TriggerClient", "");
}

//#CLIENTSIDE
function onCreated() {
  
setshape(1, 32, 32);
  
triggerAction(this.x+1, this.y+1, "TriggerServer", "");
}

function 
onActionTriggerClient() {
  
this.chat = "You triggered to the clientside!";
} 

You can pass parameters by removing the part where I used empty quotations and replacing it with the parameters.

Last edited by Gambet; 08-22-2009 at 07:19 AM..
Reply With Quote