23.02.2010, 16:54
Quote:
Originally Posted by ДitisOnHuora
Quote:
![]() |
Код:
dcmd_settime(playerid,params[]) { if(AccInfo[playerid][Level] >= 3) { new Index; new tmp[256]; tmp = strtok(params,Index); new tmp2[256]; tmp2 = strtok(params,Index); if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, LIGHTBLUE2, "Usage: /settime [PlayerID] [Time(Hour)]") && SendClientMessage(playerid, orange, "Function: Will set the Time of specified player!"); new player1 = strval(tmp); new time = strval(tmp2); new string[128]; if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin"); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { SendCommandToAdmins(playerid,"SetTime"); format(string, sizeof(string), "|- You have set \"%s's\" Time to %d:00 -|", pName(player1), time); SendClientMessage(playerid,BlueMsg,string); if(player1 != playerid) { format(string,sizeof(string),"|- Administrator \"%s\" has set your Time to %d:00 -|", pName(playerid), time); SendClientMessage(player1,blue,string); } PlayerPlaySound(player1,1057,0.0,0.0,0.0); return SetPlayerTime(player1, time, 0); } else return ErrorMessages(playerid, 2); } else return ErrorMessages(playerid, 1); }