2021-03-11, 08:55 PM
(2021-03-11, 08:31 PM)Radical Wrote: I have no idea about GetTickCount() but you can use gettime() instead.
PHP Code:public OnPlayerCommandReceived(playerid, cmdtext[])
{
? ? if (!IsPlayerConnected(playerid) || playerid == INVALID_PLAYER_ID)
{
return SendClientMessage(playerid, COLOR_INVALID, "You are not connected."), false;
}
if (gettime() < timeUsedCommand[playerid])
? ? {
return SendClientMessage(playerid, COLOR_GRAD1, "Wait 2 seconds to retype a command!"), false;
? ? }
timeUsedCommand[playerid] = gettime();
? ? return 1;
}
It is an option too, but on other devices with GetTickCount it works perfectly. And since this function returns the time in seconds since the server was turned on, there is a problem with that, as it is returning a negative time. I wanted to understand why this problem arose