SA-MP Forums Archive
Gateopen - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gateopen (/showthread.php?tid=311899)



Gateopen - Aloushi - 18.01.2012

how to make the gate open by use move object only i need example


Re: Gateopen - milanosie - 18.01.2012

Код:
#include <a_samp>
new Gate, bool:GateClosed = true;

public OnGameModeInit()
{
	Gate = CreateObject(512, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.0); // 512 = Object ID...   0.0 areCOORDINATES
	SetTimer("GateCheck", 7000, true);
	return 1;
}

forward GateCheck();
public GateCheck()
{
	if(!IsObjectMoving(Gate)){
		for(new i; i<GetMaxPlayers(); i++){
			if(IsPlayerConnected(i && IsPlayerInRangeOfPoint(i, 15.0, 0.0, 0.0, 0.0)){  //COORDINATES
				if(GateClosed){
					GateClosed = false;
					MoveObject(Gate, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0); //COORDINATES
				}
				else{
					GateClosed = true;
					MoveObject(Gate, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);  //CORDINATES
			}
			}
		}
	}
}



Re: Gateopen - tyler12 - 18.01.2012

try this

http://forum.sa-mp.com/showthread.ph...ght=gate+maker