01.09.2010, 12:57
Maybe because the variable objectid is empty ?
and why does gatecheck even have a parameter?
Your problem was that you put objectid in SetTimerEx but in objectid was nothing saved
So you only need to put lspdg1 / lspdg2 instead of objectid in there
And here your code reworked since you checked for the area twice
And to the question why MoveObject is in SetTimerEx, MoveObject returns the time it will take for the object to move in milliseconds plus 2 seconds to stay opend
and why does gatecheck even have a parameter?
Your problem was that you put objectid in SetTimerEx but in objectid was nothing saved
So you only need to put lspdg1 / lspdg2 instead of objectid in there
And here your code reworked since you checked for the area twice
pawn Код:
forward gatecheck();
public gatecheck()
{
for(new i; i != MAX_PLAYERS; i++) {
if(!IsPlayerConnected(i)) continue;
else if(PlayerFaction[i][police] == 1) {
if(ObjectData[lspdg1][down] == 0) {
if(IsPlayerInRangeOfPoint(i, 8.0, 1550.27575684, -1698.06298828, 27.36819077)) {
ObjectData[lspdg1][down] = true;
SetTimerEx("moveback",
MoveObject(lspdg1, 1550.27539062, -1698.06250000, 12.61819077, 1.00) + 2000,
false, "i", lspdg1);
continue;
}
}
if(ObjectData[lspdg2][down] == 0) {
if(IsPlayerInRangeOfPoint(i, 8.0, 1544.19995117, -1630.96655273, 12.38281250)) {
ObjectData[lspdg2][down] = true;
SetTimerEx("moveback",
MoveObject(lspdg2, 1544.17443848, -1623.71582031, 12.38281250, 2.00) + 2000,
false, "i", lspdg2);
continue;
}
}
}
}
}