SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   KEY_ACTION (with left click) (https://forum.sa-mp.com/showthread.php?t=414199)

Youtube12 08/02/2013 03:39 PM

KEY_ACTION (with left click)
 
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:



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


SilverKiller 08/02/2013 03:53 PM

Re: KEY_ACTION (with left click)
 
pawn Code:
KEY_FIRE

For LMB and alt and ctrl (not sure about ctrl).

zde5 08/02/2013 03:58 PM

Re: KEY_ACTION (with left click)
 
http://wiki.sa-mp.com/wiki/GetPlayerKeys

Youtube12 08/02/2013 04:00 PM

AW: KEY_ACTION (with left click)
 
Thank you SilverKiller Its works fine for me :)

Youtube12 08/02/2013 04:48 PM

AW: KEY_ACTION (with left click)
 
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.


All times are GMT. The time now is 07:25 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.