Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Gate, bool:GateClosed = true;
- public OnGameModeInit()
- {
- Gate = CreateObject(19362, -2467.0032, 2233.3865, 3.8310, 0.0, 0.0, 90, 100.0);
- 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, -2467.0032, 2233.3865, 3.8310)){
- if(GateClosed){
- GateClosed = false;
- MoveObject(Gate, -2467.0032, 2233.3865, 6.8310, 3.0, 0.0, 0.0, 90);
- }
- else{
- GateClosed = true;
- MoveObject(Gate, -2467.0032, 2233.3865, 3.8310, 3.0, 0.0, 0.0, 90);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment