18.04.2017, 01:09
PHP код:
new portaoPM;
forward FecharPortaoPM(playerid);
portaoPM = CreateObject(980, 1548.1999511719, -1627.6999511719, 15.199999809265, 0, 0, 90);
// =============================== [ COMANDO /appm Abrir Portao da PMRJ ] ===============================================
if(strcmp(cmd, "/appm", true) == 0)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Player[playerid][pLogged] == true)
{
if(Player[playerid][pPM] >= 1)
{
MoveObject(portaoPM,1548.1999511719, -1627.6999511719, 15.199999809265, 0);
SetTimerEx("FecharPortaoPM", 5000, 0, "i", playerid);
for(new i=0; i <= MAX_PLAYERS; i++)
if(GetDistanceBetweenPlayers(playerid, i) <= 20)
{
format(string, 256, "* Portгo fecharб em 5 segundos.");
SendClientMessage(i,COR_ROXO,string);
}
}
else
{
SendClientMessage(playerid, COR_ERRO, "Vocк nгo tem permissгo para usar este comando!");
return 1;
}
}
else
{
SendClientMessage(playerid, COR_ERRO, "Vocк tem que estar logado para usar este comando!");
}
return 1;
}
//-------------------------------------------------------------------------------------------------------------------
// ============================= [ ABRIR PORTГO COM BUZINA PM ] ================== */
if ((newkeys == KEY_CROUCH) && (IsPlayerInAnyVehicle(playerid)))
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1548.1999511719, -1627.6999511719, 9.1999998092651, 0))
{
if(Player[playerid][pPM] >= 1)
{
for(new i=0; i <= HighestID; i++)
if(GetDistanceBetweenPlayers(playerid, i) <= 10)
{
new string[280];
format(string, 256, "* Portгo fecharб em 5 segundos.");
SendClientMessage(i,COR_ROXO,string);
}
MoveObject(portaoPM,1548.1999511719, -1627.6999511719, 15.199999809265, 0);
SetTimerEx("FecharPortaoPM", 5000, 0, "i", playerid);
}
}
}
public FecharPortaoPM(playerid)
{
MoveObject(portaoPM, 1548.1999511719, -1627.6999511719, 9.1999998092651, 0);
}
Код:
ABERTO PM - portaoPM = CreateObject(980, 1548.1999511719, -1627.6999511719, 9.1999998092651, 0, 0, 90); FECHADO PM - portaoPM = CreateObject(980, 1548.1999511719, -1627.6999511719, 15.199999809265, 0, 0, 90);