Settime dcmd into normal command
#2

These should be on top of OnPlayerCommandText:
Код:
new idx;
new cmd[256];
new tmp[256];
And this is the command:
Код:
	if(strcmp(cmd, "/settime", true) == 0)
		{
		tmp=strtok(cmdtext, idx);
		if(PlayerInfo[playerid][AdminLevel]>=g_Level[lsettime])
			{
			new hour;
			if(sscanf(strval(tmp), "d",hour))
				{
				return SendClientFormatMessage(playerid,COLOR_SYSTEM,"%s: /settime [Hour]",GetLanguageString(GetPlayerLanguageID(playerid),"txt_icommands"));
				}
			else if(hour < 0 || hour > 23 )
				{
				return SendClientLanguageMessage(playerid,COLOR_RED2,"txt_worldtime1");
				}
			else
				{
				g_Time=hour;
				g_TimeUpdate_Count=0;
				SetWorldTime(g_Time);
				CreateClientLanguageMessages("txt_worldtime2",g_Time);
				SendAdminCommand(COLOR_YELLOW);
				return WriteLog(clearlog,LanguageString(ServerLanguage()));
				}
			}
		else
			{
			SendClientLanguageMessage(playerid,COLOR_LIGHTBLUE,"txt_error404");
			}
		return 1;
		}
Reply


Messages In This Thread
Settime dcmd into normal command - by Puzi - 23.08.2009, 15:18
Re: Settime dcmd into normal command - by ronyx69 - 23.08.2009, 15:22
Re: Settime dcmd into normal command - by Puzi - 23.08.2009, 15:32
Re: Settime dcmd into normal command - by ronyx69 - 23.08.2009, 15:33
Re: Settime dcmd into normal command - by Puzi - 23.08.2009, 15:37
Re: Settime dcmd into normal command - by ronyx69 - 23.08.2009, 15:42
Re: Settime dcmd into normal command - by Puzi - 23.08.2009, 15:44

Forum Jump:


Users browsing this thread: 1 Guest(s)