25.06.2016, 04:15
try this
PHP код:
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) return SCM(pid, ADMIN_COLOR, ADMIN_MESSAGE);
new vehicleid = GetPlayerVehicleID(playerid);
new vehicleHp = GetVehicleHealth(playerid, health);
GetPlayerName(playerid, vip, sizeof(vip));
if(vehicleHp == 1000) return SCM(pid, ADMIN_COLOR, " Your vehicle is already at full hp!");
if(!IsPlayerInAnyVehicle(playerid))
{
SCM(pid, ADMIN_COLOR, " You are not in any vehicle.");
FVTime = tickcount() - 180000;
return 1;
}
else 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;
}