[HELP] PlayerToPoint bugged? - 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: [HELP] PlayerToPoint bugged? (
/showthread.php?tid=160719)
[HELP] PlayerToPoint bugged? -
Emanuel_Rodriguez - 17.07.2010
ok, I have setup a PlayerToPoint system, and after a couple of hours, the text that needs to show up, tot ell the player what to type to enter (like /enter) does not work. does anyone have a solution to this?
Re: [HELP] PlayerToPoint bugged? -
RyDeR` - 17.07.2010
Don't use PlayerToPoint anymore.
0.3 has IsPlayerInRangeOfPoint.
And PlayerToPoint is no bugged. Maybe you gave wrong coords.
Re: [HELP] PlayerToPoint bugged? -
Emanuel_Rodriguez - 17.07.2010
ive tried everything! heres part of my script
Код:
forward PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z);
public OnPlayerCommandText(playerid, cmdtext[])
{
else if (strcmp("/enter", cmdtext, true) == 0)
{
if(PlayerToPoint(3.0, playerid, 1554.3734,-1675.4396,16.1953)) //LSPD Station
{
GameTextForPlayer(playerid, "~b~ Los Santos Police Department", 3500, 3);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,246.7839,63.9001,1003.6406);
return 1;
}
return 1;
}
else if (strcmp("/exit", cmdtext, true) == 0)
{
if(PlayerToPoint(3.0, playerid, 246.5264,62.6218,1003.6406)) //LSPD Station
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1552.4254,-1675.5154,16.1953);
return 1;
}
return 1;
}
}
return 0;
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}