new Portao;
#define Vermelho 0xFF0000AA
#define Amarelo 0xFFFF00AA
public OnFilterScriptInit()
{
Portao = CreateObject(980, -1540.3406982422, 482.71173095703, 8.9530792236328, 0, 0, 0, 342.8113);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
//----------------------------
if (strcmp("/abrir", cmdtext, true, 10) == 0)
{
if(!IsPlayerAdmin(playerid))
{
MoveObject(Portao, -1540.3406982422, 482.71173095703, 8.9530792236328, 5.0);
SendClientMessage(playerid, Vermelho, "Portгo Aberto");
return 1;
}
}
//----------------------------
if (strcmp("/fechar", cmdtext, true, 10) == 0)
{
if(!IsPlayerAdmin(playerid))
{
MoveObject(Portao, -1531.1553955078, 482.18063354492, 8.9530792236328, 5.0);
SendClientMessage(playerid, Vermelho, "Portгo Fechado");
return 1;
}
}
return 0;
}
//topo do gm
forward Portao1(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CROUCH && IsPlayerInRangeOfPoint(playerid, 6.0, -1540.3406982422, 482.71173095703, 8.9530792236328))
{
MoveObject(Portao, -1540.3406982422, 482.71173095703, 8.9530792236328, 5.0);
SetTimer("Portao1", 7000, false);
}
return 1;
}
public Portao1(playerid)
{
MoveObject(Portao, -1531.1553955078, 482.18063354492, 8.9530792236328, 5);
return 1;
}

|
Acredito que funcione |
|
ONDE EU ADICIONO O OBJETO (PORTГO)
Em public OnFilterScriptInit() ? |
|
OnGameModeInit. |