public IncreaseTime(playerid)
{
new h, m;
new string[20];
//SetToNull(playerid);
GetPlayerTimeEx(playerid, h, m);
TextDrawShowForPlayer(playerid, time);
m++;
if(m == 60)
{
h++;
m = 0;
}
if(h == 24)
{
h = 0;
}
SetPlayerTimeEx(playerid, h, m);
if(m >= 0&&m < 9)
{
format(string, sizeof(string), "%d:0%d", h, m);
TextDrawSetString(time,string);
return 1;
}
if(m == 9)
{
format(string, sizeof(string), "%d:0%d", h, m);
TextDrawSetString(time,string);
return 1;
}
if(m >= 10&&m < 60)
{
format(string, sizeof(string), "%d:%d", h, m);
TextDrawSetString(time,string);
return 1;
}
if(h== 1)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 1:00");
return 1;
}
if(h== 0)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 0:00");
return 1;
}
SetWorldTime(h);
format(string, sizeof(string), "[GAME TIME] %d:00", h);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}
new h, m;
public IncreaseTime(playerid)
{
new h, m;
new string[20];
GetPlayerTimeEx(playerid, h, m);
TextDrawShowForPlayer(playerid, time);
m++;
if(m == 60)
{
h++;
m = 0;
}
if(h == 24)
{
h = 0;
}
SetPlayerTimeEx(playerid, h, m);
if(m >= 0&&m < 9)
{
format(string, sizeof(string), "%d:0%d", h, m);
TextDrawSetString(time,string);
}
else if(m == 9)
{
format(string, sizeof(string), "%d:0%d", h, m);
TextDrawSetString(time,string);
}
else if(m >= 10&&m < 60)
{
format(string, sizeof(string), "%d:%d", h, m);
TextDrawSetString(time,string);
}
if(h== 1)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 1:00");
}
else if(h== 0)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 0:00");
}
else {
format(string, sizeof(string), "[GAME TIME] %d:00", h);
SendClientMessageToAll(COLOR_WHITE, string);
SetWorldTime(h);
}
return h;
}
|
found it try this
pawn Код:
|
format(string, sizeof(string), "%d:%2d", h, m);
TextDrawSetString(time,string);
if(h== 1)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 1:00");
}
else if(h== 0)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 0:00");
}
else {
format(string, sizeof(string), "[GAME TIME] %d:00", h);
SendClientMessageToAll(COLOR_WHITE, string);
SetWorldTime(h);
}
if(h== 1 && m==0)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 1:00");
}
else if(h== 0&& m==0)
{
SendClientMessageToAll(COLOR_WHITE,"[GAME TIME] 0:00");
}
else {
format(string, sizeof(string), "[GAME TIME] %d:00", h);
SendClientMessageToAll(COLOR_WHITE, string);
SetWorldTime(h);
}
public IncreaseTime(playerid)
{
new h, m;
new string[20];
GetPlayerTimeEx(playerid, h, m);
TextDrawShowForPlayer(playerid, time);
m++;
if(m == 60)
{
h++;
m = 0;
}
if(h == 24)
{
h = 0;
}
SetPlayerTimeEx(playerid, h, m);
if(m >= 0&&m < 60)
{
format(string, sizeof(string), "%d:%2d", h, m);
TextDrawSetString(time,string);
}
if(m == 0){
format(string, sizeof(string), "[GAME TIME] %d:00", h);
SendClientMessage(playerid,COLOR_WHITE, string);
SetWorldTime(h);
}
return h;
}