SA-MP Forums Archive
Toll wont open - 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)
+--- Thread: Toll wont open (/showthread.php?tid=663912)



Toll wont open - Dimkata - 14.02.2019

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);
	}
}



Re: Toll wont open - TokicMajstor - 14.02.2019

Код:
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


Re: Toll wont open - Dimkata - 14.02.2019

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 = ...


Re: Toll wont open - TokicMajstor - 14.02.2019

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


Re: Toll wont open - TokicMajstor - 14.02.2019

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


Re: Toll wont open - Dimkata - 15.02.2019

nope its not working


Re: Toll wont open - TokicMajstor - 15.02.2019

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


Re: Toll wont open - Dimkata - 15.02.2019

I fixed it..

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