changing CMD: to Key
#2

pawn Код:
// At the top of script under includes:

#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

// Under below public, if you don't have replace with OnPlayerStateChange();

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    if(PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pFaction] == 1)
            {
                if(IsLSPDDoorOpen == 0)
                {
                    MoveDynamicObject(lspddoor1, 248.35150146484, 72.547714233398, 1002.640625, 1.50);
                    MoveDynamicObject(lspddoor2, 243.03300476074, 72.547714233398, 1002.640625, 1.50);
                    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
                    format(string, sizeof(string), "* %s slides their card and opens the door", name);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    IsLSPDDoorOpen = 1;
                }
                else
                {
                    IsLSPDDoorOpen = 0;
                    MoveDynamicObject(lspddoor1, 246.35150146484, 72.547714233398, 1002.640625, 1.50);
                    MoveDynamicObject(lspddoor2, 245.03300476074, 72.568511962891, 1002.640625, 1.50);
                    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
                    format(string, sizeof(string), "* %s slides their card and closes the door", name);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    IsLSPDDoorOpen = 0;
                }
            }
        }
    }
    return 1;
}
- I made in case if he press Enter. You can change by search on Keys on Wiki SA-MP.
Reply


Messages In This Thread
changing CMD: to Key - by davidstyle1125 - 08.12.2014, 16:37
Re: changing CMD: to Key - by HY - 08.12.2014, 17:00
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:15
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:19
Re: changing CMD: to Key - by Clad - 08.12.2014, 17:30
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:35
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:58
Re: changing CMD: to Key - by Rifa4life - 08.12.2014, 18:24
Re: changing CMD: to Key - by DaniceMcHarley - 09.12.2014, 06:46
Re: changing CMD: to Key - by davidstyle1125 - 09.12.2014, 11:37

Forum Jump:


Users browsing this thread: 3 Guest(s)