SA-MP Forums Archive
KEY_ACTION (with left click) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: KEY_ACTION (with left click) (/showthread.php?tid=414199)



KEY_ACTION (with left click) - Youtube12 - 08.02.2013

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);
}



Re: KEY_ACTION (with left click) - SilverKiller - 08.02.2013

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


Re: KEY_ACTION (with left click) - zde5 - 08.02.2013

https://sampwiki.blast.hk/wiki/GetPlayerKeys


AW: KEY_ACTION (with left click) - Youtube12 - 08.02.2013

Thank you SilverKiller Its works fine for me


AW: KEY_ACTION (with left click) - Youtube12 - 08.02.2013

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.