SA-MP Forums Archive
PlayerToPoint Problom. - 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: PlayerToPoint Problom. (/showthread.php?tid=86979)



PlayerToPoint Problom. - stieben - 17.07.2009

My fellow citizens,

I have a PlayerToPoint probl.

On top.
Код:
new PlayerToPointFenceTest;
forward PlayerToFence(playerid);
OnGameModeInit
Код:
SetTimer("PlayerToFence", 1000, 1);
PlayerToPointFenceTest = CreateDynamicObject(971, 2038.736206, 1344.095581, 14.241793, 0.0000, 0.0000, 270.0000);
On Bottom
Код:
public PlayerToFence(playerid)
{
  if(PlayerToPoint(2.0, playerid, 2038.736206, 1344.095581, 14.241793))
  {
    if(GetPlayerScore(playerid) > 200)
    {
      GameTextForPlayer(playerid, "Test Kompletet", 5000, 5);
      MoveDynamicObject(PlayerToPointFenceTest, 2036.600708, 1331.700439, 14.390229, 0.0000);
		}
	}
	else
	{
	  if(GetPlayerScore(playerid) < 200)
	  {
    	GameTextForPlayer(playerid, "Dude, You Need $200 To Complete The Test!", 5000, 5);
		}
	}
	return 1;
}
I have no errors, but the script doesn't work properly. When I have less than $200 it constantly says "Dude, You Need $200 To Complete The Test!". And when I have $200 or more it stops saying that but nothing else happens. So the fence won't move. My test has failed

Please help me out of this pit.

Thanks in advance.


Re: I need serious help! - UsaBoy91 - 17.07.2009

GetPlayerScore or GetPlayerMoney :P ?


Re: I need serious help! - stieben - 17.07.2009

Ya, I have a system so my ammount of money is also my score, but I get no errors. I only doesn't work like I want


Re: H-H-HEEEEEEELP!!! - stieben - 17.07.2009

So, does anyone know how I can get it to work?


Re: PlayerToPoint Problom. - Jimmy1 - 17.07.2009

Edit: sorry edited.answer was sick


Re: PlayerToPoint Problom. - stieben - 17.07.2009

?


Re: PlayerToPoint Problom. - M4S7ERMIND - 17.07.2009

Your code has one bracket in wrong place, heres the correct code:

Код:
public PlayerToFence(playerid)
{
  if(PlayerToPoint(2.0, playerid, 2038.736206, 1344.095581, 14.241793))
  {
    if(GetPlayerScore(playerid) >= 200)
    {
      GameTextForPlayer(playerid, "Test Kompletet", 5000, 5);
      MoveDynamicObject(PlayerToPointFenceTest, 2036.600708, 1331.700439, 14.390229, 0.0000);

	}
	else if(GetPlayerScore(playerid) < 200)
	{
    	GameTextForPlayer(playerid, "Dude, You Need $200 To Complete The Test!", 5000, 5);
	}
  }
  return 1;
}



Re: PlayerToPoint Problom. - stieben - 18.07.2009

I works. It says the messages at the right time and place, BUT the object won't move. Please if someone can fix that, you made my day


Re: PlayerToPoint Problom. - stieben - 18.07.2009

Hey guys, I fixed it myself. I only needed to add a speed to the code since that was still on 0.0000