Entering a building with "ENTER"
#1

Okay, I want to enter Buildings with "KEY_ACTION" aka "enter/return" but it just does not work,

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == (KEY_ACTION))
    {
        if (IsPlayerInRangeOfPoint(playerid, 5.0, 1172.6040,-1325.2792,15.4032))
        {
            SendClientMessage(playerid, COLOR_RED, "EMS is not avaliable at this time");
        }
        else if (IsPlayerInRangeOfPoint(playerid, 5.0, 1128.8011,-1271.1749,13.5469))
        {
            SendClientMessage(playerid, COLOR_WHITE, "Welcome to the 24/7");
            SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
            SetPlayerInterior(playerid, 17);
        }
        else if (IsPlayerInRangeOfPoint(playerid, 5.0, 1836.2455, -1682.4979, 13.3560))
        {
            SendClientMessage(playerid, COLOR_WHITE, "Welcome to Alhambra, Dont get to drunk!");
            SetPlayerPos(playerid, 493.390991,-22.722799,1000.679687);
            SetPlayerInterior(playerid, 17);
        }
        else if (IsPlayerInRangeOfPoint(playerid, 5.0, 1642.2997, -2334.3645, 13.5469))
        {
            SetPlayerPos(playerid, -1825.6872558594, 81.687927246094, 1079.0961914063);
            SetPlayerInterior(playerid, 0);
            SendClientMessage(playerid, COLOR_WHITE, "Welcome too the Baggage Raclaim point, Dont leave you luggage!");
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You are not near any enterable Buildings");
        }
        return 1;
    }
    else
    {
        if (IsPlayerInRangeOfPoint(playerid, 5.0, 1172.6040,-1325.2792,15.4032))
        {
            SendClientMessage(playerid, COLOR_RED, "EMS is not avaliable at this time");
            SetPlayerInterior(playerid, 0);
        }
        else if (IsPlayerInRangeOfPoint(playerid, 5.0, -25.884498,-185.868988,1003.546875))
        {
            SetPlayerPos(playerid, 1128.8011,-1271.1749,13.5469);
            SetPlayerInterior(playerid, 0);
        }
        else if (IsPlayerInRangeOfPoint(playerid, 5.0, 493.390991,-22.722799,1000.679687))
        {
            SetPlayerPos(playerid, 1836.2455, -1682.4979, 13.3560);
            SetPlayerInterior(playerid, 0);
        }
        else if (IsPlayerInRangeOfPoint(playerid, 5.0, -1825.6872558594, 81.687927246094, 1079.0961914063))
        {
            SetPlayerPos(playerid, 1642.2997, -2334.3645, 13.5469);
            SetPlayerInterior(playerid, 0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You have not entered any Buildings that require you to Exit");
        }
        return 1;
    }

    return 1;
}
Please help me.
Reply
#2

Try if(newkeys & KEY_SECONDARY_ATTACK)
Reply
#3

Thank you that fixed that, Now when I enter it TP's me right back outside?
Reply
#4

Sorry for this bump but I would really like this fixed soon as..
Reply
#5

I have tried that it did not work?
Reply
#6

Enter Position
pawn Код:
else if (IsPlayerInRangeOfPoint(playerid, 5.0, 1128.8011,-1271.1749,13.5469))
        {
            SendClientMessage(playerid, COLOR_WHITE, "Welcome to the 24/7");
            SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
            SetPlayerInterior(playerid, 17);
        }
Exit Position
pawn Код:
else if (IsPlayerInRangeOfPoint(playerid, 5.0, -25.884498,-185.868988,1003.546875))
        {
            SetPlayerPos(playerid, 1128.8011,-1271.1749,13.5469);
            SetPlayerInterior(playerid, 0);
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)