Raised This Month: $51 Target: $400
 12% 

multilang message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mankled
Senior Member
Join Date: Oct 2019
Old 10-14-2019 , 23:53   Re: multilang message
Reply With Quote #11

Quote:
Originally Posted by fysiks View Post
Perhaps you should read a little bit more closely, you did exactly what you can't do: You can't use LANG_PLAYER with format() or formatex(). You can only use it with client_print() (there might be some others but they have to print directly to the player).

So, in your case,
iceeedr's code didn't work.


how can i print direcly to the players, the code is making a loop where i want to put ML
entire plugin:
PHP Code:
#include <amxmodx>

#define    PLUGIN    "Connect Announce"
#define    VERSION    "0.2"
#define    AUTHOR    "v3x"

new g_iMsgSayTextg_szSoundFile[] = "buttons/blip1.wav";

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_dictionary("connect_annouce.txt")
    
g_iMsgSayText get_user_msgid("SayText");
}

public 
plugin_precache()
{
    
precache_sound(g_szSoundFile);
}

public 
client_authorized(id)
{
    if(
is_user_bot(id)) return PLUGIN_CONTINUE;

    new 
szUserName[33];
    
get_user_name(idszUserName32);

    new 
szAuthID[33];
    
get_user_ip(id szAuthID 32);
    
    new 
iPlayers[32], iNumi;
    
get_players(iPlayersiNum);

    for(
0iNumi++)
    {
        new 
iPlayers[i];

        if(!
is_user_connected(x) || is_user_bot(x)) continue;

        
client_cmd(x"spk %s"g_szSoundFile);

        new 
szMessage[164];
        
format(szMessage163"^x04%s (^x01%s^x04) Connected!!!"szUserName szAuthID);

        
message_beginMSG_ONEg_iMsgSayText, {0,0,0}, );
        
write_byte  );
        
write_stringszMessage );
        
message_end ();
    }

    return 
PLUGIN_CONTINUE;

line where i want to put ML
PHP Code:
format(szMessage163"^x04%s (^x01%s^x04) Connected!!!"szUserName szAuthID); 

@EDIT
maybe i can put ML like this. Does it look a good code ?
PHP Code:
client_printcolor(0,"!g%s (!y%s!g) %L"szUserName szAuthIDLANG_PLAYER"ANNOUNCE"); 

Last edited by Mankled; 10-15-2019 at 00:16.
Mankled 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 11:50.


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