25.06.2011, 16:50
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 :
with this stock :
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 =)
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;
}
pawn Код:
stock GetName(playerid)
{
new Name[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, Name, sizeof(Name));
}
else
{
Name = "Disconnected/Nothing";
}
return Name;
}
So, how can I change the time definitly ?
Thanks a lot =)