Help: I need to convert this C Function to C#..

csharp Venezuela
  • 11 years ago

    Please If anybody can help me..  :)

    http://cvs.amxmod.net/viewcvs.cgi/amx/plugins/adminchat.sma?rev=1.1&view=markup

    public cmdSayChat(id) {

      if (!(get_user_flags(id)&ADMIN_CHAT)) return PLUGIN_CONTINUE

      new saidDevil [6], i=0 

      read_argv(1,said,5)

      while (said[i]=='@')

        i++

      if ( !i || i > 3 ) return PLUGIN_CONTINUE

      new message[192], a = 0

      read_argv(1,message,191)

      switch(said[i]){

        case 'r': a = 1

        case 'g': a = 2

        case 'b': a = 3

        case 'y': a = 4

        case 'm': a = 5

        case 'c': a = 6

      }

      new name[32], authid[32], userid

      get_user_authid(id,authid,31)

      get_user_name(id,name,31)

      userid = get_user_userid(id)

      log_to_file(g_logFile,"Chat: ^"%s<%d><%s><>^" tsay ^"%s^"",name,userid,authid,message[i+1])

      log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%s^")",

        name,userid,authid,message[ i+1 ],g_ColorsAngel [A])

      if (++g_msgChannel>6||g_msgChannel<3)

        g_msgChannel = 3

      new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0

      set_hudmessage(g_ValuesAngel [A][0], g_ValuesAngel [A][1], g_ValuesAngel [A][2],

        g_Pos[i][0], verpos , 0, 6.0, 6.0, 0.5, 0.15, g_msgChannel ) 

     

    #if defined SHOW_NAMES   

      show_hudmessage(0,"%s :  %s",name,message[i+1]) 

      client_print(0,print_notify,"%s :  %s",name,message[i+1])

    #else

      show_hudmessage(0,message[i+1]) 

      client_print(0,print_notify,message[i+1])

    #endif

     

      return PLUGIN_HANDLED

    }





Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An idiot with a computer is a faster, better idiot” - Rich Julius