09.07.2013, 17:05
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 =)
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 =)