#2

pawn Код:
#define FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x0080FFFF
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define IsPlayerNotInVehicle(%0) (!IsPlayerInAnyVehicle(%0))
#include <a_samp>
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Car Fix by pressing 2 to fix your car.");
    print("--------------------------------------\n");

    return 1;

}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
       if(PRESSED(KEY_SUBMISSION))
       {
       new vehicleid = GetPlayerVehicleID(playerid);
       if(IsPlayerInVehicle(playerid, vehicleid))
       {
            SetVehicleHealth(vehicleid,1000.0);
            RepairVehicle(GetPlayerVehicleID(playerid));
            PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have successfully repaired your car!");
       }
}
           if(PRESSED(KEY_ACTION))
           {
           if(IsPlayerNotInVehicle(playerid))
           {
           SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have to be in a car to be able to repair your car!");
       }
    }
}
#endif
Easy enough.
Reply


Messages In This Thread
help - by STONEGOLD - 18.03.2012, 16:07
Re: help - by Ronaldo_raul™ - 18.03.2012, 16:12
Re: help - by Alexy_Dramon - 18.03.2012, 16:13
Re: help - by rati555 - 18.03.2012, 16:14

Forum Jump:


Users browsing this thread: 1 Guest(s)