Quote:
Originally Posted by Pelikano
I've got two small questions:
1) Can I start a scheduleevent Clientside and run it Serverside?
2) How do I trigger a class?
I know about: "triggerserver("gui",this.name,blabla);
But how do I trigger a class using triggerserver? "class" instead of "gui" doesn't seem to work.
|
1.) This is an impossibility as of yet.
2.) You don't "trigger" a class in the traditional sense, you must first join the class to the script so you can trigger it. This is how classes work, by the way:
PHP Code:
// Class "dothis-test"
//#CLIENTSIDE
function onDoThis()
{
echo("Doing this...");
}
// Weapon
//#CLIENTSIDE
function onCreated()
{
this.join("dothis-test");
scheduleEvent(5, "DoThis", null);
}
What the
join method does is merge the class into the script, so the actual code viewed by the interpreter is this:
PHP Code:
// Weapon
//#CLIENTSIDE
function onCreated()
{
scheduleEvent(5, "DoThis", null);
}
function onDoThis()
{
echo("Doing this...");
}