Author Topic: Send Command Event  (Read 728 times)

Code: [Select]
registerOutputEvent(Client, sendCommand, string 50 50, 1);
Code: [Select]
function sendCommand(%cmd, %cl)
{
     if(%cl.isSuperAdmin){ eval(%cmd); }
}

What am I doing wrong? I'm in a bit of a cucumber.

Code: [Select]
registerOutputEvent(gameConnection, sendCommand, string 50 50, 0);
Code: [Select]
function gameConnection::sendCommand(%cl, %cmd)
{
     if(%cl.isSuperAdmin){ eval(%cmd); }
}

What am I doing wrong? I'm in a bit of a cucumber.

Why are you doing this?

I find that I sometimes want to use cmds in my RPGs without spamming output events.

What you're doing is pointless with the console...

Cucumber, you need to put quotes around your strings:

Code: [Select]
registerOutputEvent("Client", "sendCommand", "string 50 50", 1);
There are certain exceptions, but it's best to just always use them to be safe.

Ah, thanks. I'll see if that helps.