SA-MP Forums Archive
Mouse 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mouse left click (/showthread.php?tid=272770)



Mouse left click - OUL - 29.07.2011

I use callback OnPlayerKeyStateChange and i don't know what is 'left mouse' buttom i was try with KEY_ACTION but it isn't


Re: Mouse left click - Fj0rtizFredde - 29.07.2011

It's KEY_FIRE.


Re: Mouse left click - OUL - 29.07.2011

I try with

pawn Код:
if(PRESSED(KEY_FIRE))
But still dosen't work :-/


Re: Mouse left click - Guest3598475934857938411 - 30.07.2011

Is it giving you any form of error or warning also besides
Код:
if(PRESSED(KEY_FIRE))
you got to have like this if you didn't make it.
Код:
if(PRESSED(KEY_FIRE))
{
//Do something here.
}



Re: Mouse left click - Lorenc_ - 30.07.2011

pawn Код:
#define HOLDING(%0)                 ((newkeys & (%0)) == (%0))
#define PRESSED(%0)                 (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Make sure you have these, otherwise, no it will not work.

As expertprogrammar said ^


Re: Mouse left click - OUL - 30.07.2011

@expertprogrammer - OMG lol i know i just give example

@Lorenc_ - i know i use PRESSED macro from wiki


Re: Mouse left click - OUL - 30.07.2011

bump


Re: Mouse left click - MadeMan - 30.07.2011

Show your code.


Respuesta: Mouse left click - Alex_Obando - 30.07.2011

pawn Код:
#define HOLDING(%0)                 ((newkeys & (%0)) == (%0))
#define PRESSED(%0)                 (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#include <a_samp>
#define FILTERSCRIPT

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
    if(PRESSED(KEY_FIRE))
    SendClientMessageToAll(0xDEEE20FF, "Hello.");{}}



Re: Respuesta: Mouse left click - emokidx - 30.07.2011

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
pawn Код:
#define HOLDING(%0)                 ((newkeys & (%0)) == (%0))
#define PRESSED(%0)                 (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#include <a_samp>
#define FILTERSCRIPT

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
    if(PRESSED(KEY_FIRE))
    SendClientMessageToAll(0xDEEE20FF, "Hello.");{}}
i thought that expertprogrammer said to do it like this ._.

pawn Код:
if(PRESSED(KEY_FIRE))
{
    SendClientMessageToAll(0xDEEE20FF, "Hello.");
}



Re: Mouse left click - eDz0r - 30.07.2011

man... don't wait us to put "food in your mounth" try to search and learn.....
Try This


Re: Mouse left click - OUL - 31.07.2011

My code

pawn Код:
if(PRESSED(KEY_FIRE))
    {
       if(GetPlayerWeapon(playerid) == 40)
       {
          if(BombUgradio[playerid][2] == true)
          {
              BombUgradio[playerid][1] = false;
              BombUgradio[playerid][2] = false;
              BombCar[1][BombVehicle[playerid]] = false;
              BombCar[2][BombVehicle[playerid]] = false;
              new Float:Pos[4];
              GetVehiclePos(BombVehicle[playerid], Pos[1], Pos[2], Pos[3]);
              CreateExplosion(Pos[1],Pos[2],Pos[3], 6, 7.0);
              SetVehicleHealth(BombVehicle[playerid], 0.0);
              BombVehActive[BombVehicle[playerid]] = false;
              BombVehicle[playerid] = -1;
              SCM(playerid, ""#hex_zuta"INFO: Aktivirali ste bombu vozilo je eksplodiralo.");
          }
       }
    }