PlayerToPoint Problom.
#1

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.
Reply
#2

GetPlayerScore or GetPlayerMoney :P ?
Reply
#3

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
Reply
#4

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

Edit: sorry edited.answer was sick
Reply
#6

?
Reply
#7

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;
}
Reply
#8

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
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)