08.12.2010, 05:10
First, check Mehtab's code... If it's not working, then tell me if you have that kind of code on your /time command.
Just compare between both codes, because this one works fine to me... and ignore the pWatch part...
Just compare between both them and try to fix yours, hope it helps
pawn Code:
if(strcmp(cmd, "/time", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pWatch] == 0) return SendClientMessage(playerid,COLOR_GREY," You don`t have a watch you can buy one in the 24/7");
new mtext[20];
new year, month,day;
getdate(year, month, day);
if(month == 1) { mtext = "January"; }
else if(month == 2) { mtext = "February"; }
else if(month == 3) { mtext = "March"; }
else if(month == 4) { mtext = "April"; }
else if(month == 5) { mtext = "May"; }
else if(month == 6) { mtext = "June"; }
else if(month == 7) { mtext = "Juli"; }
else if(month == 8) { mtext = "August"; }
else if(month == 9) { mtext = "September"; }
else if(month == 10) { mtext = "October"; }
else if(month == 11) { mtext = "November"; }
else if(month == 12) { mtext = "December"; }
new hour,minuite,second;
gettime(hour,minuite,second);
FixHour(hour);
hour = shifthour;
if (minuite < 10)
{
if (PlayerInfo[playerid][pJailTime] > 0)
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
}
}
else
{
if (PlayerInfo[playerid][pJailTime] > 0)
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
}
}
GameTextForPlayer(playerid, string, 5000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s raises up his hand and looks at his clock.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(!IsPlayerInAnyVehicle(playerid))
{
ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0);
}
}
return 1;
}
Just compare between both them and try to fix yours, hope it helps