Confused
#9

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Try this:
pawn Код:
#define PRESSED(%0)     (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_SECONDARY_ATTACK)) enterHouse(playerid);
    return 1;
}

stock enterHouse(playerid)
{
    if(IsPlayerInAnyVehicle(playerid) || pInfo[playerid][pJailTime] > 0) return 1;

    new bool:found = false, houseid = -1;
    for(new i = 0; i < MAX_HOUSES; i ++)
    {
        if(IsValidDynamicCP(hInfo[i][hCPOut]) && IsPlayerInDynamicCP(playerid, hInfo[i][hCPOut]))
        {
            found = true;
            houseid = i;
            break;
        }
    }

    if(found) teleportToHouseInterior(playerid, houseid);
    return 1;
}
Works, thank you!
Reply


Messages In This Thread
Confused - by iFiras - 09.04.2015, 09:06
Re: Confused - by Jimmy0wns - 09.04.2015, 09:09
Re: Confused - by Darrenr - 09.04.2015, 09:18
Re: Confused - by iFiras - 09.04.2015, 09:21
Re: Confused - by Darrenr - 09.04.2015, 09:42
Re: Confused - by Jimmy0wns - 09.04.2015, 09:46
Re: Confused - by iFiras - 09.04.2015, 17:38
Re: Confused - by SickAttack - 09.04.2015, 17:55
Re: Confused - by iFiras - 09.04.2015, 18:38

Forum Jump:


Users browsing this thread: 1 Guest(s)