25.06.2011, 17:43
Just made it quick with zcmd, you just have to edit it for your needs and it should work... I haven't tested it!
You will need a sscanf plugin or include!
You will need a sscanf plugin or include!
Код:
CMD:settime(playerid,params[]) { new time,string[128]; if(!IsPlayerAdmin(playerid)) { return /* not admin, put message here*/ } if(sscanf(params,"d",time); { return /* invalid syntax, putt message here */ } if(time >= 0 && time < 24) { SetWorldTime(playerid,time); format(string,sizeof(string),"%s changed time, time is now %d hours!", PlayerName(playerid),time); SendClientMessageToAll(COLOR_WHITE,string); return 1; } else { /* invalid time, put message here */ } } stock PlayerName(playerid) { new name[24]; GetPlayerName(playerid, name, sizeof(name)); return name; }