View unanswered posts | View active topics It is currently Sat, December 15th, 2018, 07:54



Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Server commands I made don't work 
Author Message
User avatar

Posts: 1175
BL Name: TheToxicRadio
BL ID: 11076
Post Server commands I made don't work
I just finished scripting my first add-on that isn't a sound, but when I went to test it, neither of the /commands worked. I made the whole while looking at the RTB Wiki /command article and another script, so I don't see why this shouldn't work, unless the fact that I tested it on myself contributes. Halp plz? Updated script twice since OP and tested on another person to no avail, also de- and re-activated the add-on in-game via console.

[code]package approvalCmds
{
function serverCmdAwesome(%client,%target)
{
if(isObject(findclientbyname(%target)))
{
messageAll("\c3" @ %client.name @ "\c6 thinks that \c3" @ findclientbyname(%target).name @ "\c6 is awesome!!"); //*
}
else
{
messageClient("\c6No client with \c3" @ %target @ "\c6 in their name exists!!");
}
}
function serverCmdFishface(%client,%target)
{
if(isObject(findclientbyname(%target)))
{
messageAll("\c3" @ %client.name @ "\c6 thinks that \c3" @findclientbyname(%target).name @ "\c6 is a fishface."); //*
}
else
{
messageClient("\c6No client with \c3" @ %target @ "\c6 in their name exists!!");
}
}
};

activatePackage(approvalCmds);[/code]*not actually on multiple lines


Sun, February 21st, 2010, 07:25
Profile
Global Moderator
User avatar

Posts: 650
BL Name: McTwist
BL ID: 9845
Post Re: Server commands I made don't work
First, you don't have to package commands/functions that you made yourself.
Secondly, if you're same function with same arguments more than one, then put the result in a variable to spare CPU time.
Thirdly, messageClient works in a way that first you insert target client, in this case the one that calls the command. Then insert an empty tagged string to make it post in the chat. Else you could insert some function you know that you can use, to call a gui for example. And it needs a string where you will say whatever you want to say.
Finally, messageAll also needs a tagged string first, and then the string that will be displayed.

[code]function serverCmdAwesome(%client,%target)
{
%obj = findclientbyname(%target);
if(isObject(%obj))
{
messageAll('', "\c3" @ %client.name @ "\c6 thinks that \c3" @ %obj.name @ "\c6 is awesome!!"); //*
}
else
{
messageClient(%client, '', "\c6No client with \c3" @ %target @ "\c6 in their name exists!!");
}
}
function serverCmdFishface(%client,%target)
{
%obj= findclientbyname(%target);
if(isObject(%obj))
{
messageAll('', "\c3" @ %client.name @ "\c6 thinks that \c3" @ %obj.name @ "\c6 is a fishface."); //*
}
else
{
messageClient(%client, '', "\c6No client with \c3" @ %target @ "\c6 in their name exists!!");
}
}[/code]

_________________
[img]http://img115.imageshack.us/img115/2213/logoqn0zp3.png[/img]


Mon, February 22nd, 2010, 13:52
Profile
User avatar

Posts: 1175
BL Name: TheToxicRadio
BL ID: 11076
Post Re: Server commands I made don't work
Awesome, it works!! Thanks for your halpz :3


Tue, February 23rd, 2010, 00:48
Profile

Posts: 116
BL Name: [Script]
BL ID: 8788
Post Re: Server commands I made don't work
Damn, I was too late. :omnom:


Sun, March 14th, 2010, 19:19
Profile
Administrator
User avatar

Posts: 775
BL Name: Demian
BL ID: 10334
Post Re: Server commands I made don't work
You're alive! =O

_________________
[size=120][b]~Weekly Poll~[/b][/size]
[i][url=http://blockland.dataorb.net/forum/viewtopic.php?f=2&t=100]None[/url][/i]

[size=120][b]~Building Competitions~[/b][/size]
[url=http://blockland.dataorb.net/forum/viewtopic.php?f=5&t=29]Pimp My Demo House![/url]
[url=http://blockland.dataorb.net/forum/viewtopic.php?f=5&t=150]Land Vehicle Competition[/url]


Sun, March 14th, 2010, 19:25
Profile WWW

Posts: 116
BL Name: [Script]
BL ID: 8788
Post Re: Server commands I made don't work
[quote="Demian"]You're alive! =O[/quote]

Why shouldn't I be alive?


Sun, March 14th, 2010, 19:31
Profile
Global Moderator
User avatar

Posts: 650
BL Name: McTwist
BL ID: 9845
Post Re: Server commands I made don't work
You did nothing for about one month.

_________________
[img]http://img115.imageshack.us/img115/2213/logoqn0zp3.png[/img]


Mon, March 15th, 2010, 10:25
Profile

Posts: 116
BL Name: [Script]
BL ID: 8788
Post Re: Server commands I made don't work
[quote="McTwist"]You did nothing for about one month.[/quote]

Yeah, it's because my graphics card burned out, so I couldn't use the computer because it was missing a integrated graphics card.


Mon, March 15th, 2010, 10:57
Profile
Global Moderator
User avatar

Posts: 650
BL Name: McTwist
BL ID: 9845
Post Re: Server commands I made don't work
Library? School? Buy a new temporary instantly?

_________________
[img]http://img115.imageshack.us/img115/2213/logoqn0zp3.png[/img]


Mon, March 15th, 2010, 18:59
Profile

Posts: 116
BL Name: [Script]
BL ID: 8788
Post Re: Server commands I made don't work
[quote="McTwist"]Library? School? Buy a new temporary instantly?[/quote]

Got a new laptop, soon going to get graphics card for other PC.


Tue, March 16th, 2010, 10:02
Profile
Global Moderator
User avatar

Posts: 650
BL Name: McTwist
BL ID: 9845
Post Re: Server commands I made don't work
Took a while...

_________________
[img]http://img115.imageshack.us/img115/2213/logoqn0zp3.png[/img]


Tue, March 16th, 2010, 14:04
Profile

Posts: 116
BL Name: [Script]
BL ID: 8788
Post Re: Server commands I made don't work
[quote="McTwist"]Took a while...[/quote]

It sure did, because I needed both numpad and CD + DVD Reader & Burner.


Tue, March 16th, 2010, 15:29
Profile
Global Moderator
User avatar

Posts: 650
BL Name: McTwist
BL ID: 9845
Post Re: Server commands I made don't work
A DVD burner should have a back compatibility for CD and burning them too.

And you could also buy an external numpad if it was that important. Blockland works without it you know?

_________________
[img]http://img115.imageshack.us/img115/2213/logoqn0zp3.png[/img]


Wed, March 17th, 2010, 10:02
Profile

Posts: 116
BL Name: [Script]
BL ID: 8788
Post Re: Server commands I made don't work
[quote="McTwist"]
And you could also buy an external numpad if it was that important. Blockland works without it you know?[/quote]

External numpads are irritating, and yes, I know Blockland works without it.


Wed, March 17th, 2010, 13:47
Profile
User avatar

Posts: 1175
BL Name: TheToxicRadio
BL ID: 11076
Post Re: Server commands I made don't work
Stop replying to the post direcly above you with a quote.


Thu, March 18th, 2010, 04:36
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 16 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.