How to change server time?
#1

How can i change server time in GM, becouse when i change in with admin command it doesnt work for just logined in server player. (new player time is day). i wanna change all time in night. for all players.... sorry me english bad....
Reply
#2

pawn Code:
if(strcmp(cmd, "/weatherall", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pAdmin] < 3)
            {
              SendClientMessage(playerid, COLOR_GRAD1, "  Niste ovlasteni za koristenje ove komande!");
              return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
              SendClientMessage(playerid, COLOR_WHITE, "KORISTENJE: /weatherall [weatherid]");
              return 1;
            }
            new weather;
            weather = strvalEx(tmp);
            if(weather < 0||weather > 45) { SendClientMessage(playerid, COLOR_GREY, "  Weather ID can't be below 0 or above 45!"); return 1; }
            SetWeather(weather);
            SendClientMessage(playerid, COLOR_GREY, "  Weather Set to everyone!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 256, "AdmWarning: %s has changed the weather to %d.", sendername,weather);
            ABroadCast(COLOR_YELLOW,string,1);
        }
        return 1;
    }
Reply
#3

Time. Not weather.
Reply
#4

Not Weather... but TIME
Reply
#5

Like this

pawn Code:
if(strcmp(cmd, "/tod", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /tod [timeofday] (0-23)");
                return 1;
            }
            new hour;
            hour = strvalEx(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
          SetWorldTime(hour);
                format(string, sizeof(string), "  Time set to %d Hours.", hour);
                BroadCast(COLOR_GRAD1, string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "  Niste ovlasteni za koristenje ove komande !");
            }
        }
        return 1;
    }
Reply
#6

Quote:
Originally Posted by Dujma
Like this

code...
That is from The Godfather script.
And requires certain functions which regular scripts don't have.
Reply
#7

He can esily edit this code, just some directions and you just have to use SetWorldTime
Reply
#8

Hardly, you need to define alot.

pawn Code:
/*
cmd
tmp
PlayerInfo
BroadCast
*/
etc.
Reply
#9

Quote:
Originally Posted by •Lj•
Hardly, you need to define alot.

pawn Code:
/*
cmd
tmp
PlayerInfo
BroadCast
*/
etc.
But if he has any brains he will see in his script how is player enum defined (if there is one) or if he is an admin and how to send an admin message
Reply
#10

I have it.
SetPlayerTime(playerid, 22, 00);
Reply
#11

thanks lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)