Enter House command isn't working
#1

Hi, I have made a command to enter any house which the player who typed the command is near. Here is the command.
pawn Код:
CMD:enterhouse(playerid, params[])
{
    for(new i=0; i < houses; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hX], HouseInfo[i][hY], HouseInfo[i][hZ]))
        {
            new string[128];
            format(string, sizeof(string), "DEBUG: House Entered: X: %f, Y: %f, Z: %f, Interior: %d.", HouseInfo[i][hIntX], HouseInfo[i][hIntY], HouseInfo[i][hIntZ], HouseInfo[i][hInt]);
            SendClientMessageToAll(COLOR_WHITE, string);
            SetPlayerPos(playerid, HouseInfo[i][hIntX], HouseInfo[i][hIntY], HouseInfo[i][hIntZ]);
            SetPlayerInterior(playerid, HouseInfo[i][hInt]);
        }
    }
    return 1;
}
It for some reason isn't teleporting me to the house coords, it just sends me in the air.
Reply
#2

Need this fixed ASAP :S.
Reply
#3

Why don't you use sscanf ?, won't it be MUCH MUCH easier ?
Reply
#4

Quote:
Originally Posted by =WoR=G4M3Ov3r
Посмотреть сообщение
Why don't you use sscanf ?, won't it be MUCH MUCH easier ?
He doesn't need sscanf in this case...
Reply
#5

Quote:
Originally Posted by Kush
Посмотреть сообщение
He doesn't need sscanf in this case...
Oh, yeah just realized it now misread that

Quote:

DEBUG: House Entered: X: %f, Y: %f, Z: %f

Anyways, did you set the interior for the desired house you wanna teleport to ?, because its basically teleporting you to 0,0,0.
Reply
#6

Yeah, the interior is setting correctly. I have tried setting the players position to The Johnson House and it still teleports me in the air.
Reply
#7

Anyone?
Reply
#8

Try setting the interior first, then the coordinates.
Reply
#9

Well, check your enum output first to see if the output is correct (coordinates and interior). Setting the interior first would help in some cases of lag, yes, and should be a preferred order of things.
Reply
#10

How can i do like thats i click "Y" to start an engine.
and click "N" to get in a house
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)