Author Topic: Some scripting help.  (Read 726 times)

Below this line is fixed, lastest post by me is what i need help with

So im kinda getting into some coding, and im working on some kind of test script, but while testing theres a syntax error on like 9.
Here's the code:
Code: [Select]
function serverCmdWarn(%client, %name)
{
if(%client.isSuperAdmin)
{
%target = findClientByName(%name);
if(isObject(%target))
{
commandToClient(%target, 'MessageBoxOK', "This is a warning!")
}
}
}
« Last Edit: October 21, 2009, 04:57:39 PM by Dropshock »

      commandToClient(%target, 'MessageBoxOK', "This is a warning!");

      commandToClient(%target, 'MessageBoxOK', "This is a warning!");
Aha, Oh wow.
Thanks, I'll go test it.
e: Alright, it works now. I'll post back if I have any trouble.
« Last Edit: October 21, 2009, 04:28:59 PM by Dropshock »

Double Toast.
Alright, So I've got some more code done.
Here's the code:
Code: [Select]
function serverCmdWarn(%client, %name)
{
if(%client.isSuperAdmin)
{
%target = findClientByName(%name);
if(isObject(%target))
{
commandToClient(%target, 'MessageBoxOK', "This is a warning!", "This is warning number);
$Pref::Server::Warnings[%target.bl_ID]++;
if($Pref::Server::Warnings[%target.bl_ID] = 3)
{
commandtoclient(%client, 'MessageBoxYesNo', "Warnings", "This person has 3 warnings! Would you like to kick them?", 'saidyes');
}
}
}
else
{
messageClient(%client, '', "\c6You must be Super Admin to use this command.");
}
}
function ServerCmdSaidYes(%client)
{

}
What I want to know, Is how would I get %target from function serverCmdWarn to use in function ServerCmdSaidYes?
Also, I dont know if I did messageboxyesno right, or did I?
edit: Oh, I just noticed i havnt finished the
Code: [Select]
commandToClient(%target, 'MessageBoxOK', "This is a warning!", "This is warning number); part of it. I was skipping around, So for that part, How would I include the warnings var in the message?
« Last Edit: October 21, 2009, 04:52:00 PM by Dropshock »

So for that part, How would I include the warnings var in the message?
I believe you could use messageClient(%client,'MessageBoxOK',"This is a warning!\n" @ $Pref::Server::Warnings[%target.bl_id];);
But you would have to increment the $Pref before.

I still need some help, I havnt made any progress on this because I have no idea how to figure this out

Specifics on what you need help on...?
Don't mind this post. I was just not reading, and I do not know how to do it :/
« Last Edit: October 23, 2009, 07:47:14 PM by Placid »

Truce helped me with this, i dont need any more help. But thanks kalphiter.