View Single Post
  #3  
Old 12-04-2008, 01:26 PM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
Quote:
Originally Posted by Pelikano View Post
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...");

__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote