Facing Problem with OnPlayerKeyStateChange
#1

pawn Код:
if(newkeys == KEY_HANDBRAKE)
        {
                if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 476)
        {
            return SendClientMessage(playerid, 0xFF0000AA, "You entered in a Bomber plane press SPACE to drop bomb.");
        }
    else
        {
            new Float:VBPos[3];
            GetVehiclePos(GetPlayerVehicleID(playerid),VBPos[0],VBPos[1],VBPos[2]);
            MapAndreas_FindZ_For2DCoord(VBPos[0], VBPos[1], VBPos[2]);
            CreateExplosion(VBPos[0], VBPos[1], VBPos[2], 7, 20.0);
        }
                return 1;
        }
It's not giving error or warning......When i tested at Test Server was working fine but when i added in Host >.> it was not working Can anybody help me please?
Reply
#2

What host are you using?

Are you sure it's working in your home test server?
Reply
#3

You are checking for keypresses improperly.

pawn Код:
if(newkeys == KEY_HANDBRAKE)
That would only work if you only pressed that key an no others which can be useful in some cases you want to use this.

pawn Код:
if(newkeys & KEY_HANDBRAKE)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)