Author Topic: Targetting player with servercmd?  (Read 2289 times)


Also it would be good practice to put admin checks on the person calling the serverCmd

so y'know it doesn't get abused

If you don't know how to do that setro, it's literally an easy if statement.
Code: [Select]
if(%client.isAdmin) // Yet again %client is a variable, %client is checking if the client is super admin, it can be %target if you wish to check if the target is admin. %client.isSuperAdmin also works
{
    //codehere
}
else
{
    return; //Cancels whatever this is in, so it doesn't continue and forget everyone in the star fish
}
Also, if it's only one line after an if statement you don't need braces (Can't remember if this is correct or not, I remember doing it once before though)

If you don't know how to do that setro, it's literally an easy if statement.
Code: [Select]
if(%client.isAdmin) // Yet again %client is a variable, %client is checking if the client is super admin, it can be %target if you wish to check if the target is admin. %client.isSuperAdmin also works
{
    //codehere
}
else
{
    return; //Cancels whatever this is in, so it doesn't continue and forget everyone in the star fish
}
Also, if it's only one line after an if statement you don't need braces (Can't remember if this is correct or not, I remember doing it once before though)
For one your comment after the if statement is lying, and for two it seems more people go with something like this for admin checks
Code: [Select]
if(!%client.isAdmin)
    return;
//continue code

it seems more people go with something like this for admin checks
Code: [Select]
yes please