30.01.2007, 05:53
Could i suggest you to try to compile it with the new compiler? indent your code!
After a quick look at the code :
encode the player name (with udb_encode), or it will probably crash when trying to create a player file with specials characters in the name.
Why all that switch cases? Is that for hours with 2 numbers? Then you can simply do
That will give the same result as your whole switch and no need of the new time[256];
And others things like that. This script can be vastly improved (writing, methods, general scripting). Also I would suggest you to use dcmd. Oh and you forget to delete user's account in scriptfiles ^^, and you can create another folder in scriptfiles folder, think about scripters that already have some files in this folder! That can be confusing. I always create a ew folder with the name of the script and put script files in it.
Best luck with this script
After a quick look at the code :
encode the player name (with udb_encode), or it will probably crash when trying to create a player file with specials characters in the name.
pawn Code:
switch(strval(tmp)) {
case 1: { SetWorldTime(01); format(time,sizeof(time),"01"); } // etc etc but you format nothing, time = "01"; is enough
format(string,sizeof(string),"The world time has been changed to %s:00 by Admin %s",time,name);
SendClientMessageToAll(yellow,string);
pawn Code:
new time = strval(tmp);
SetWorldTime(time);
format(string,sizeof(string),"The world time has been changed to %02d:00 by Admin %s",time,name);
SendClientMessageToAll(yellow,string);
And others things like that. This script can be vastly improved (writing, methods, general scripting). Also I would suggest you to use dcmd. Oh and you forget to delete user's account in scriptfiles ^^, and you can create another folder in scriptfiles folder, think about scripters that already have some files in this folder! That can be confusing. I always create a ew folder with the name of the script and put script files in it.
Best luck with this script