SA-MP Forums Archive
Whats wrong with this.... - 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: Whats wrong with this.... (/showthread.php?tid=239334)



Whats wrong with this.... - Jack_Leslie - 13.03.2011

Код:
if(strcmp(cmdtext, "/enter", true, 6) == 0)
{
if(PlayerToPoint(3, playerid, -2455.199951, 2254.000000, 4.980384))
{
SetPlayerInterior(playerid, 2);
SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393); 
return 1;
}
}
undefined symbol "PlayerToPoint"
??


Re: Whats wrong with this.... - Calgon - 13.03.2011

PlayerToPoint is an old and outdated custom function. Use IsPlayerInRangeOfPoint which is a native SA-MP function.

pawn Код:
if(strcmp(cmdtext, "/enter", true) == 0)
{
   if(IsPlayerInRangeOfPoint(playerid, 3, -2455.199951, 2254.000000, 4.980384))
   {
      SetPlayerInterior(playerid, 2);
      SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393);
      return 1;
   }
}



Re: Whats wrong with this.... - davbad1 - 13.03.2011

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Код:
if(strcmp(cmdtext, "/enter", true, 6) == 0)
{
if(PlayerToPoint(3, playerid, -2455.199951, 2254.000000, 4.980384))
{
SetPlayerInterior(playerid, 2);
SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393); 
return 1;
}
}
undefined symbol "PlayerToPoint"
??
its right there at the begining ''if(playertopoint'' you really don't see it?


Re : Whats wrong with this.... - Vukilore - 13.03.2011

try this:
pawn Код:
if(strcmp(cmdtext, "/enter", true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(3, playerid, -2455.199951, 2254.000000, 4.980384))
{
SetPlayerInterior(playerid, 2);
SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393);
return 1;
}
}



Re: Whats wrong with this.... - Jack_Leslie - 13.03.2011

Worked, thanks!


Re: Whats wrong with this.... - ricardo178 - 13.03.2011

Try:
pawn Код:
if(strcmp(cmdtext, "/enter", true, 6) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, -2455.199951, 2254.000000, 4.980384))
    {
        SetPlayerInterior(playerid, 2);
        SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393);
        return 1;
    }
}
NOT TESTED! Test it....