Game Mode Clock. -
Hello,Today i am boring So i made this Game Mode Clock.
Код:
// 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);
}
}
Re: Game Mode Clock. -
Nice job, i'll test it out too. +1
Re: Game Mode Clock. -
Re: Game Mode Clock. -
Re: Game Mode Clock. -
Re: Game Mode Clock. -
Re: Game Mode Clock. -
Re: Game Mode Clock. -
Re: Game Mode Clock. -
Re: Game Mode Clock. -
Well, some people don't play CBCNR. Also you have to put a Screenshot it's nessesary for newbies.!