Advertisement
iFenomenal

Blocare /chat

Mar 19th, 2019
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.63 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. static const
  4.    PLUGIN[] = "/chat",
  5.    VERSION[] = "1.0",
  6.    AUTHOR[] = "scosmyn";
  7.  
  8. new bool:bChat[33] = false
  9.  
  10. public plugin_init() {
  11.    register_plugin(PLUGIN,VERSION,AUTHOR)
  12.  
  13.    register_clcmd("say /chat","cmdChat")
  14.    register_clcmd("say","cmdSay")
  15.    register_clcmd("say_team","cmdSay")
  16. }
  17. public cmdSay(id) {
  18.     if(!bChat[id])
  19.     {
  20.         color(id,"!g[Zombie OutStanding] !teamTasteaza !g/chat !teampentru a putea scrie.")
  21.         return 1
  22.     }
  23.     return 0
  24. }
  25. public cmdChat(id) {
  26.    if(bChat[id])
  27.       return 1
  28.    bChat[id] = true
  29.    color(id,"!g[Zombie OutStanding] !teamChat-ul a fost deblocat cu succes.")
  30.    return 0
  31. }
  32. public client_putinserver(id) {
  33.    bChat[id] = false
  34.    set_task(2.0,"task_exec",id)
  35. }
  36. public task_exec(id) {
  37.    if(is_user_connected(id))
  38.       color(id,"!g[Zombie OutStanding] !teamPentru a debloca chat-ul scrie !g/chat")
  39. }
  40. stock color( const id, const input[ ], any:... )
  41. {
  42.    new count = 1, players[ 32 ]
  43.  
  44.    static msg[ 191 ]
  45.    vformat( msg, 190, input, 3 )
  46.  
  47.    replace_all( msg, 190, "!g", "^4" ) //- verde
  48.    replace_all( msg, 190, "!y", "^1" ) //- galben
  49.    replace_all( msg, 190, "!team", "^3" ) //- echipa
  50.    replace_all( msg, 190, "!n", "^0" ) //- normal
  51.  
  52.    if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
  53.    {
  54.       for( new i = 0; i < count; i++ )
  55.       {
  56.          if( is_user_connected( players[ i ] ) )
  57.          {
  58.             message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
  59.             write_byte( players[ i ] );
  60.             write_string( msg );
  61.             message_end( );
  62.          }
  63.       }
  64.    }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement