Author Topic: client.isadmin makes command not work  (Read 584 times)

this was a script i asked pecon to make me (it works fine by the way)

Code: [Select]
function servercmdmadman(%c,%t)
{
{
if(!isobject(%t=findclientbyname(%t).player))return;
%t.cleartools();
%t.mountimage(mmFistsImage,0);
%t.setscale("4 4 4");
}
}

i tried adding my own admin-only part to it and it refuses to work

Code: [Select]
function servercmdmadman(%c,%t,%client)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
if(!isobject(%t=findclientbyname(%t).player))return;
%t.cleartools();
%t.mountimage(mmFistsImage,0);
%t.setscale("4 4 4");
}
}

i looked up any command that uses this and i couldn't find anything that i'm doing wrong.

the code should be this:
Code: [Select]
function servercmdmadman(%client,%t)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
if(!isobject(%t=findclientbyname(%t).player))return;
%t.cleartools();
%t.mountimage(mmFistsImage,0);
%t.setscale("4 4 4");
}
}
note that %client (representing the client) is always the first variable for servercmd's, and also the variable doesn't need to always be called "%client" but that is what it'll always refer to as the first variable

the code should be this:
Code: [Select]
function servercmdmadman(%client,%t)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
if(!isobject(%t=findclientbyname(%t).player))return;
%t.cleartools();
%t.mountimage(mmFistsImage,0);
%t.setscale("4 4 4");
}
}
note that %client (representing the client) is always the first variable for servercmd's, and also the variable doesn't need to always be called "%client" but that is what it'll always refer to as the first variable
neato thanks this worked.