Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* » ruddeTR's simple movement hostname system */
- #include " a_samp "
- #define DefaultHostname "SA-MP Server"
- #define DefaultWeburl "forum.sa-mp.com"
- #define Hostname1 "SA-MP Server - 1"
- #define Hostname2 "SA-MP Server - 2"
- #define Hostname3 "SA-MP Server - 3"
- #define Hostname4 "SA-MP Server - 4"
- #define Weburl1 "forum.sa-mp.com"
- #define Weburl2 "sa-mp.com"
- #define Weburl3 "forum.sa-mp.com"
- #define Weburl4 "sa-mp.com"
- #define SEC 1000 // m/s
- forward HostnameChanger1();
- forward HostnameChanger2();
- forward HostnameChanger3();
- forward HostnameChanger4();
- new t_Hostname;
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext,"/hostname-start",true))
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You do not have permission!");
- {
- SendClientMessage(playerid, -1, "Movement Hostname System activated.");
- t_Hostname = SetTimer("HostnameChanger1", 5000, false);
- }
- return 1;
- }
- if(!strcmp(cmdtext,"/hostname-stop",true))
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You do not have permission!");
- {
- SendClientMessage(playerid, -1, "Movement Hostname System de-activated.");
- KillTimer(t_Hostname);
- SendRconCommand(DefaultHostname);
- SendRconCommand(DefaultWeburl);
- }
- return 1;
- }
- return 0;
- }
- public HostnameChanger1()
- {
- SendRconCommand(Hostname1);
- SendRconCommand(Weburl1);
- SetTimer("HostnameChanger2", SEC, false);
- return 1;
- }
- public HostnameChanger2()
- {
- SendRconCommand(Hostname2);
- SendRconCommand(Weburl2);
- SetTimer("HostnameChanger3", SEC, false);
- return 1;
- }
- public HostnameChanger3()
- {
- SendRconCommand(Hostname3);
- SendRconCommand(Weburl3);
- SetTimer("HostnameChanger4", SEC, false);
- return 1;
- }
- public HostnameChanger4()
- {
- SendRconCommand(Hostname4);
- SetTimer("HostnameChanger1", SEC, false);
- SendRconCommand(Weburl4);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment