#include <a_samp> #pragma tabsize 0 public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys && 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, -1,"Car fixed!"); } } return 1; } |
#include <a_samp>
#define pressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define released(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
//--- [FUNCION ---]
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, -1,"Car fixed!");
}
}
//--- [FUNCION ---]
return true;
}