View Single Post
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 06-28-2020 , 12:47   Re: show rank on connection
Reply With Quote #2

Code:
#include <amxmodx> #include <csstats> #define PLUGIN   "Connect Announce" #define VERSION  "0.2" #define AUTHOR   "v3x" new g_iMsgSayText, g_szSoundFile[] = "buttons/blip1.wav"; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     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(id, szUserName, 32);     new szAuthID[33];     get_user_authid(id , szAuthID , 32);     new iPlayers[32], iNum, i;     get_players(iPlayers, iNum);     for(i = 0; i <= iNum; i++)     {         new x = iPlayers[i];         if(!is_user_connected(x) || is_user_bot(x)) continue;         client_cmd(x, "spk %s", g_szSoundFile);                 new szRank;         new szStats[8];         new szBody[8];                 szRank = get_user_stats(id, szStats, szBody);         new szMessage[164];         format(szMessage, 163, "^x04%s ^x01Rank^x04:^x04[^x01%d^x04] (^x01%s^x04) connected", szUserName , szRank, szAuthID);         message_begin( MSG_ONE, g_iMsgSayText, {0,0,0}, x );         write_byte  ( x );         write_string( szMessage );         message_end ();     }     return PLUGIN_CONTINUE; }

Last edited by alferd; 06-28-2020 at 14:34.
alferd is offline