lvrcr time stand time start on 12:00 go to 12:59 and then go back to 12:00 - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: lvrcr time stand time start on 12:00 go to 12:59 and then go back to 12:00 (
/showthread.php?tid=129972)
lvrcr time stand time start on 12:00 go to 12:59 and then go back to 12:00 -
ownboy - 24.02.2010
Hello,
The time Is only 12:00. when it's 12:59 then it go back to 12:00
And I dont see that the Gamedays are changing

They only on Monday.
help please
pawn Code:
new gametime =12;
new gameday =1;
pawn Code:
public TimeWorld()
{
if(gametime == 23 && gameday == 7)
gametime++;
if(gametime >= 24) {
gametime =0;
}
if(gametime == 0 && gameday <= 7) {
gameday ++;
}
for(new i=0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetPlayerTime(i,gametime,0);
}
}
new string[30];
SetWorldTime(gametime);
format(string, sizeof(string), "Game Time: %d:00", gametime);
SendClientMessageToAll(0x5F9EA0AA, string);
if(gametime == 0 && gameday == 1) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Monday");
}
if(gametime == 0 && gameday == 2) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Tuesday");
}
if(gametime == 0 && gameday == 3) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Wednesday");
}
if(gametime == 0 && gameday == 4) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Thursday");
}
if(gametime == 0 && gameday == 5) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Friday");
}
if(gametime == 0 && gameday == 6) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Saturday");
}
if(gametime == 0 && gameday == 7) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Sunday");
}
if(gametime == 23 && gameday == 7) {
SendClientMessageToAll(0x2587CEAA,"*Game Day: This week is over.");
SendClientMessageToAll(0x2587CEAA,"*AutoAdmin: Don't forget to visit our website at ");
}
}
Re: lvrcr time stand time start on 12:00 go to 12:59 and then go back to 12:00 -
ownboy - 24.02.2010
Help please ;(
Re: lvrcr time stand time start on 12:00 go to 12:59 and then go back to 12:00 -
Joe Staff - 24.02.2010
pawn Code:
new gDay;
new gHour;
new gMinute;
forward TimeWorld();
public TimeWorld()
{
gMinute++;
if(gMinute>59)
{
gMinute-=60;
gHour++;
}
if(gHour>23)
{
gHour-=24;
gDay++;
}
if(gDay>6)
{
gDay-=7; //Beginning of the week would be 0, not 1
}
}