Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #include <sourcemod>
  2.  
  3. static b_ShowClientAd[MAXPLAYERS+1];
  4.  
  5. public void OnPluginStart()
  6. {
  7. RegConsoleCmd("jointeam", OnJoinTeam);
  8. }
  9.  
  10. public void OnClientConnected(int client)
  11. {
  12. b_ShowClientAd[client] = true;
  13. }
  14.  
  15. public Action OnJoinTeam(int client, int args)
  16. {
  17. if (!b_ShowClientAd[client])
  18. return Plugin_Continue;
  19.  
  20. b_ShowClientAd[client] = false;
  21.  
  22. char url[1024];
  23. Format(url, sizeof(url), "%s", "http://vppgamingnetwork.com/Client/Content/1276");
  24. EncodeUrl(url, sizeof(url));
  25. Format(url, sizeof(url), "http://console.aus-tg.com/redirect.php?url=%s", url);
  26. ShowMOTDPanel(client, "motd", url, MOTDPANEL_TYPE_URL);
  27. PrintToChat(client, "> Please watch the ad until this end to help support aus-tg.");
  28. return Plugin_Continue;
  29. }
  30.  
  31. stock void EncodeUrl(char[] url, int length)
  32. {
  33. ReplaceString(url, length, " ", "%20");
  34. ReplaceString(url, length, "&", "%26");
  35. ReplaceString(url, length, ":", "%3A");
  36. ReplaceString(url, length, "/", "%2F");
  37. ReplaceString(url, length, "?", "%3F");
  38. ReplaceString(url, length, "=", "%3D");
  39. ReplaceString(url, length, ".", "%2E");
  40. ReplaceString(url, length, "#", "%23");
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement