Move Object
#1

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

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

i understand all this bro! but i want the code! i failed making it
Reply
#4

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
}
Reply
#5

tnx budd ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)