new Year, Month, Day, Hour, Minute, option[32], string[128]; getdate(Year, Month, Day); gettime(Hour, Minute); { new ActualDay; PlayerInfo[playerid][pIDay] = ActualDay; PlayerInfo[playerid][pIMonth] = Month; PlayerInfo[playerid][pIDay] = Day; PlayerInfo[playerid][pIMonth] = Month; PlayerInfo[playerid][pIYear] = Year; PlayerInfo[playerid][pIHour] = Hour; PlayerInfo[playerid][pIMinute] = Minute; }
if(Hour > 12)
{
new NonMilitaryTime = Hour - 12;
//Make sure to add AM if NonMilitaryTime is being called
return 1;
}
else if(Hour < 13)
{
new NonMilitaryTime = Hour;
//Make sure you use PM here for NonMilitaryTime
}
Try doing somthing like this:
pawn Код:
|
new dattime[64];
if(Hour > 12)
{
new NonMilitaryTime = Hour - 12; //Make sure to add AM if NonMilitaryTime is being called
format(dattime,sizeof(dattime),"The Current Time is: %i:%d A.M.", NonMilitaryTime, Minute);
}
else if(Hour < 13)
{
new NonMilitaryTime = Hour; //Make sure you use PM here for NonMilitaryTime
format(dattime,sizeof(dattime),"The Current Time is: %i:%d P.M.", NonMilitaryTime, Minute);
}
if(!strcmp(option, "updates", true)) { new File: file = fopen("updates.cfg", io_append); format(string, sizeof(string), "%s - [%d/%d/%d - (%d:%d > This is the time.)]\r\n", params, PlayerInfo[playerid][pIMonth], PlayerInfo[playerid][pIDay], PlayerInfo[playerid][pIYear], PlayerInfo[playerid][pIHour], PlayerInfo[playerid][pIMinute]); fwrite(file, string); fclose(file); format(string, sizeof(string), "AdmWarn: %s has posted updates, use /updates to view it.", RPN(playerid)); SendClientMessageToAll(COLOR_LIGHTRED, string); return 1; }