i am working on a piece of code that i used from some other coder. the only thing i want to strip here is that everybody can execute this instead of only the admin.
how can i strip the admin check so it will run even if user is not admin
PHP Code:
if (!client) return;
new admindata = GetUserFlagBits(client);
SetUserFlagBits(client, ADMFLAG_ROOT);
new flags = GetCommandFlags(command);
SetCommandFlags(command, flags & ~FCVAR_CHEAT);
FakeClientCommand(client, "%s %s", command, arguments);
SetCommandFlags(command, flags);
SetUserFlagBits(client, admindata);
if i understand it correct it will set the current flags of the user aside , than give the user root flag and execute the command that was inserted in this function. Then it will restore the old flags.
But the strange thing is that normal users ( non admin ) keep getting the error you do not have acces to this command.