Command that kicks people out of Minigames

Author Topic: Command that kicks people out of Minigames  (Read 2124 times)

Is there a command that will kick people out of a minigame with a simple command or a votekick?
Please help.

How to figure this out yourself:
1. Launch two Blocklands
2. On one, make a server
3. On the other, join that server.
4. On the Blockland running the server, make a minigame
5. On the other Blockland, join that minigame
6. On the server, open the console, type trace(1);
7. Kick the other client from the minigame through the UI, as you normally would
8. Type trace(0); in the console
9. You can now see any function that have been called between trace calls. In here will be any clientside functions called when you click the gui button, and since you're also running the server on that same game, the serverCmd called when the server recieves the request


Since I don't know the appropriate serverCmd name of the top of my head, this is the exact steps I would follow to find it. Might as well teach you so you can be self-sufficient

NewPlayerListGui.clickMiniGameRemove(); Is the client side of what's called when clicking the button and the server command is serverCmdRemoveFromMinigame (at least Slayer says so) I have no idea what the arguments are however.

Well, thanks for spoonfeeding answers and depriving people of opportunities to learn for themselves

Thanks :)
I'll try both methods
Though I probably should learn this stuff for myself

Though I probably should learn this stuff for myself
Yeah that's what I was trying to do before thorfin just came in and gave you the answer

findClientByName(name).minigame.removeMember(findClientByName(name));

Removes the person found by name from the minigame they are in. If you want to know what any of this does:

findClientByName(name) - Find's the client by their net name (in that case, what does their name show on the player list?).
%client.minigame - This is a variable, but this is also their minigame. This variable is a ScriptObject defined as MinigameSO class method.
%minigame.removeMember(clientObject) - This is a ScriptObject function for minigames. Removes any client from the minigame if they have one.

You can also do:
getMinigameFromObject(findClientByName(name)).removeMember(findClientByName(name));
« Last Edit: August 29, 2014, 03:05:56 PM by Advanced Bot »

You can also shorten up Advanced Bots method like this.
(%client=findClientByName(Name)).minigame.removeMember(%client);
Defining client right here.

You can also shorten up Advanced Bots method like this.
(%client=findClientByName(Name)).minigame.removeMember(%client);
Defining client right here.
oh cool i didn't even know you could define an object like that

oh cool i didn't even know you could define an object like that
You can define variables wherever you like.

Code: [Select]
for(%i = 0; %i < clientGroup.getCount() && %client = clientGroup.getObject(%i); %i++)
    %client.minigame.removeMember(%client);

Code: [Select]
if(isObject(%client = findClientByName(%name)) && isObject(%mg = %client.minigame))
    %mg.removeMember(%client);

etc..
« Last Edit: August 30, 2014, 10:05:34 PM by $trinick »