09.04.2011, 15:53
Basically i created a lift that should move up and down when you press H but it doesn't happen
here is the code:
here is the code:
pawn Код:
//TOP
new G1;
new G2;
new G3;
new GateState;
public OnGameModeInit()
{
G1 = CreateObject(3626,2229.75585938,950.22705078,8.38761425,0.00000000,0.00000000,180.00000000);
G2 = CreateObject(3626,2229.72460938,953.60375977,8.38761425,0.00000000,0.00000000,0.00000000);
G3 = CreateObject(3626,2229.76245117,946.99987793,8.38761425,0.00000000,0.00000000,179.99993896);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_HORN)
{
if(PlayerToPoint(playerid, 5, 2229.72460938,953.60375977,8.38761425) || PlayerToPoint(playerid, 5, 2229.72460938,953.60351562,13.88761425))
{
if(GateState == 0)
{
MoveObject(G1, 2229.75585938,950.22656250,13.88761425,3);
MoveObject(G2, 2229.72460938,953.60351562,13.88761425,3);
MoveObject(G3, 2229.76171875,946.99902344,13.88761425,3);
GateState = 1;
}
else
{
MoveObject(G1, 2229.75585938,950.22705078,8.38761425,3);
MoveObject(G2, 2229.72460938,953.60375977,8.38761425,3);
MoveObject(G3, 2229.76245117,946.99987793,8.38761425,3);
GateState = 0;
}
}
}
}