16.11.2010, 22:28
How can i make a gate who automaticly opens when i get close to the gate
Like an hangar (the gate opens when i am getting close to it)
Script (The gate)
Like an hangar (the gate opens when i am getting close to it)
Script (The gate)
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_GREEN 0x33AA33AA
forward loadobjects();
forward loadvehicles();
forward Resetbase();
new Gate1;
public OnFilterScriptInit()
{
Gate1 = CreateObject(2933,96.71507263,1920.44409180,17.12633896,0.00000000,270.00000000,90.00000000); //gate(/gate)
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gate", cmdtext, true) == 0)
{
if(IsPlayerAdmin(playerid)==1)
{
SendClientMessage(playerid,COLOR_GREEN,"The HQ gate Is now opening!");
MoveObject(Gate1, 96.715072631836,1920.4440917969,12.12633895874, 2.00);
SetTimer("Resetbase",5000,0);
return 1;
}
}
return 0;
}
public Resetbase()
{
MoveObject(Gate1, 96.715072631836,1920.4440917969,17.12633895874, 2.00);
}