Toll wont open
#1

Hello.

I made this CMD so players can open tolls, but when i go and test ingame iots not working...

Closed
Код:
CreateObject(968,2077.0000000,39.4003900,26.3000000,0.0000000,268.0000000,270.0000000); //object(barrierturn)
Open
Код:
CreateObject(968,2077.0000000,39.4000000,26.3000000,0.0000000,0.0000000,272.0000000); //object(barrierturn) (1)
public
Код:
public Toll1()
{
	MoveObject(toll1,2077.0000000,39.4000000,26.3000000, 2.0);
	return 1;
}
CMD
Код:
CMD:toll(playerid,params[])
{
	if(PlayerToPoint(5, playerid,2077.0000000,39.4000000,26.3000000))
	{
		MoveObject(toll1,2077.0000000,39.4000000,26.3000000, 2.0);
		SetTimer("Toll1", 5000, 0);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Plativte patarina -50.");
		GivePlayerMoney(playerid,-50);
	}
}
Reply
#2

Код:
new toll1; // put this on top of the script after defines and includes


toll1 = CreateObject....
You can not move object which hasn't the ID
Reply
#3

Quote:
Originally Posted by TokicMajstor
Посмотреть сообщение
Код:
new toll1; // put this on top of the script after defines and includes


toll1 = CreateObject....
You can not move object which hasn't the ID
Yep, i have that on top of the script and i have toll1 = ...
Reply
#4

Oh I actually found out what is wrong. You are moving it to same pos. Idk what is toll but if you're trying to change object rotation you can't use moveobject there's another function give me a sec
Reply
#5

Just after speed in move object (you last parameter) add the rotations but it will not move smoothly it will just change rotation to that one
Reply
#6

nope its not working
Reply
#7

Man go to map editor and find the open tool pos and closed pos. Paste it into moveobject buuuut past the rotations too
Reply
#8

I fixed it..

I added
Код:
public Toll()
{
	SetObjectRot(toll, 0, -90, 180);
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)