KEY_ACTION (with left click)
#1

Hey guys, when I press Left click on mouse the car is not repaired but when I press "Ctrl/Strg" its work.

I want it with (Left Mouse)

My Code:



Код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))



if(PRESSED(KEY_ACTION)&& IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
 	new Vehicleid, Float:X, Float:Y, Float:Z, Float:Angle;
 	Vehicleid = GetPlayerVehicleID(playerid);
        SetVehicleHealth(Vehicleid,1000);
        RepairVehicle(GetPlayerVehicleID(playerid));
        GetPlayerPos(playerid, X, Y, Z);
  	GetVehicleZAngle(Vehicleid,Angle);
  	SetVehiclePos(Vehicleid, X, Y, Z);
  	SetVehicleZAngle(Vehicleid, Angle);
}
Reply
#2

pawn Код:
KEY_FIRE
For LMB and alt and ctrl (not sure about ctrl).
Reply
#3

https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply
#4

Thank you SilverKiller Its works fine for me
Reply
#5

Guys when I drive a car and press (left mouse) the car will be repaired.


I want it when I drive a car and press (left mouse) the car will not be repaired.
But I want when i stop driving and press (left mouse) the car will be repaired.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)