Problem with RC..HELP
#1

Hello.I got problem with Exploziv RC when player press click(KEY_FIRE) It won`t explode I don`t know why...
Here is part with Explozions
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)
    {
        if(RCXD == 1)
        {
            new Float:burnx, Float:burny, Float:burnz;
            GetPlayerPos(playerid,burnx, burny, burnz);
            CreateExplosion(burnx, burny , burnz, 7,10.0);
            CreateExplosion(burnx, burny , burnz, 7,10.0);
            CreateExplosion(burnx, burny , burnz, 7,10.0);
            SetPlayerPos(playerid, burnx, burny, burnz+2);
            DestroyVehicle(LVehicleID);
            RCXD = 0;
        }
    }
    return 1;
}
Please help me....
Reply
#2

Use ' && ' not ' & '

pawn Код:
if(newkeys && KEY_FIRE)
Reply
#3

Quote:
Originally Posted by vyper
Посмотреть сообщение
Use ' && ' not ' & '

pawn Код:
if(newkeys && KEY_FIRE)
Please learn what & actually does before attempting to help somebody with a scripting issue.

On topic:

Try to change the 7 in CreateExplosion to 6, I've had the same issue with 7 before.
Reply
#4

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Please learn what & actually does before attempting to help somebody with a scripting issue.

On topic:

Try to change the 7 in CreateExplosion to 6, I've had the same issue with 7 before.
I did but still not working Anyone other ??
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Please learn what & actually does before attempting to help somebody with a scripting issue.

On topic:

Try to change the 7 in CreateExplosion to 6, I've had the same issue with 7 before.
Oh sorry
Reply
#6

Are you setting RCXD to 1 before clicking? Otherwise there's no reason why this shouldn't work.
Reply
#7

Try to change

pawn Код:
if(newkeys & KEY_FIRE)
With:


pawn Код:
if (PRESSED(KEY_FIRE))
The define:

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

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Try to change

pawn Код:
if(newkeys & KEY_FIRE)
With:


pawn Код:
if (PRESSED(KEY_FIRE))
The define:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
This won't change anything.
Reply
#9

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
This won't change anything.
I've got the same problem in past and it worked for me.
Reply
#10

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Try to change

pawn Код:
if(newkeys & KEY_FIRE)
With:


pawn Код:
if (PRESSED(KEY_FIRE))
The define:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Not working (
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)