Raised This Month: $ Target: $400
 0% 

[HELP] get_user_name probleme


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 12-28-2015 , 21:05   [HELP] get_user_name probleme
Reply With Quote #1

get_user_name(id, iTarget, charsmax(iTarget)); not work the player name is not logged how he must be ?

PHP Code:
public Handle_BlockedGuardMenu(idiKey)
{
    switch(
iKey)
    {
        case 
8: return Show_BlockedGuardMenu(id, ++g_iMenuPosition[id]);
        case 
9: return Show_BlockedGuardMenu(id, --g_iMenuPosition[id]);
        default:
        {
            new 
iTarget g_iMenuPlayers[id][g_iMenuPosition[id] * PLAYERS_PER_PAGE iKey];
            new 
szName[2][32];
            
get_user_name(idszName[0], charsmax(szName[]));
            
get_user_name(idiTargetcharsmax(iTarget));
            if(
IsSetBit(g_iBitUserBlockedGuardiTarget)) ClearBit(g_iBitUserBlockedGuardiTarget);
            else if(
IsSetBit(g_iBitUserConnectedid))
            {
                if(
g_iUserTeam[iTarget] == 2jbe_set_user_team(iTarget1);
                
SetBit(g_iBitUserBlockedGuardiTarget);
                
            }
            
log_to_file(g_szLogFile"Admin '%s' banned '%s' From Guards Team "szName[0], iTarget);
        }
    }
    return 
Show_BlockedGuardMenu(idg_iMenuPosition[id]);

__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-28-2015 , 21:19   Re: [HELP] get_user_name probleme
Reply With Quote #2

get_user_name( id , string , max characters )

You are specifying the user id twice: id, iTarget.

In
get_user_name(id, iTarget, charsmax(iTarget));
Replace iTarget with szName[ 1 ]

Same here: log_to_file(g_szLogFile, "Admin '%s' banned '%s' From Guards Team ", szName[0], iTarget);
iTarget should be szName[ 1 ]
__________________

Last edited by Bugsy; 12-28-2015 at 21:19.
Bugsy is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 12-28-2015 , 21:32   Re: [HELP] get_user_name probleme
Reply With Quote #3

i cant cause i shoud use iTarget and if i replace all iTarget with szName[ 1 ] he going to faild erreur :
szName already defined
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-28-2015 , 21:42   Re: [HELP] get_user_name probleme
Reply With Quote #4

Dont re-define it, do this
PHP Code:
//Change
get_user_name(idiTargetcharsmax(iTarget)); 
//to
get_user_name(idszName[1], charsmax(charsmax(szName[])); 

//Change
log_to_file(g_szLogFile"Admin '%s' banned '%s' From Guards Team "szName[0], iTarget); 
//to
log_to_file(g_szLogFile"Admin '%s' banned '%s' From Guards Team "szName[0], szName]); 
__________________
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-28-2015 , 21:43   Re: [HELP] get_user_name probleme
Reply With Quote #5

You should only be replacing it in the one function, not where it's defined.
__________________
fysiks is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 12-28-2015 , 21:48   Re: [HELP] get_user_name probleme
Reply With Quote #6

Bugsy u didn't understend if i do like you said he will not work cause the log must be : Admin 'name banned 'Player Name' From Guards Team and the player name will be from iTarget id not szName[1]
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-28-2015 , 21:52   Re: [HELP] get_user_name probleme
Reply With Quote #7

Give me an example of what you want the output to be.
__________________
Bugsy is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 12-28-2015 , 22:05   Re: [HELP] get_user_name probleme
Reply With Quote #8

look Itarget = player from menu which is going to be shown and what i want is to make " banned '%s' From Guards Team" show the choosed player name from the menu
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-28-2015 , 22:07   Re: [HELP] get_user_name probleme
Reply With Quote #9

If iTarget is the chosen player id then that is what it will do. Are you trying what I am suggesting or are you assuming it does something else without testing first?
__________________

Last edited by Bugsy; 12-28-2015 at 22:07.
Bugsy is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 12-28-2015 , 22:25   Re: [HELP] get_user_name probleme
Reply With Quote #10

when admin block another player from ct team
L 12/29/2015 - 04:228: Admin 'Killer' banned 'Killer' From Guards Team
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Reply



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 09:32.


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