15.01.2016, 19:34
So, I've almost got this blasted dynamic gate system working, but there's an issue.
The gate will not move, however every print will show up for some odd reason. I'm not exactly sure why that is, but I will REP+++++ you if you can figure this out. Thanks!
PHP код:
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;
}