SA-MP Forums Archive
[FilterScript] Game Mode Clock. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Game Mode Clock. (/showthread.php?tid=481227)



Game Mode Clock. - MadLeet - 14.12.2013

Hello,Today i am boring So i made this Game Mode Clock.
This Is Simple But Great Game Mode Clock Like CBCNR.

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript

#include <a_samp>

#define MAX_WEATHER 9
new GameModeTimer;
new OnCommandList[MAX_PLAYERS];
new Text:Clock;
new Text:DaysOfWeek;
new GameDay = 0;
new GameHour = 0;
new GameMinute = 0;
new GameWeather = 0;
new RandomWeather[MAX_WEATHER][1] = {
	{1},
	{3},
	{9},
	{7},
	{2},
	{10},
	{5},
	{6},
	{4}
};

new WeekDays[7][] = {
	{"Monday"},
	{"Tuesday"},
	{"Wednesday"},
	{"Thursday"},
	{"Friday"},
	{"Saturday"},
	{"Sunday"}
};



public OnFilterScriptInit()
{
    Clock = TextDrawCreate(549.0, 24.0, "00:00");
	TextDrawLetterSize(Clock, 0.55, 2.0);
	TextDrawFont(Clock, 3);
	TextDrawBackgroundColor(Clock, 0x000000AA);
	TextDrawSetOutline(Clock, 2);
	
    DaysOfWeek = TextDrawCreate(549.0, 7.0, WeekDays[GameDay]);
	TextDrawAlignment(DaysOfWeek, 1);
	TextDrawBackgroundColor(DaysOfWeek, 0x000000FF);
	TextDrawFont(DaysOfWeek, 2);
	TextDrawLetterSize(DaysOfWeek, 0.2999, 1.2);
	TextDrawColor(DaysOfWeek, 0xFFFFFFFF);
	TextDrawSetOutline(DaysOfWeek, 1);
	TextDrawSetProportional(DaysOfWeek, true);
	TextDrawSetShadow(DaysOfWeek, 1);
    GameModeTimer = SetTimerEx("GameModeClock", 900, 1, "d", "d");
    print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    KillTimer(GameModeTimer);
	return 1;
}

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

forward GameModeClock();
public GameModeClock()
{
	new string[256],string2[128];

	GameMinute ++;

	if (GameMinute == 60)
	{
	GameMinute = 0;
	GameHour ++;
	SetWorldTime(GameHour);
	GameWeather ++;

	if (GameWeather == 3)
	{
	new weatherid = random(MAX_WEATHER);
	SetWeather(RandomWeather[weatherid][0]);
	GameWeather = 0;
	}

	}

	if (GameHour == 24)
	{
	GameMinute = 0;
	GameHour = 0;
	GameDay ++;
	}

	format(string, sizeof(string), "%s",WeekDays[GameDay]);
	TextDrawSetString(DaysOfWeek, string);

	if (GameHour < 10)
	format(string, sizeof(string), "0%d",GameHour);
	else
	format(string, sizeof(string), "%d",GameHour);

	if (GameMinute < 10)
	format(string, sizeof(string), "%s:0%d",string,GameMinute);
	else
	format(string, sizeof(string), "%s:%d",string,GameMinute);

	TextDrawSetString(Clock, string);


	if (GameHour < 10)
	format(string, sizeof(string), "%s, 0%d",WeekDays[GameDay],GameHour);
	else
	format(string, sizeof(string), "%s, %d",WeekDays[GameDay],GameHour);

	if (GameMinute < 10)
	format(string, sizeof(string), "%s:0%d",string,GameMinute);
	else
	format(string, sizeof(string), "%s:%d",string,GameMinute);


	if (GameMinute == 0)
	{
	format(string, sizeof(string), "%s",string);
	//printf(string);

	format(string2, sizeof(string2), "worldtime %s",string);
	SendRconCommand(string2);

	format(string, sizeof(string), "{FFFFFF}Game Time: {BDBDBD}%s",string);
	SendClientMessageToAll(-1, string);
	}
}
+REP if you like this.


Re: Game Mode Clock. - Affan - 15.12.2013

Nice job, i'll test it out too. +1


Re: Game Mode Clock. - MadLeet - 15.12.2013

Quote:
Originally Posted by Affan
Посмотреть сообщение
Nice job, i'll test it out too. +1
Thanks.


Re: Game Mode Clock. - Gen3i - 15.12.2013

Looks nicee,good job


Re: Game Mode Clock. - MadLeet - 15.12.2013

Quote:
Originally Posted by Gen3i
Посмотреть сообщение
Looks nicee,good job
Thanks.


Re: Game Mode Clock. - DeathFire - 15.12.2013

Nice


Re: Game Mode Clock. - MadLeet - 15.12.2013

Thanks ..


Re: Game Mode Clock. - BizzyD - 15.12.2013

Looks nice, but can we get any screenshots?


Re: Game Mode Clock. - MadLeet - 15.12.2013

Quote:
Originally Posted by [SWE]Alexzz
Посмотреть сообщение
Looks nice, but can we get any screenshots?
This is Same As CBCNR(Crazy Bob Cops And Robbers).


Re: Game Mode Clock. - Alex Magaсa - 15.12.2013

Quote:
Originally Posted by MadLeet
Посмотреть сообщение
This is Same As CBCNR(Crazy Bob Cops And Robbers).
Well, some people don't play CBCNR. Also you have to put a Screenshot it's nessesary for newbies.!