Clock problem
#1

Hi!Im editing a roleplay gamemode and i have a problem.
The clock of the server.It's position its in the right corner from the up side.
The problem is that the hour that it shows it's not correct.
The real hour is 19(for exemple) and it show's 21-22.
I want to change the hour to the correct one but i don't know how.
I searched my script but i didn't found anything .
Reply
#2

How the hell you think people help you without your code posted? LOL
Reply
#3

If you're using a Gamemode, use OnGameModeInit(), otherwise use OnFilterScriptInit()
This is your first code:
pawn Код:
public OnGameModeInit() //Or OnFilterScriptInit() if you're using a filterscript.
{
    SetTimer("RenewTime", 1000, true);
    return 1;
}
Place this at the bottom of your script. (Preferably)
pawn Код:
forward RenewTime();
public RenewTime()
{
    new hour, minute, second;
    gettime(hour, minute, second);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerTime(i, hour, minute);
        }
    }
    return 1;
}
I'm assuming this is what you're looking for, but I can't be too sure, because you haven't explained very well.
Reply
#4

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
If you're using a Gamemode, use OnGameModeInit(), otherwise use OnFilterScriptInit()
This is your first code:
pawn Код:
public OnGameModeInit() //Or OnFilterScriptInit() if you're using a filterscript.
{
    SetTimer("RenewTime", 1000, true);
    return 1;
}
Place this at the bottom of your script. (Preferably)
pawn Код:
forward RenewTime();
public RenewTime()
{
    new hour, minute, second;
    gettime(hour, minute, second);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerTime(i, hour, minute);
        }
    }
    return 1;
}
I'm assuming this is what you're looking for, but I can't be too sure, because you haven't explained very well.
It worked !Thank you very much!
Reply
#5

Sorry for duble post but there is another problem ).
The server is hosted.
When i enter the server that i open in my pc(the server that is not hosted,i open it just to see if the changes that i make in the gm are working),the hour is correct.
When i'm entering the hosted server it's not correct.
I mention that i uploaded the gm from my pc to the host.
I think there's something to write in the script for the operation system because the host is on linux and i have windows.
Reply
#6

SA-MP's gettime function will get the time that is hosted from the server, which means it will be retrieving the time in from the hosting services timezone/setting. Example: Volt-Host is at 6:00pm, where you might be at 4:00am, so the gettime function will react differently.
Reply
#7

Ok.If that's the problem i'l talk to the host administrator to see if he can change the time ...
If he can't can u tell me how to delete the clock?
Reply
#8

pawn Код:
public OnPlayerConnect(playerid)
{
    TogglePlayerClock(playerid, 0);
    return 1;
}
Reply
#9

doesn't exist...
Reply
#10

Are you sure you have a_samp included? 0_o

If you do, what errors are you getting?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)