function serverCmdKillAll(%client)
{
// Host check
if(getNumKey() == %client.bl_id)
{
// Cycle throguh clent objects.
for(%a = 0; %a < ClientGroup.getCount(); %a++)
{
// Get the player object from that clientgroup object.
%player = ClientGroup.getObject(%a).player;
// Check if it exists.
if(isObject(%player))
{
// Kill it.
%player.kill();
}
}
// Message everyone about the abuse of powers.
messageAll('', "\c3" @ %client.name @ "\c2 slayed everyone.");
}
}
When a client communicates with the server, it can call special functions called "server commands". It does this through this command:
commandToServer('Function_Name', %arguments, %arguments2, %arguments3);Slash commands are read as this:
/function_name %arg1 %arg2 %arg3Saying "/kill Iban" transmutes to this:
commandToServer('kill', "Iban");Which is understood by the server as:
function serverCmdKill(%client, %name)Further Reading