SetWorldTime
#1

Hello, I'm scripting a GM and I want to create a command to set the time. So, I searched on the net and I maked this :

pawn Код:
dcmd_heure(playerid,params[])
{
  if (!IsPlayerAdmin(playerid))
  return SendClientMessage(playerid, 0xFF0000AA, "Vous n'кtes pas administrateur !");
  if (!params[0])
  return SendClientMessage( playerid, 0xFF9900, "Utilisation : /Heure [heure] -- L'heure rentrйe doit кtre numйrique.");

  new
    string[ 70 ],
    h = strval( params );

  if (h < 0 || h > 24) return SendClientMessage( playerid, 0xFF0000AA, "Erreur ! Veuillez rentrer un nombre compris entre 1 et 24 inclus.");
  SetWorldTime(h);
  format(string, sizeof(string), "%s a changй l'heure ! Il est maintenant %d h !", GetName(playerid), h);
  SendClientMessageToAll(0xCC0099, string );
  return 1;
}
with this stock :

pawn Код:
stock GetName(playerid)
{
    new Name[MAX_PLAYER_NAME];

    if(IsPlayerConnected(playerid))
    {
        GetPlayerName(playerid, Name, sizeof(Name));
    }
    else
    {
        Name = "Disconnected/Nothing";
    }

    return Name;
}
It works, but after I change the time, the server returns to my computer's time (GMT+1, France time).

So, how can I change the time definitly ?

Thanks a lot =)
Reply


Messages In This Thread
SetWorldTime - by ludesert - 25.06.2011, 16:50
Re: SetWorldTime - by Willow - 25.06.2011, 17:43
Re : SetWorldTime - by ludesert - 25.06.2011, 18:55
Re : SetWorldTime - by ludesert - 25.06.2011, 19:09
Re : SetWorldTime - by ludesert - 25.06.2011, 20:02
Re: SetWorldTime - by iPLEOMAX - 25.06.2011, 20:23
Re : SetWorldTime - by ludesert - 25.06.2011, 20:31
Re: Re : SetWorldTime - by iPLEOMAX - 25.06.2011, 20:44
Re : SetWorldTime - by ludesert - 25.06.2011, 20:48
Re : SetWorldTime - by ludesert - 26.06.2011, 11:21

Forum Jump:


Users browsing this thread: 1 Guest(s)