Advertisement
ISRaiyaN

Connect Server + Sound - New

Feb 20th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.80 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <colorchat>
  3. #include <geoip>
  4.  
  5. new SoundConnect[] = "buttons/bell1.wav"
  6. new SoundDisconnect[] = "fvox/blip.wav"
  7.  
  8. new Prefix[] = "AMXX"
  9.  
  10. public plugin_init()
  11. {
  12.     register_plugin("Connect Server", "2.0", "ISRaiyaN");
  13. }
  14. public plugin_precache()
  15. {
  16.     precache_sound( SoundConnect )
  17.     precache_sound( SoundDisconnect )
  18. }
  19. public client_putinserver( client )
  20. {
  21.     ColorChat(0, RED, "^4[ ^3%s ^4] ^3%s ^1Has Connected ^4[ ^1SteamID: ^3%s ^4| ^1Country: ^3%s ^4]", Prefix, GetUserName(client), GetUserID(client), GetUserCountry(client));
  22.     client_cmd(0, "spk ^"%s^"", SoundConnect )
  23. }
  24. public client_disconnect( client )
  25. {
  26.     ColorChat(0, RED, "^4[ ^3%s ^4] ^3%s ^1Has Disconnected ^4[ ^1SteamID: ^3%s ^4| ^1Country: ^3%s ^4]", Prefix, GetUserName(client), GetUserID(client), GetUserCountry(client));
  27.     client_cmd(0, "spk ^"%s^"", SoundDisconnect )
  28. }
  29. stock GetUserName(client)
  30. {
  31.     new Name[ 32 ];
  32.     get_user_name( client,Name, charsmax( Name ) );
  33.    
  34.     return Name;
  35. }
  36.  
  37. stock GetUserID(client)
  38. {
  39.     new szAuthID[ 32 ]
  40.     get_user_authid( client, szAuthID, charsmax( szAuthID ) );
  41.    
  42.     return szAuthID;
  43. }
  44. stock GetUserCountry(client)
  45. {
  46.     new szCountry[ 35 ]
  47.     new IP[ 35 ]
  48.    
  49.     get_user_ip( client, IP, charsmax( IP ) )
  50.    
  51.     geoip_country( IP, szCountry, sizeof( szCountry ) )
  52.  
  53.     return szCountry;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement