So I have an issue and I found why it happens but Im not sure how do I fix it.
With the code below I can give someone the flag U so he can use the blockmaker on my server and when I write amx_who his flags are U and Z. It works.. but whenever somebody joins the server who has got no flags except Z (which is the default player flag as you know) the U flag I have given to the player disappears and then when I write amx_who again - he has only Z flag left. My question is: Do I have to remove the Z flag from the player first and then give him U flag, so when anybody joins the server it wont think that the player I gave the U flag is just a default player and his U flag will remain or is there another way I can fix this?
PHP Code:
GiveBlockMakerAccess(id) {
if ( ! ( get_user_flags(id) & BM_ADMIN_LEVEL2 ) )
return;
new player, body;
get_user_aiming(id, player, body);
if ( ! player || ! is_user_connected(player) )
return;
new szPlayerName[32];
get_user_name(player, szPlayerName, charsmax(szPlayerName));
new tempFlags = get_user_flags(player);
if ( tempFlags & BM_ADMIN_LEVEL) {
client_print(id, print_chat, "%s %s has got BlockMaker access already.", gszPrefix, szPlayerName);
return;
}
set_user_flags(player, read_flags("u"));
client_print(player, print_chat, "%s You now have BlockMaker access. Enjoy!", gszPrefix);
client_print(id, print_chat, "%s %s has BlockMaker access now.", gszPrefix, szPlayerName);
}
Thanks in advance!