Guest User

Untitled

a guest
May 21st, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. /******************
  2. *
  3. * Start Script
  4. *
  5. ******************/
  6.  
  7. #include <sourcemod>
  8. #include <morecolors>
  9. #include <geoip>
  10.  
  11. #define NAME "Connect Message"
  12. #define PLUGIN_VERSION "1.0"
  13. #define AUTHOR ""
  14. #define DESCRIPTION "Plugin de connexion/déconnexion"
  15.  
  16. public Plugin:myinfo =
  17. {
  18. name = NAME,
  19. description = DESCRIPTION,
  20. author = AUTHOR,
  21. version = PLUGIN_VERSION
  22. };
  23.  
  24. #define Prefix "{white}[Ba_Jail] {blue}:"
  25.  
  26. public OnPluginStart()
  27. {
  28. HookEvent("player_disconnect", OnPlayerDisconnect, EventHookMode_Pre);
  29. }
  30.  
  31. /******************
  32. *
  33. * Connexion
  34. *
  35. ******************/
  36.  
  37.  
  38. public OnClientPutInServer(client)
  39. {
  40. new String:SteamID[64];
  41. new String:ip[32];
  42. new String:Pays[46];
  43.  
  44. GetClientAuthString(client, SteamID, sizeof(SteamID));
  45. GetClientIP(client, ip, 19);
  46. GeoipCountry(ip, Pays, sizeof(Pays));
  47.  
  48. if(ADMIN(client))
  49. {
  50. CPrintToChatAll("%s {gold}%N {blue}vient de se {green}connecter{blue}. {orangered}[%s] {aqua}(%s)", Prefix, client, SteamID, Pays);
  51. CPrintToChatAll("%s {red}Freekilleurs / freekillers gares à vos fesses un Admin vient de se connecter.", Prefix, client, SteamID, Pays);
  52. CPrintToChat(client, "%s Vous venez de vous connecter au serveur {white}Ba_Jail{blue}.", Prefix);
  53. }
  54. if(STAFF(client))
  55. {
  56. CPrintToChatAll("%s {gold}%N {blue}vient de se {green}connecter{blue}. {orangered}[%s] {aqua}(%s)", Prefix, client, SteamID, Pays);
  57. CPrintToChatAll("%s {red}Mettez-vous tous à genoux un dieu de la team vient de se connecter.", Prefix, client, SteamID, Pays);
  58. CPrintToChat(client, "%s Vous venez de vous connecter au serveur {white}Ba_Jail{blue}.", Prefix);
  59. }
  60. if(VIP(client))
  61. {
  62. CPrintToChatAll("%s {gold}%N {blue}vient de se {green}connecter{blue}. {orangered}[%s] {aqua}(%s)", Prefix, client, SteamID, Pays);
  63. CPrintToChatAll("%s {red}Preparez-vous un PGM arrive dans la game.", Prefix, client, SteamID, Pays);
  64. CPrintToChat(client, "%s Vous venez de vous connecter au serveur {white}Ba_Jail{blue}.", Prefix);
  65. }
  66. else
  67. {
  68. CPrintToChatAll("%s {gold}%N {blue}vient de se {green}connecter{blue}. {orangered}[%s] {aqua}(%s)", Prefix, client, SteamID, Pays);
  69. CPrintToChat(client, "%s Vous venez de vous connecter au serveur {white}Ba_Jail{blue}.", Prefix);
  70. }
  71. }
  72.  
  73. /******************
  74. *
  75. * Déconnexion
  76. *
  77. ******************/
  78.  
  79. public Action:OnPlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast)
  80. {
  81. if (!dontBroadcast)
  82. {
  83. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  84.  
  85. new String:SteamID[64];
  86. new String:ip[32];
  87. new String:Pays[46];
  88.  
  89. GetClientAuthString(client, SteamID, sizeof(SteamID));
  90. GetClientIP(client, ip, 19);
  91. GeoipCountry(ip, Pays, sizeof(Pays));
  92.  
  93. if(ADMIN(client))
  94. {
  95. CPrintToChatAll("%s {red}Freekilleurs / freekillers gares à vos fesses un Admin vient de se déconnecter.", Prefix, client, SteamID, Pays);
  96. }
  97. if(STAFF(client))
  98. {
  99. CPrintToChatAll("%s {red}Mettez-vous tous à genoux un dieu de la team vient de se déconnecter.", Prefix, client, SteamID, Pays);
  100. }
  101. if(VIP(client))
  102. {
  103. CPrintToChatAll("%s {red}Un PGM quitte la game.", Prefix, client, SteamID, Pays);
  104. }
  105. else
  106. {
  107. CPrintToChatAll("%s %N vient de se déconnecter.", Prefix, client, SteamID, Pays);
  108. }
  109. }
  110.  
  111. return Plugin_Continue;
  112. }
  113.  
  114. public STAFF(client)
  115. {
  116. if (GetUserFlagBits(client) & ADMFLAG_ROOT) return true;
  117. else return false;
  118. }
  119.  
  120. public ADMIN(client)
  121. {
  122. if (GetUserFlagBits(client) & ADMFLAG_BAN) return true;
  123. else return false;
  124. }
  125.  
  126. public VIP(client)
  127. {
  128. if (GetUserFlagBits(client) & ADMFLAG_CUSTOM4) return true;
  129. else return false;
  130. }
  131.  
  132. /******************
  133. *
  134. * End Script
  135. *
  136. ******************/
Add Comment
Please, Sign In to add comment