24.06.2016, 20:11
I have this /vfixveh script, which works fine apart from the last timer not working.
here is the code:
the red part of the code does not work - the timer never shows.
here is the code:
Код:
CMD:vfixveh(playerid, params[]) { new vip[MAX_PLAYER_NAME], string[128], Float:health; new FVTime = tickcount() - 180000; FixvehTimer[playerid] = GetTickCount(); TimerInfo[playerid][CMD_vfixveh] = tickcount(); if(Player[playerid][pVip] < 2) { SCM(pid, ADMIN_COLOR, ADMIN_MESSAGE); return 1; } new vehicleid = GetPlayerVehicleID(playerid); new vehicleHp = GetVehicleHealth(playerid, health); GetPlayerName(playerid, vip, sizeof(vip)); if(vehicleHp == 1000) { SCM(pid, ADMIN_COLOR, " Your vehicle is already at full hp!"); return 1; } if(!IsPlayerInAnyVehicle(playerid)) { SCM(pid, ADMIN_COLOR, " You are not in any vehicle."); FVTime = tickcount() - 180000; return 1; } if( GetTickCount() - FixvehTimer[playerid] < 180000 ) { RepairVehicle(vehicleid); SCM(pid, -1, " {74FF5C}You have fixed your vehicle! You'll be able to use this command again after 3 minutes."); format(string, sizeof(string), "{EB4255}[VIP CMD] VIP Player %s has repaired his vehicle.", vip); SendManagerMessage(-1, string); SetTimerEx("EndFixvehTimer", 180000, false, "i", playerid); return 1; } else { if(FVTime < TimerInfo[playerid][CMD_vfixveh]) { SCM(pid, -1, "{F71B9C} You can only use this command every 3 minutes."); return 1; } } return 1; }