Pressing Key
#1

Hey guys,

My problem is: if I press the crouch key nothing happens, it should hid all the textdraws. Here is my script:
pawn Код:
if (PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerInRangeOfPoint(playerid,1.0, 286.58, -109.37, 1001.56))
        {
            TogglePlayerControllable(playerid,0);
            SendClientMessage(playerid, COLOR_GREEN, "MP5 $7000");
            ApplyAnimation(playerid,"INT_SHOP","shop_lookB",4.1,1,1,1,1,1,1);

            TextDrawShowForPlayer(playerid, Text:Textdraw0);
            TextDrawShowForPlayer(playerid, Text:Textdraw11);
            TextDrawShowForPlayer(playerid, Text:Textdraw2);
            TextDrawShowForPlayer(playerid, Text:Textdraw3);
            TextDrawShowForPlayer(playerid, Text:Textdraw15);
            TextDrawShowForPlayer(playerid, Text:Textdraw5);
            TextDrawShowForPlayer(playerid, Text:Textdraw6);
            TextDrawShowForPlayer(playerid, Text:Textdraw7);
            TextDrawShowForPlayer(playerid, Text:Textdraw8);
            if (PRESSED(KEY_CROUCH)) // <<<<< This is not working
            {
                TogglePlayerControllable(playerid,1);
                TextDrawHideForPlayer(playerid, Text:Textdraw0);
                TextDrawHideForPlayer(playerid, Text:Textdraw11);
                TextDrawHideForPlayer(playerid, Text:Textdraw2);
                TextDrawHideForPlayer(playerid, Text:Textdraw3);
                TextDrawHideForPlayer(playerid, Text:Textdraw15);
                TextDrawHideForPlayer(playerid, Text:Textdraw5);
                TextDrawHideForPlayer(playerid, Text:Textdraw6);
                TextDrawHideForPlayer(playerid, Text:Textdraw7);
                TextDrawHideForPlayer(playerid, Text:Textdraw8);
            }

        }
Reply
#2

Are you pressing KEY_SECONDARY_ATTACK while pressing KEY_CROUCH? This is what your script shows that you are trying to do. Put the KEY_CROUCH code at a higher level and it should work.
Reply
#3

//Remove
Reply
#4

It's not working, this is what I have:
pawn Код:
if (PRESSED(KEY_SECONDARY_ATTACK))
    {
        if (PRESSED(KEY_CROUCH)) // <<<<< This is not working.
        {
            TogglePlayerControllable(playerid,1);
            TextDrawHideForPlayer(playerid, Text:Textdraw0);
            TextDrawHideForPlayer(playerid, Text:Textdraw11);
            TextDrawHideForPlayer(playerid, Text:Textdraw2);
            TextDrawHideForPlayer(playerid, Text:Textdraw3);
            TextDrawHideForPlayer(playerid, Text:Textdraw15);
            TextDrawHideForPlayer(playerid, Text:Textdraw5);
            TextDrawHideForPlayer(playerid, Text:Textdraw6);
            TextDrawHideForPlayer(playerid, Text:Textdraw7);
            TextDrawHideForPlayer(playerid, Text:Textdraw8);
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0, 286.58, -109.37, 1001.56))
        {
            TogglePlayerControllable(playerid,0);
            SendClientMessage(playerid, COLOR_GREEN, "MP5 $7000");
            ApplyAnimation(playerid,"INT_SHOP","shop_lookB",4.1,1,1,1,1,1,1);

            TextDrawShowForPlayer(playerid, Text:Textdraw0);
            TextDrawShowForPlayer(playerid, Text:Textdraw11);
            TextDrawShowForPlayer(playerid, Text:Textdraw2);
            TextDrawShowForPlayer(playerid, Text:Textdraw3);
            TextDrawShowForPlayer(playerid, Text:Textdraw15);
            TextDrawShowForPlayer(playerid, Text:Textdraw5);
            TextDrawShowForPlayer(playerid, Text:Textdraw6);
            TextDrawShowForPlayer(playerid, Text:Textdraw7);
            TextDrawShowForPlayer(playerid, Text:Textdraw8);
        }
Reply
#5

pawn Код:
if (PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerInRangeOfPoint(playerid,1.0, 286.58, -109.37, 1001.56))
        {
            TogglePlayerControllable(playerid,0);
            SendClientMessage(playerid, COLOR_GREEN, "MP5 $7000");
            ApplyAnimation(playerid,"INT_SHOP","shop_lookB",4.1,1,1,1,1,1,1);

            TextDrawShowForPlayer(playerid, Text:Textdraw0);
            TextDrawShowForPlayer(playerid, Text:Textdraw11);
            TextDrawShowForPlayer(playerid, Text:Textdraw2);
            TextDrawShowForPlayer(playerid, Text:Textdraw3);
            TextDrawShowForPlayer(playerid, Text:Textdraw15);
            TextDrawShowForPlayer(playerid, Text:Textdraw5);
            TextDrawShowForPlayer(playerid, Text:Textdraw6);
            TextDrawShowForPlayer(playerid, Text:Textdraw7);
            TextDrawShowForPlayer(playerid, Text:Textdraw8);
        }
    }
    if (PRESSED(KEY_CROUCH)) // <<<<< This is not working
    {
        TogglePlayerControllable(playerid,1);
        TextDrawHideForPlayer(playerid, Text:Textdraw0);
        TextDrawHideForPlayer(playerid, Text:Textdraw11);
        TextDrawHideForPlayer(playerid, Text:Textdraw2);
        TextDrawHideForPlayer(playerid, Text:Textdraw3);
        TextDrawHideForPlayer(playerid, Text:Textdraw15);
        TextDrawHideForPlayer(playerid, Text:Textdraw5);
        TextDrawHideForPlayer(playerid, Text:Textdraw6);
        TextDrawHideForPlayer(playerid, Text:Textdraw7);
        TextDrawHideForPlayer(playerid, Text:Textdraw8);
    }
This?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)