Move Object - 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: Move Object (
/showthread.php?tid=282922)
Move Object -
[bs]_lancer - 13.09.2011
Hello guys .. i want to ask ... how i can move an object by using the car Horn ? lets say i want to make a gate and it wont open untill i use my car horn and i am next to it.
Re: Move Object -
RelaxCafe - 13.09.2011
Pretty easy mate. First, check your position and the object's, so if you are let's say 4m close and then you honk the horn, the object will move. The horn button may be found on your a_samp.inc. Also check that if the person sounding the horn is in the vehicle.. meaning when you press the button, you must be in the vehicle for the object to move..
Re: Move Object -
[bs]_lancer - 13.09.2011
i understand all this bro! but i want the code! i failed making it
Re : Move Object -
Gagi_Corleone - 13.09.2011
Use this
Put in public OnPlayerKeyStateChange
Код:
if(newkeys == KEY_CROUCH)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"You must be in car");
if(!IsPlayerInRangeOfPoint(playerid, 5.0, x,y,z)) return SendClientMessage(playerid,-1,"Bla bla");//Put coordinates instead of x,y,z
MoveDynamicObject(Put name of that what you put before CreateDynamicGate,x,y,z, fast);//Put gate,x,y,z open gate,and fast
//Other codes
}
Re: Move Object -
[bs]_lancer - 14.09.2011
tnx budd ^^