if(strcmp(cmd, "/sirene", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { if(!IsACop(playerid))return SendClientMessage(playerid, -1, "Vocк nгo й COP!"); if(GetPVarInt(playerid, "SireneStatus") == 0) { SetPVarInt(playerid, "SireneStatus", 1); SetPVarInt(playerid, "undercover", CreateObject(18646,0,0,0,0,0,0)); SetPVarInt(playerid, "undercover1", CreateObject(18646,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0); AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0); return 1; } else if(GetPVarInt(playerid, "SireneStatus") == 1) { SetPVarInt(playerid, "SireneStatus", 0); DestroyObject(GetPVarInt(playerid, "undercover")); DestroyObject(GetPVarInt(playerid, "undercover1")); return 1; } } } return 1; }
#include <a_samp>
#define FILTERSCRIPT
#include <zcmd>
new
sireneObjeto,
bool:TaComSirene[MAX_PLAYERS]
;
#define AMARELO 0xFFFF00AA
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" [FS] Sirene");
print("--------------------------------------\n");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyObject(sireneObjeto);
return 1;
}
CMD:sirene(playerid)
{
if(TaComSirene[playerid] == false)
{
sireneObjeto = CreateObject(19419, 0, 0, 0, 0, 0, 0);
AttachObjectToVehicle(sireneObjeto, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.944999, 0.000000, 0.000000, 0.000000);
SendClientMessage(playerid, AMARELO, "Sirene Adicionada com sucesso.");
TaComSirene[playerid] = true;
}
else
{
SendClientMessage(playerid, AMARELO, "| ERRO | Vocк precisa deletar a ultima Sirene Criada! (/removersirene)");
}
return 1;
}
CMD:removersirene(playerid)
{
if(TaComSirene[playerid] == true)
{
DestroyObject(sireneObjeto);
SendClientMessage(playerid, AMARELO, "Sirene Removida, para adicionar novamente [/sirene].");
TaComSirene[playerid] = false;
}
else
{
SendClientMessage(playerid, AMARELO, "| ERRO | Vocк nгo criou nenhuma Sirene. (/sirene)");
}
return 1;
}
if(strcmp(cmd, "/sirene1", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { if(!IsACop(playerid))return SendClientMessage(playerid, -1, "Vocк nгo й COP!"); if(GetPVarInt(playerid, "SireneStatus") == 0) { SetPVarInt(playerid, "SireneStatus", 1); SetPVarInt(playerid, "undercover", CreateObject(19419, 0, 0, 0, 0, 0, 0)); SetPVarInt(playerid, "undercover1", CreateObject(19419, 0, 0, 0, 0, 0, 0)); AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.944999, 0.000000, 0.000000, 0.000000); AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.944999, 0.000000, 0.000000, 0.000000); return 1; } else if(GetPVarInt(playerid, "SireneStatus") == 1) { SetPVarInt(playerid, "SireneStatus", 0); DestroyObject(GetPVarInt(playerid, "undercover")); DestroyObject(GetPVarInt(playerid, "undercover1")); return 1; } } } return 1; } |