Author Topic: Admin Applications [Script]  (Read 24484 times)


You cant read.
I can't read either, what's the command. I've ctrl-f'd several times and cannot find it.

I'm assuming it's the keybind.
« Last Edit: October 02, 2014, 11:33:15 AM by Blake1 »

What's the command to apply?
Did you setup a key-bind for the Admin App GUI in Options? You have to use that key-bind to open the Form GUI for applying (or Application Review GUI if you're the host).

Did you setup a key-bind for the Admin App GUI in Options? You have to use that key-bind to open the Form GUI for applying (or Application Review GUI if you're the host).
How do players that don't have the add-on apply?

They'll have to download it for themselves; there's no easy way around that. But, players are notified to download the add-on once they join the server, or if they ask for admin.

Use a hidden GUI element with "enter" as the accelerator to replace newline breaks with <br> instead. (?)

Just use the "command" field on the textbox.

Why not make an invisible button with enter as an accelerator that inserts <br> into the app? With the sinkAllKeyEvents thing?
  • Use a hidden GUI element with "enter" as the accelerator to replace newline breaks with <br> instead. (?)
This actually won't work because the only accelerator that works when a GUITextEditCtrl is active, is the escape key. sinkAllKeyEvents has no effect on this.

Also, instead of doing this:
Code: [Select]
%specChar = ".,:;-_+`\"'?*=><[]{}()%^~@#$%\\/|";

for(%c=0; %c<strLen(%text); %c++)
{
%replace = false;

for(%d=0; %d<strLen(%specChar); %d++)
{
if(getSubStr(%text,%c,1) $= getSubStr(%specChar,%d,1))
%replace = true;
}
if(%replace)
%tempText = %tempText @ " ";
else
%tempText = %tempText @ getSubStr(%text,%c,1);
}

You can just do:
Code: [Select]
%tempText = stripChars(%text, ".,:;-_+`\"'?*=><[]{}()%^~@#$%\\/|");
« Last Edit: October 02, 2014, 06:21:31 PM by jes00 »

So is the issue with newlines that they will be broken off when processed on the server side? Because it seems like you could just use strReplace(%string, "\n", "<br>"); on the server side after it is submitted.

Or if that doesn't work for some reason, you could iterate through the string like this


%lines = getLineCount(%string);
for(%i = 0; %i < %lines; %i++)
{
   %newString = %newString @ "<br>" @ getLine(%string, %i);
}
« Last Edit: October 02, 2014, 06:39:36 PM by Pecon »

Just use the "command" field on the textbox.
I don't think the command field works for some reason; both jes00 and myself I tried it.


This actually won't work because the only accelerator that works when a GUITextEditCtrl is active, is the escape key. sinkAllKeyEvents has no effect on this.
. . .
You can just do:
Code: [Select]
%tempText = stripChars(%text, ".,:;-_+`\"'?*=><[]{}()%^~@#$%\\/|");
Thanks for the stripChars function; let's include that for the next version. I also still not sure what to do with the newline issue; the best option would be to somehow replace line breaks before sending the app to the host.


So is the issue with newlines that they will be broken off when processed on the server side? Because it seems like you could just use strReplace(%string, "\n", "<br>"); on the server side after it is submitted.

Or if that doesn't work for some reason, you could iterate through the string like this


%lines = getLineCount(%string);
for(%i = 0; %i < %lines; %i++)
{
   %newString = %newString @ "<br>" @ getLine(%string, %i);
}

Yeah, when reading the files, new line breaks are saved as a certain ascii character, so it's treated just like the other line breaks in the file. The only solution I think would be to replace the character before sending the file to the host. I did try finding / replacing "\n", "<br>" and other strings, but nothing worked. I don't think searching for "<br>" would work anyway though because it has to be explicitly typed in.

I do know Torque has getASCIIString(%string), but I'm not that familiar with the function.

After a little bit of research, I've deduced that the application gets messed up when you put in new lines because of your bad method of parsing the file. I'll fix this in version two.

After a little bit of research, I've deduced that the application gets messed up when you put in new lines because of your bad method of parsing the file. I'll fix this in version two.
If a newline character get's saved in the file, then a newline character will be read and understood. What other parsing options are there? Please show me what you're talking about.

I did come up with my own solution btw; it's not as hard to fix as I thought. Instead of trying to filter out newline characters, I'll take them into accout and create a new text string independent of line breaks, and then check for the next category before creating another. It's very easy to setup. Perhaps that's what you were referring to?
« Last Edit: October 05, 2014, 03:40:17 PM by [GSF]Ghost »

I did come up with my own solution btw; it's not as hard to fix as I thought. Instead of trying to filter out newline characters, I'll take them into accout and create a new text string independent of line breaks, and then check for the next category before creating another. It's very easy to setup. Perhaps that's what you were referring to?
Yep.

make it so that players can request admin applications to any of the admins from either mod to SA
if the admin declines he gets no app
please add this
(will be in f2 menu)



Must be because:
Error creating font [Calibri (16)] -- it doesn't exist on this machine.
Error creating font [Calibri (16)] -- it doesn't exist on this machine.
Error creating font [Calibri (16)] -- it doesn't exist on this machine.
Error creating font [Calibri (16)] -- it doesn't exist on this machine.
Error creating font [Calibri (20)] -- it doesn't exist on this machine.
Error creating font [calibri (20)] -- it doesn't exist on this machine.



Also, suggestions for more options to be added in anyone?
« Last Edit: October 06, 2014, 07:42:01 AM by jes00 »

make it so that players can request admin applications to any of the admins from either mod to SA
if the admin declines he gets no app
please add this
(will be in f2 menu)
I'd rather have this as an option

You could make it have a different level of minimal power required (ex: admin and above)