/exit for house not working well.
#1

And hey again. With your help i fixed /buyhouse and /enter, but .exit is saying me i am not near any exit...

Enter cmd that works in every house:

pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -2161.4656,-2384.8584,30.8584))//SHeriff's Department
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine Sheriff's Department.");
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid, 246.375991,109.245994,1003.218750);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -2144.0066,-2425.5754,30.6250))//Bank
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine Bank.");
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 2315.952880,-1.618174,26.742187);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -2093.7673,-2464.8574,30.6250))//Ammu-Nation
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine Ammu-Nation.");
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -2178.0242,-2400.4663,30.6250))//24/7
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine 24/7.");
        SetPlayerInterior(playerid, 17);
        SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -2079.3682,-2447.9111,30.6250))//News
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine News Reporters Department.");
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid, -2029.798339,-106.675910,1035.171875);
        return 1;
    }
    for(new i = 1; i < sizeof(HouseInfo); i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[i][X], HouseInfo[i][Y], HouseInfo[i][Z]))
        {
            if(HouseInfo[i][Lock] == 0)
            {
                SetPlayerPos(playerid, HouseInfo[i][IntX], HouseInfo[i][IntY], HouseInfo[i][IntZ]);
                SetPlayerInterior(playerid, HouseInfo[i][Int]);
                SetPlayerVirtualWorld(playerid, HouseInfo[i][Vw]);
                new Float:px, Float:py, Float:pz;
                GetPlayerPos(playerid, px, py, pz);
                new Name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, Name, sizeof(Name));
                format(file, sizeof(file), "RRP/users/%s.ini", Name);
                if(fexist(file))
                {
                    dini_FloatSet(file, "OutHousePosX", Float:px);
                    dini_FloatSet(file, "OutHousePosY", Float:py);
                    dini_FloatSet(file, "OutHousePosZ", Float:pz);
                }
                return 1;
            }
            else return SendClientMessage(playerid, 0xFFFFFFFF, "This house is locked.");
        }
    }
    return 0;
}
And the Exit one that says i am not near any exit..

pawn Код:
CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 246.375991,109.245994,1003.218750))//SHeriff's Department
    {  
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine.");
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, -2161.4656,-2384.8584,30.8584);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 2315.952880,-1.618174,26.742187))//Bank
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine.");
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, -2144.0066,-2425.5754,30.6250);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 286.148986,-40.644397,1001.515625))//Ammu-Nation
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine.");
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, -2093.7673,-2464.8574,30.6250);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -25.884498,-185.868988,1003.546875))//24/7
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine.");
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, -2178.0242,-2400.4663,30.6250);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -2029.798339,-106.675910,1035.171875))//News
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Welcome to the Angel Pine.");
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, -2079.3682,-2447.9111,30.6250);
        return 1;
    }
    for(new i = 1; i < sizeof(HouseInfo); i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][IntX], HouseInfo[i][IntY], HouseInfo[i][IntZ]))
        {
            new Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Name, sizeof(Name));
            format(file, sizeof(file), "RRP/users/%s.ini", Name);
            if(fexist(file))
            {
                PlayerInfo[playerid][OutHousePosX] = dini_Int(file, "OutHousePosX");
                PlayerInfo[playerid][OutHousePosY] = dini_Int(file, "OutHousePosY");
                PlayerInfo[playerid][OutHousePosZ] = dini_Int(file, "OutHousePosZ");
            }
            SetPlayerPos(playerid, PlayerInfo[playerid][OutHousePosX], PlayerInfo[playerid][OutHousePosY], PlayerInfo[playerid][OutHousePosZ]);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0);
        }
    }
    return 0;
}
Thanks.
Reply
#2

Try returning it to 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)