Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------------------------//
- // Hostname & Weather Changer by Joksa //
- //-------------------------------------------//
- #include <a_samp>
- //Forwards
- forward hostname();
- forward ChangeWeather();
- //News
- new DefaultWeather = 10;
- new weather2;
- //Defines
- #define COLOR_SEA 0x00808000
- public OnFilterScriptInit()
- {
- SetTimer("hostname",5000,true);
- //<<< Currently it is set to change the name for 5 seconds >>>
- //<<< You can change the ammount of time the hostname stays till it changes(1000 = 1 second)
- SetTimer("ChangeWeather",1200000, true);
- ChangeWeather();
- //<<< Currently it is set to change the weather for 20 minutes >>>
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/changeweather",cmdtext, true) == 0) // By Joksa
- {
- if(IsPlayerAdmin(playerid))
- {
- ChangeWeather();
- SendClientMessageToAll(0x0080FFFF,"Admin has changed the weather");
- }
- return 1;
- }
- if(strcmp("/myweather",cmdtext, true) == 0) // By Joksa
- {
- SetPlayerWeather(playerid, DefaultWeather);
- return 1;
- }
- return 0;
- }
- public hostname()
- {
- new HostNameChanger = random(3);
- //If you want more you have to change random(3) in the example of Random(5) if you have 5 messages; if you have 8 different messages but dont forget to edit the cases too!! switch (HostNameChanger)
- switch (HostNameChanger)
- {
- case 0: SendRconCommand("hostname Visit My server will not regret it");
- case 1: SendRconCommand("hostname Everybody is welcome!");
- case 2: SendRconCommand("hostname If you come expecting rewards");
- // if you edit the texts, dont remove "hostname", otherwise it wont work!!
- }}
- public ChangeWeather() // By Joksa
- {
- weather2 = random(20);
- DefaultWeather = weather2;
- if(weather2 == 1)
- {
- SetWeather(1);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: Being of the sun, great for swimming!");
- }
- else if(weather2 == 2)
- {
- SetWeather(2);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: There will be a storm, best stay home!");
- }
- else if(weather2 == 3)
- {
- SetWeather(3);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: Being of the sun, great for diving!");
- }
- else if(weather2 == 4)
- {
- SetWeather(4);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
- }
- else if(weather2 == 5)
- {
- SetWeather(5);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: There will be a storm, best stay home!");
- }
- else if(weather2 == 6)
- {
- SetWeather(6);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: There will be a storm, best stay home!");
- }
- else if(weather2 == 7)
- {
- SetWeather(7);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
- }
- else if(weather2 == 8)
- {
- SetWeather(8);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be very rainy, stay at home!");
- }
- else if(weather2 == 9)
- {
- SetWeather(9);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be a bit cloudy, but do not worry!");
- }
- else if(weather2 == 10)
- {
- SetWeather(10);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, careful not to make it rain!");
- }
- else if(weather2 == 11)
- {
- SetWeather(11);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, Good for cycling!");
- }
- else if(weather2 == 12)
- {
- SetWeather(12);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
- }
- else if(weather2 == 13)
- {
- SetWeather(13);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, Great for flying!");
- }
- else if(weather2 == 14)
- {
- SetWeather(14);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, Good for walking!");
- }
- else if(weather2 == 15)
- {
- SetWeather(15);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
- }
- else if(weather2 == 16)
- {
- SetWeather(16);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be rainy, do not forget the umbrella");
- }
- else if(weather2 == 17)
- {
- SetWeather(17);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny with a few clouds, great for walking, but bring long sleeves!");
- }
- else if(weather2 == 18)
- {
- SetWeather(18);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny with a few clouds, Bring warm clothes!");
- }
- else if(weather2 == 19)
- {
- SetWeather(19);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be a dust storm, do not drive or fly!");
- }
- else if(weather2 == 20)
- {
- SetWeather(20);
- SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be very cloudy, be careful and take your umbrella!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment