26.11.2011, 09:59
hey thats what i got
Can anyone make that the hour would update...every minute will past in second in real life...PLEASE HELP!
PHP код:
#include <a_samp>
#pragma tabsize 0
#include "zcmd"
#include "sscanf2"
new hour, minute;
CMD:settime(playerid,params[])
{
new playername[32],dformat[100];
if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"You have to be admin");
if(sscanf(params,"dd",hour,minute)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /settime [hour] [minute]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerTime(i,hour,minute);
GetPlayerName(playerid,playername,sizeof(playername));
}
format(dformat,sizeof(dformat),"{ffff02}%s {00ff00}changed server time",playername);
SendClientMessageToAll(0xFFFFFFFF,dformat);
return 1;
}
public OnFilterScriptInit()
{
txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 3);
TextDrawSetShadow(txtTimeDisp,0); // no shadow
TextDrawSetOutline(txtTimeDisp,2); // thickness 1
TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
TextDrawColor(txtTimeDisp,0x00FF00FF);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.5,1.5);
SetTimer("UpdateHour",1000,true);
}