Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

/*

*
* The Plugin is Made by N.O.V.A , It is a Private and Paid Job !!
*
* Contacts:-
*
* Fb:- facebook.com/nova.gaming.cs
* Insta :- instagram.com/_n_o_v_a_g_a_m_i_n_g
* Discord :- N.O.V.A#1790
* Youtube :- NOVA GAMING
*
*
*/

/*----------------------------------*/
/* INCLUDES */
/*----------------------------------*/

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

/*----------------------------------*/
/* ANTI-DECOMPILE */
/*----------------------------------*/

#pragma compress 1
#pragma semicolon 1

/*----------------------------------*/
/* NEWS */
/*----------------------------------*/

new g_flag;

public plugin_init( )
{
register_plugin( "[NV] Random Player", "03/11/2020", "N.O.V.A" );
g_flag = register_cvar("nv_grp_access_flag","f");
register_clcmd( "say /random", "CmdSay" );

public CmdSay(id)
{
if(get_user_flags(id) & read_pcvar_flags(g_flag))
{
new Name[33],player;
player = getRandPlayer();

if(is_user_connected(player) && is_user_alive(player))


{
get_user_name(player,Name,charsmax(Name));
ColorChat( 0, RED, "^3[^4N:V^3]^4 Random Player Name is:^3 %s",
Name )ColorChat( 0, RED, "^3[^4N:V^3]^4 Random Player Name is:^3 %s", Name )
}
}
}

stock read_pcvar_flags(const pcvar)


{
new flags[27];
get_pcvar_string(pcvar, flags, charsmax(flags));
return read_flags(flags);
}

getRandPlayer()
{
new players[ 32 ], player, num, pList[ 33 ], count;
get_players( players, num, "a" );
for( new i ; i < num ; i ++ )
{
player = players[ i ];

pList[ count ] = player;


count ++;
}

return pList[ random( count ) ];


}

stock Nv_Chat(const id, const input[], any:...)


{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!g", "^4"); // Green Color


replace_all(msg, 190, "!y", "^1"); // Default Color
replace_all(msg, 190, "!team", "^3"); // Team Color
replace_all(msg, 190, "!team2", "^0"); // Team2 Color

if (id) players[0] = id; else get_players(players, count, "ch");


{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE,
get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\
pard\\ lang2057\\ f0\\ fs16 \n\\ par }
*/

You might also like