Help with GetTickCount - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with GetTickCount (
/showthread.php?tid=570329)
Help with GetTickCount -
Muhammad78 - 09.04.2015
Hi, i got a command for players, but that command always used for abusing, so i decide to make it with cooldown, i have tested the command and didn't work theres no error while compiling but didn't work in game. Heres my code
Код:
new WaitTime[MAX_PLAYERS];
Код:
CMD:fixvme(playerid,params[]) {
if((GetTickCount()- WaitTime[playerid])> 6000) return SendClientMessage(playerid,red,"ERROR: You need to wait 1 minutes before you can /fixvme again!");
if(IsSpawned[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
return 1;
}
if(GetPlayerWantedLevel(playerid) >= 4) {
SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command while you have a warrant (Orange/Red)");
return 1;
}
if(PlayerInfo[playerid][team] != TEAM_MECHANIC) {
SendClientMessage(playerid,COLOR_ERROR,"You are not a mechanic");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid)) {
SendClientMessage(playerid,COLOR_ERROR,"You are not in a vehicle");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
new tofix = GetPlayerVehicleID(playerid);
SetVehicleHealth(tofix, 1000);
SendClientMessage(playerid, 0xA9A9A9AA, "|_Vehicle Engine Repaired_|");
SendClientMessage(playerid, 0x00C7FFAA, "You have fixed your vehicle engine");
fixedcarrecent[playerid] =60;
}
else
SendClientMessage(playerid, COLOR_ERROR, "You need to be driver to fix your own car");
return 1;
}
Re: Help with GetTickCount -
Darrenr - 09.04.2015
What is GetTickCount()? Care to search for the function and show us what it looks like?
Re: Help with GetTickCount -
Muhammad78 - 09.04.2015
I see it from
Here