Help with moving gate
#1

Hello community!

I got problem with scripting moving gates, what I want to do is that, when I come near to object and when I press press enter I want that my gate move, so I tried with this code.

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,1566.500000 0,-1704.5999756,3620.5000000) && (PRESSED(KEY_ACTION)))
{
MoveObject(Jail3,1566.5000000,-1704.5999756,3620.5000000 +3.0,0.97);//This will move the gate
}
return 1;
}

But it doesn't work, why not ?
Thanks for help in advance =)
Reply
#2

if you use streamer you must use MoveDynamicObject

or try to Up Speed moving
MoveObject(Jail3,1566.5000000,-1704.5999756,3620.5000000 +3.0,5.00);
Reply
#3

You should use KEY_SECONDARY_ATTACK instead of KEY_ACTION if you want it to work with enter key.
Reply
#4

Thank you, but it was my stupid fault, I entered wrong coordinates at IsPlayerInRangeOfPoint lol -.-'
Reply
#5

IsPlayerInRangeOfPoint is the worst way to do this actually (If you have a lot of gates)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)