Author Topic: serverCmd help[Solved]  (Read 1946 times)

Quote
So I'm not in any way experienced with arrays, and I was wondering if what I am attempting is even possible, and if not what would be a solution.

Current:
Code: [Select]
$Array::Check = true;
function gameConnection::autoAdminCheck(%client)
{
if(%client.BL_ID == $Array::Check[%client.BL_ID])
{
messageClient(%client,'',"Work");
}
parent::autoAdminCheck(%client);
}

function gameConnection::onClientLeaveGame(%client)
{
$Array::Check[%client.BL_ID] = true;
        parent::onClientLeaveGame(%client);
}

It's supposed to when a person leaves set the variable ending to the clients BLID and then when they join check if it is there, and say Work if the variable does have the clients ending and if it doesn't it won't do anything.

I'm trying to do this to get around saving it to a txt document
^SOLVED^

I have a question, but didn't want to make a new topic so I decided to just throw it in this one.

I need help with a servercmd that includes all the rest of the input

Like
servercmdTalk(%client, %input)

And I type /talk hey there
Right now it will set %input as "hey"
I want it to be "hey there"
How would I go about doing this without including 100 arguments in the function?
« Last Edit: October 06, 2012, 03:07:21 PM by ¥ola »

You'd want to change the condition in autoAdminCheck to if($Array::Check[%client.bl_id]) and put the functions in a package
but other than that it looks fine.
« Last Edit: October 06, 2012, 01:10:52 PM by Headcrab Zombie »

You say you want to putnthe variables in a text file?

Try export("$variablePrefix*", "path/to/file.txt");

Where $variablePrefix is something like in the following:

$aa
$ab
$ac
$ad
Export("$a*", ...

Exports all variables above (aa,ab,ac, etc)

You say you want to putnthe variables in a text file?

Try export("$variablePrefix*", "path/to/file.txt");

Where $variablePrefix is something like in the following:

$aa
$ab
$ac
$ad
Export("$a*", ...

Exports all variables above (aa,ab,ac, etc)
Oh haha, no I was attempting to use this to get around having to export the clients status to a txt file, but thank you for the information!

You'd want to change the condition in autoAdminCheck to if($Array::Check[%client.bl_id]) and put the functions in a package
but other than that it looks fine.

This worked, thank you very much!


New question
afaik you cannot
It might be worth looking into that one mod M did where if you put stuff in quotes it will become a single argument

Servercmd arguments are automatically parsed by spaces, so each argument is 1 word. If you use lots of arguments (5 should be the most you have to use) and just string em all together with spaces I between, then do a trim on it, it will work just like you want it to.

Servercmd arguments are automatically parsed by spaces, so each argument is 1 word. If you use lots of arguments (5 should be the most you have to use) and just string em all together with spaces I between, then do a trim on it, it will work just like you want it to.

Well.
That really sucks :/

Well.
That really sucks :/
Why does it suck?
Code: [Select]
function servercmdblah(%cl,%a,%b,%c,%d,%e)
{
    %abcde = trim(%a SPC %b SPC %c SPC %d SPC %e);

Why does it suck?
Code: [Select]
function servercmdblah(%cl,%a,%b,%c,%d,%e)
{
    %abcde = trim(%a SPC %b SPC %c SPC %d SPC %e);

The matter of really long messages and such.

Such as if you want to create a message using a serveCmd, it would be really hard.

Why does it suck?
Code: [Select]
function servercmdblah(%cl,%a,%b,%c,%d,%e)
{
    %abcde = trim(%a SPC %b SPC %c SPC %d SPC %e);
this is exactly the method I mentioned, use this general template.

The matter of really long messages and such.

Such as if you want to create a message using a serveCmd, it would be really hard.
This is why adminchat only accepts 16 words. That's the max argument count for a function.

Well, is there any default message box in which a user can input information, as VB.net's inputBox

That would work fine, assuming it exists, because creating my own then means a client to the mod which I don't want to do.

Well, is there any default message box in which a user can input information, as VB.net's inputBox

That would work fine, assuming it exists, because creating my own then means a client to the mod which I don't want to do.
The admin password one
But I do believe you can't open it with commandtoclient('whatever');

Well, is there any default message box in which a user can input information, as VB.net's inputBox

That would work fine, assuming it exists, because creating my own then means a client to the mod which I don't want to do.
you can package servercmdmessagesent if you're willing to not use / commands.

you can package servercmdmessagesent if you're willing to not use / commands.
He asked for a box where the user puts stuff in and clicks send