Why this doesn't work?
#1

pawn Код:
if(PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerInRangeOfPoint(playerid,0.5,298.0384, -107.4380, 1001.4934))
        {
            SetPlayerCameraPos(playerid, 297.2552, -105.8125, 1003.5679);
            SetPlayerCameraLookAt(playerid, 297.6054, -106.7477, 1002.9686);
            TogglePlayerControllable(playerid,0);
            if(PRESSED(KEY_YES) && InsideAmmu[playerid] ==1 )
            {
                GivePlayerWeapon(playerid,31,500);
                SetCameraBehindPlayer(playerid);
                TogglePlayerControllable(playerid,1);
            }
            return 1;
        }
Everything works fine except this
pawn Код:
if(PRESSED(KEY_YES) && InsideAmmu[playerid] ==1 )
            {
                GivePlayerWeapon(playerid,31,500);
                SetCameraBehindPlayer(playerid);
                TogglePlayerControllable(playerid,1);
            }
Reply
#2

Are you pressing KEY_SECONDARY_ATTACK and KEY_YES at the same time?
Reply
#3

No...
Reply
#4

Well that's how you've coded it.... You've coded it so you need to press both at the same time if you're in range of that point and "InsideAmmu".
Reply
#5

How can I fix it? I mean, key F to choose and key y to buy.
Reply
#6

else if(...
Reply
#7

This?
pawn Код:
if(PRESSED(KEY_SECONDARY_ATTACK))
{        
    if(IsPlayerInRangeOfPoint(playerid,0.5,298.0384, -107.4380, 1001.4934))        
    {            
        SetPlayerCameraPos(playerid, 297.2552, -105.8125, 1003.5679);            
        SetPlayerCameraLookAt(playerid, 297.6054, -106.7477, 1002.9686);            
        TogglePlayerControllable(playerid,0);            
    }
}
else if(PRESSED(KEY_YES) && InsideAmmu[playerid] ==1 )            
{                
    GivePlayerWeapon(playerid,31,500);                
    SetCameraBehindPlayer(playerid);                
    TogglePlayerControllable(playerid,1);            
}
Reply
#8

No. I tried to make my own ammunation like this.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)