11.09.2016, 13:28
Hey guys, i am experiencing this error:
In my gamemode, the timers are for some reason a little bit messed up. For example, i have a clock, code:
the thing is, that the time goes like by two, it does not wait 1 second, but waits two seconds and than the time move automaticly by two
Practical example:
It is 05:42 - 1 second passes, the time is still 05:42
It is 05:42 - 2 second passes, the time is 05:44, and the 3 in 05:43 appears just for like one milisecond, hope you guys know what i am talking about.
Next error is, that in this command:
Player does not get the message, so this is also proving, that the timers are kind of messed up for some reason.
I am using includes:
Thank you in advance for any solutionable answer, i will also reward you with a reputation point for it.
In my gamemode, the timers are for some reason a little bit messed up. For example, i have a clock, code:
Код:
forward ChangeTime();
public ChangeTime()
{
new
string[6];
niCe[1] ++;
if(niCe[1] > 59) niCe[1] = 0, niCe[0] ++;
if(niCe[0] > 23) niCe[0] = 0, niCe[1] = 0;
format(string, sizeof(string), "%02d:%02d", niCe[0], niCe[1]);
TextDrawSetString(Clocks, string);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i)) SetPlayerTime(i, niCe[0], niCe[1]);
}
return 1;
}
Practical example:
It is 05:42 - 1 second passes, the time is still 05:42
It is 05:42 - 2 second passes, the time is 05:44, and the 3 in 05:43 appears just for like one milisecond, hope you guys know what i am talking about.
Next error is, that in this command:
Код:
CMD:vyhodit(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CHYBA, "[ Chyba ] Nemбte dostatečnб admin prбva!");
new
pplayerid, reason[48], banmt[300],banma[300];
if(sscanf(params, "us[48]", pplayerid, reason)) return SendClientMessage(playerid, POUZITI, "[ Pouћitн ] Pouћitн: /vyhodit [ID] [DŮVOD]");
if(!IsPlayerConnected(pplayerid)) return SendClientMessage(playerid, CHYBA, "[ Chyba ] Hrбč nenн připojen!");
if(PlayerInfo[pplayerid][pAdmin] > 0) return SendClientMessage(playerid, CHYBA, "[ Chyba ] Nemůћete vyhodit člena admin tэmu!");
PlayerInfo[pplayerid][pKicks] ++;
format(banma,sizeof(banma),"[ Administrace ] Admin %s vyhodil hrбče %s! [ %s ]",GetName(playerid),GetName(pplayerid),reason);
format(banmt,sizeof(banmt),"[ Administrace ] Admin %s vбs vyhodil! [ % ]",GetName(playerid), reason);
SendClientMessageToAll(ADMIN,banma);
SendClientMessage(pplayerid,ADMIN,banmt);
SetTimerEx("KickPlayer",100,false,"i",pplayerid);
return 1;
}
I am using includes:
Код:
#include <a_samp> #include <zcmd> #include <YSI\y_ini> #include <sscanf2>

