First, I read it "Need some genital help with coding"
Then, I saw your problem.
function serverCmdStun (%client, %target)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
echo(" @ %client.getPlayerName() @ " has used the stun command.");
if(isObject(findclientbyname(%target).player))
{
messageAll('',findclientbyname(%target).getPlayerName() @" was the victim of " @ %client.getPlayerName() @ "'s stun!");
findclientbyname(%target).player.tumble();
findclientbyname(%target).player.setWhiteOut(1);
}
}
}
You have to put all the variables you want to define using the / at the top part where you declare the function, like I did.
The exception to this is when you do something like
%randomPlayer = clientGroup.getObject(getRandom(0,clientGroup.getCount()-1));
Or something that won't be defined using /
Any questions?
Also: If someone is super admin their "admin" variable should also be one, so it really doesn't matter unless you use a terrible mod to admin people (RTB and IGSO are fine) and it only sets their super admin variable.
EDIT: use gameConnection::getPlayerName() instead of gameConnection.name to get their name. %client.name will work, but %client.getPlayerName() will work better.