SA-MP Forums Archive
Enter House command isn't working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Enter House command isn't working (/showthread.php?tid=288408)



Enter House command isn't working - Luis- - 07.10.2011

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.


Re: Enter House command isn't working - Luis- - 07.10.2011

Need this fixed ASAP :S.


Re: Enter House command isn't working - =WoR=G4M3Ov3r - 07.10.2011

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


Re: Enter House command isn't working - Kush - 07.10.2011

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...


Re: Enter House command isn't working - =WoR=G4M3Ov3r - 07.10.2011

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.


Re: Enter House command isn't working - Luis- - 07.10.2011

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.


Re: Enter House command isn't working - Luis- - 07.10.2011

Anyone?


Re: Enter House command isn't working - PowerPC603 - 07.10.2011

Try setting the interior first, then the coordinates.


Re: Enter House command isn't working - AndreT - 07.10.2011

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.


Re: Enter House command isn't working - Fire_Shark - 07.04.2017

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