well, its a start, but there some problems.
first: all "serverCmd" functions have the first argument as %client
so yours needs to say: function ServerCmdkillnonadmin(%client)
- 'Function' needs to be lowercased: 'function'
- no semicolon ; at the end of a function
Now that you have the serverCmd following the correct pattern, your assign a value to variable %client inside your function. While torque doesnt care if you do this, other languages will, and since you said your just learning, its a good idea to start learning good ways of coding.
So with that - you need to change: %client = clientGroup.getObject(%i);
to use something other than %client. try: %obj or %cl or something.
next thing I see is this line:
if(%client.isAdmin || %C.isSuperAdmin || %c.isHost)
%client has a value (but we are changing the variable name)
%C has no value
%c also has no value
again with the "best practice" %c and %C are the same as far as torque is concerned, but not all languages are that way, so keep things consistent, and use %C and %C or %c and %c
what I think you meant was this:
if(%client.isAdmin || %client.isSuperAdmin || %client.isHost)
-- which will change when you rename %client to something else
Next is this line:
messageboxOK("There they go..."; "You were just saved by your administrative powers, congrats on still being here");
Torque will give you a syntax error on this. Do some searching on the forums to find an example to see how its used.
Lastly
%player = %client.player;
%player.kill();
can be changed to:
%client.player.kill();
does the same thing with less script.
Good stuff:
unlike a lot of posters, all your {} match, and your gramamar skills are working well.