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

The car should be fixed for all players yea?

pawn Код:
#include <a_samp>

#define CZERWONY 0xFF0000FF
#define ZIELONY 0x00FF00FF

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid))
    {
    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;
    }

    return 1;
}
to

pawn Код:
#include <a_samp>

#define CZERWONY 0xFF0000FF
#define ZIELONY 0x00FF00FF

forward RepairVehicle(playerid);

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid))
    {
        SetTimerEx("RVehicle", 1000, 60000, "i", playerid);
        return 1;
    }

    return 1;
}
public RVehicle(playerid)
{
        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: 3 Guest(s)