Mouse left click
#1

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

It's KEY_FIRE.
Reply
#3

I try with

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

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.
}
Reply
#5

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 ^
Reply
#6

@expertprogrammer - OMG lol i know i just give example

@Lorenc_ - i know i use PRESSED macro from wiki
Reply
#7

bump
Reply
#8

Show your code.
Reply
#9

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.");{}}
Reply
#10

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.");
}
Reply
#11

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

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.");
          }
       }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)