command(gate, playerid, params[])
{
new string[128];
for(new i = 0; i < MAX_GATES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, Gates[i][GateRange], Gates[i][GateX], Gates[i][GateY], Gates[i][GateZ]))
{
print("0");
if(Gates[i][UseF] >= 1) return 1;
print("1");
if(Gates[i][GateStatus] == 0)
{
print("2");
MoveDynamicObject(Gates[i][GateID], Gates[i][GateXM], Gates[i][GateYM], Gates[i][GateZM], Gates[i][GateSpeed], Gates[i][GateRXM], Gates[i][GateRYM], Gates[i][GateRZM]);
Gates[i][GateStatus] = 1;
format(string, sizeof(string), "%s uses their remote to open the gates.", GetName(playerid));
SetPlayerChatBubble(playerid, string, PURPLE, 15.0, 5000);
}
else if(Gates[i][GateStatus] == 1)
{
print("3");
MoveDynamicObject(Gates[i][GateID], Gates[i][GateX], Gates[i][GateY], Gates[i][GateZ], Gates[i][GateSpeed], Gates[i][GateRX], Gates[i][GateRY], Gates[i][GateRZ]);
Gates[i][GateStatus] = 0;
format(string, sizeof(string), "%s uses their remote to close the gates.", GetName(playerid));
SetPlayerChatBubble(playerid, string, PURPLE, 15.0, 5000);
}
else
{
return 1;
}
}
}
return 1;
}
MoveDynamicObject(Gates[i][GateID], Gates[i][GateXM], Gates[i][GateYM], Gates[i][GateZM]-5, Gates[i][GateSpeed], Gates[i][GateRXM], Gates[i][GateRYM], Gates[i][GateRZM]);
It's because of the fact that you're not actually moving it downwards, or setting the Z position lower than the original position.
Код:
MoveDynamicObject(Gates[i][GateID], Gates[i][GateXM], Gates[i][GateYM], Gates[i][GateZM]-5, Gates[i][GateSpeed], Gates[i][GateRXM], Gates[i][GateRYM], Gates[i][GateRZM]); |