Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- static b_ShowClientAd[MAXPLAYERS+1];
- public void OnPluginStart()
- {
- RegConsoleCmd("jointeam", OnJoinTeam);
- }
- public void OnClientConnected(int client)
- {
- b_ShowClientAd[client] = true;
- }
- public Action OnJoinTeam(int client, int args)
- {
- if (!b_ShowClientAd[client])
- return Plugin_Continue;
- b_ShowClientAd[client] = false;
- char url[1024];
- Format(url, sizeof(url), "%s", "http://vppgamingnetwork.com/Client/Content/1276");
- EncodeUrl(url, sizeof(url));
- Format(url, sizeof(url), "http://console.aus-tg.com/redirect.php?url=%s", url);
- ShowMOTDPanel(client, "motd", url, MOTDPANEL_TYPE_URL);
- PrintToChat(client, "> Please watch the ad until this end to help support aus-tg.");
- return Plugin_Continue;
- }
- stock void EncodeUrl(char[] url, int length)
- {
- ReplaceString(url, length, " ", "%20");
- ReplaceString(url, length, "&", "%26");
- ReplaceString(url, length, ":", "%3A");
- ReplaceString(url, length, "/", "%2F");
- ReplaceString(url, length, "?", "%3F");
- ReplaceString(url, length, "=", "%3D");
- ReplaceString(url, length, ".", "%2E");
- ReplaceString(url, length, "#", "%23");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement