How do i make gate open and close? Please help me with this small thing
#6

This?
Код:
new GateObj;

public OnGameModeInit()
{
	GateObj = CreateDynamicObject(988, -488.89850, -562.67981, 25.35821,   0.00000, 0.00000, 0.00000);
	SetTimer("Gate", 500, true);
	
	return 1;
}

forward Gate();
public Gate()
{
	for(new i = 0; i < MAX_PLAYERS; i ++)
	{
		if(!IsPlayerConnected(i)) continue;
		
		if(IsPlayerInRangeOfPoint(i, 7.0, 488.89850, -562.67981, 25.35821))
		{
			new Name[24];
			GetPlayerName(i, Name, 24);
			
			if(strfind(Name, "[BD]", true) != -1) MoveObject(GateObj, -488.89850, -562.67981, 35.35821, 5.0, 0.0, 0.0, 0.0);
		}
		else MoveObject(GateObj, -488.89850, -562.67981, 25.35821, 5.0, 0.0, 0.0, 0.0);
	}
	return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)