How to create a function for certain player names + UID.

MrKnight

Member
I am trying to create something to avoid admin abuse.
The best thing I think is to create a function for only the admins using their admin names, and to avoid players using the admins name to get admin tools, it should be the admin name + UID to enable admin tools.

Does anyone know which variable I can use to checkt the player name?

Thanks.
 
By default admin tools check the UID to enable the tools.

To get the player name you would use
name player;
 
Yup, I know the admin toools check the UID by default, but I want it to check both Player UID AND Player Name, got it?
So the varaible to check a player name is 'name player'? I could use it like this?
Code:
if ((name player) == "") then {
    //enable admintools;
}
 
Yes or you could do something like
Code:
adminNames = ["Name1", "Name2"];
 
if ((name player) in adminNames) then {
    _isAdminName = true;
} else {
    _isAdminName = false;
};

Then you can easily add it to your tools
Code:
if ((getPlayerUID player) in AdminList && _isAdminName) then {
They are admins with the right name
};
 
I'll try and post feedback.

I really appreciate your help.
Thanks.

@Edit -

Didn't work at first, kept making changes and finally worked.
Thanks.
 
Back
Top