28.12.2009, 03:00
I'm having a problem with the /time script, anybody who could help me?
People have to buy a watch to watch the time, a cheap watch gives them 1+ watch. ( So they can view the time )
A expensive one gives them 10+ watch ( So they can view the date and time )
But it just says " You don't have a watch " the only watch that works is the expensive one.
Could anybody fix it for me, if its easy.
People have to buy a watch to watch the time, a cheap watch gives them 1+ watch. ( So they can view the time )
A expensive one gives them 10+ watch ( So they can view the date and time )
But it just says " You don't have a watch " the only watch that works is the expensive one.
Could anybody fix it for me, if its easy.
Код:
if(strcmp(cmd, "/time", true) == 0) { if(IsPlayerConnected(playerid)) { 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 = "July"; } 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][pWatch] == 1) { format(string, sizeof(string), "~w~%d:0%d~g~|", hour, minuite); } else { format(string, sizeof(string), "~r~You don't have a watch"); } } if(PlayerInfo[playerid][pWatch] == 10) { format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite); } else { format(string, sizeof(string), "~r~You don't have a watch"); } } } GameTextForPlayer(playerid, string, 5000, 1); GetPlayerName(playerid, sendername, sizeof(sendername)); if(PlayerInfo[playerid][pWatch] == 1) { if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s raises his hand and looks down at his watch.", sendername); } else { format(string, sizeof(string), "* %s raises her hand and looks down at her watch.", sendername); } ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } return 1; }