The vehicle can be repaired every 60 seconds. Help!
#8

pawn Код:
#include <a_samp>

new LastRepair[MAX_PLAYERS];

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SUBMISSION && !GetPlayerVehicleSeat(playerid))
    {
        if((gettime()-LastRepair[playerid]) < 20)
        {
            //Here you can send a message saying that you need to wait before repairing again or whatever you want
            return 1;
        }
        LastRepair[playerid] = gettime();
        new currentveh; // flip
        new Float:angle; // flip
        currentveh = GetPlayerVehicleID(playerid); // flip
        GetVehicleZAngle(currentveh, angle); // flip
        SetVehicleZAngle(currentveh, angle); // flip
        SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
        RepairVehicle(GetPlayerVehicleID(playerid));
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)