exithouse command not working
#1

Hello everyone.

I made this command and for some reason it doesn't work, instead of exiting you outside your house, it takes you to the co-ordinates 0.00, 0.00, 0.00 (BlueBerry Acres).


pawn Код:
COMMAND:exithouse(playerid, params[])
{
    new HouseID;
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    // Set the position of the player at the entrance of his house
    SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]);
    APlayerData[playerid][CurrentHouse] = 0;

    if (ExitHouseTimer > 0)
    {
        TogglePlayerControllable(playerid, 0);
        GameTextForPlayer(playerid, "Loading, ExitHouseTimer, 4);
        SetTimerEx("
House_ExitTimer", ExitHouseTimer, false, "ii", playerid, HouseID);
    }
    return 1;
}
Reply
#2

Totally i see some wrong here

pawn Код:
GameTextForPlayer(playerid, "Loading, ExitHouseTimer, 4);
it must be like this

pawn Код:
GameTextForPlayer(playerid, word, time, fontstyle);
you also miss the " quote. so it will cause errors.
Reply
#3

try manually add the cordinates or make a callback for you remember player position i cant see getplayerpos just saying
Reply
#4

It was supposed to be like this.

pawn Код:
GameTextForPlayer(playerid, "Loading", ExitHouseTimer, 4);
Also ExitHouseTimer is placed at the top of my script as.
pawn Код:
new ExitHouseTimer = 1000;
Reply
#5

I think that [HouseX] [HouseY] and [HouseY] is inside the house,becouse if you are inside of house and set virtualworld and interior to 0 the interior will disapear.
Lock for hInfo our HouseInfo and you will find HouseY,HouseX,HouseZ and you need to have and something like
HouseExitY,HouseExitX,HouseExitZ or hExit..
Reply
#6

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
I think that [HouseX] [HouseY] and [HouseY] is inside the house,becouse if you are inside of house and set virtualworld and interior to 0 the interior will disapear.
Lock for hInfo our HouseInfo and you will find HouseY,HouseX,HouseZ and you need to have and something like
HouseExitY,HouseExitX,HouseExitZ or hExit..
stop posting just to increase post number because its exithouse comand its not saving coordinates
Reply
#7

Fixed it by adding this.

pawn Код:
HouseID = APlayerData[playerid][CurrentHouse];
Thanks for the help anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)