Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- static const
- PLUGIN[] = "/chat",
- VERSION[] = "1.0",
- AUTHOR[] = "scosmyn";
- new bool:bChat[33] = false
- public plugin_init() {
- register_plugin(PLUGIN,VERSION,AUTHOR)
- register_clcmd("say /chat","cmdChat")
- register_clcmd("say","cmdSay")
- register_clcmd("say_team","cmdSay")
- }
- public cmdSay(id) {
- if(!bChat[id])
- {
- color(id,"!g[Zombie OutStanding] !teamTasteaza !g/chat !teampentru a putea scrie.")
- return 1
- }
- return 0
- }
- public cmdChat(id) {
- if(bChat[id])
- return 1
- bChat[id] = true
- color(id,"!g[Zombie OutStanding] !teamChat-ul a fost deblocat cu succes.")
- return 0
- }
- public client_putinserver(id) {
- bChat[id] = false
- set_task(2.0,"task_exec",id)
- }
- public task_exec(id) {
- if(is_user_connected(id))
- color(id,"!g[Zombie OutStanding] !teamPentru a debloca chat-ul scrie !g/chat")
- }
- stock color( const id, const input[ ], any:... )
- {
- new count = 1, players[ 32 ]
- static msg[ 191 ]
- vformat( msg, 190, input, 3 )
- replace_all( msg, 190, "!g", "^4" ) //- verde
- replace_all( msg, 190, "!y", "^1" ) //- galben
- replace_all( msg, 190, "!team", "^3" ) //- echipa
- replace_all( msg, 190, "!n", "^0" ) //- normal
- 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( );
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement