SA-MP Forums Archive
HouseID - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HouseID (/showthread.php?tid=90822)



HouseID - MPKaboose - 10.08.2009

pawn Код:
stock HouseID(playerid)
{
    new returnid = 1;
    for(new i = 1;i < sizeof(StaticHouse);i ++)
    {
        if(PlayerToPoint(1,playerid,House[i][HD_ExtX],House[i][HD_ExtY],House[i][HD_ExtZ]))
        {
            returnid = i;
        }
    }
    return returnid;
}
the problem is that even if the player is near that point the PlayerToPoint doesn't detect it, the PlayerToPoint is not modified any ideas what might be the problem?


Re: HouseID - MPKaboose - 10.08.2009

yes I know I double posted because my post was way back in the tread,
I found out that GetPlayerPos is not working
Код:
[02:09:30] *P:2.500000|-2398.157470|2408.808349|8.911000|U:0.000000|0.000000|0.000000
[02:09:30] *P:2.500000|-2381.871093|2406.493408|8.892100|U:0.000000|0.000000|0.000000
[02:09:30] *P:2.500000|-2348.713378|2423.021728|7.339900|U:0.000000|0.000000|0.000000
[02:09:30] *P:2.500000|-2344.023681|2439.079589|7.304699|U:0.000000|0.000000|0.000000
[02:09:30] *P:2.500000|-2437.513183|2354.932617|5.443099|U:0.000000|0.000000|0.000000
[02:09:30] *P:2.500000|-2428.563476|2368.266113|5.443699|U:0.000000|0.000000|0.000000
[02:09:30] *P:2.500000|-2385.418457|2217.146240|4.984399|U:0.000000|0.000000|0.000000
radius,pickup x,pickup y,pickup z,user x,user y,user z
P: is the pickups coordinate U: is the players coordinate you can see that it's 0.000000 I don't know the reason why this is happening


Re: HouseID - MadeMan - 10.08.2009

If you mean that GetPlayerPos under PlayerToPoint don't work then maybe show your PlayerToPoint function.


Re: HouseID - MPKaboose - 10.08.2009

pawn Код:
stock IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
{
    new Float:px,Float:py,Float:pz;
    GetPlayerPos(playerid,px,py,pz);
    //printf("*P:%f|%f|%f|%f|U:%f|%f|%f",range,x,y,z,px,py,pz);
    px -= x;
    py -= y;
    pz -= z;
    return ((px * px) + (py * py) + (pz * pz)) < (range * range);
}



Re: HouseID - JaTochNietDan - 10.08.2009

You're using

pawn Код:
if(PlayerToPoint(1,playerid,House[i][HD_ExtX],House[i][HD_ExtY],House[i][HD_ExtZ]))
It should be

pawn Код:
if(PlayerToPoint(playerid,1,House[i][HD_ExtX],House[i][HD_ExtY],House[i][HD_ExtZ]))



Re: HouseID - James_Alex - 10.08.2009

Quote:
Originally Posted by JaTochNietDan
You're using

pawn Код:
if(PlayerToPoint(1,playerid,House[i][HD_ExtX],House[i][HD_ExtY],House[i][HD_ExtZ]))
It should be

pawn Код:
if(PlayerToPoint(playerid,1,House[i][HD_ExtX],House[i][HD_ExtY],House[i][HD_ExtZ]))
i think
pawn Код:
if(PlayerToPoint(1,playerid,House[i][HD_ExtX],House[i][HD_ExtY],House[i][HD_ExtZ]))
is correct !!


Re: HouseID - MPKaboose - 10.08.2009

ahm GetPlayerPos(...); is not working


Re: HouseID - MPKaboose - 11.08.2009

GetPlayerPos(..); is not working at all where ever I put it now wth is happening, please help