Hello, first off I tried to search for a similar topic but did not find any which was similar to my problem. Maybe I just suck at searching, I don't know. Alright, lets get to the problem. I want to make this gate only able to open for a certain gTeam, in this case "CHINA". I'm using "IsPlayerInRangeOfPoint", meaning it opens as soon someone comes near it. Below you can see more detailed what my problem is.
pawn Код:
public CheckGateTwo()
{
new d_gate_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
/* You would only use this if you're using SA-MP v0.2x or lower
if(PlayerToPoint(10.0, i, closed_X, closed_Y, closed_Z))c_gate_status = 1;
*/
if(IsPlayerInRangeOfPoint(i,10.0,-1562.1348876953, -2356.5104980469, 30.082025527954))d_gate_status = 1;
}
if(d_gate_status)MoveObject(d_gate, -1562.1348876953, -2356.5104980469, 22.757061004639,3);
else MoveObject(d_gate, -1562.1348876953, -2356.5104980469, 30.082025527954,3);
}