Raised This Month: $ Target: $400
 0% 

Giving a player flags, somebody joins = flags are removed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xTr3m3r
Member
Join Date: Feb 2010
Old 02-20-2017 , 13:43   Giving a player flags, somebody joins = flags are removed
Reply With Quote #1

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 
playerbody;
    
get_user_aiming(idplayerbody);

    if ( ! 
player || ! is_user_connected(player) )
        return;

    new 
szPlayerName[32];
    
get_user_name(playerszPlayerNamecharsmax(szPlayerName));

    new 
tempFlags get_user_flags(player);

    if ( 
tempFlags BM_ADMIN_LEVEL) {
        
client_print(idprint_chat"%s %s has got BlockMaker access already."gszPrefixszPlayerName);
        return;
    }

    
set_user_flags(playerread_flags("u"));

    
client_print(playerprint_chat"%s You now have BlockMaker access. Enjoy!"gszPrefix);
    
client_print(idprint_chat"%s %s has BlockMaker access now."gszPrefixszPlayerName);

Thanks in advance!
xTr3m3r is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode