pawn Код:
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
#else
#endif
#pragma tabsize 0
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/xenon", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Xenons", "Azul\nVermelho\nVerde\nDesligar Xenon", "Selecionar", "Cancelar");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 8899)
{
if(response)
{
if(listitem == 0)
{
//azul
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "xenon", CreateObject(19298,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon1", CreateObject(19298,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon2", CreateObject(19298,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon3", CreateObject(19298,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "xenon"), GetPlayerVehicleID(playerid), 0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon1"), GetPlayerVehicleID(playerid),0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon2"), GetPlayerVehicleID(playerid), 0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon3"), GetPlayerVehicleID(playerid),0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
}
if(listitem == 1)
{
//vermelho
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "xenon4", CreateObject(19296,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon5", CreateObject(19296,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon6", CreateObject(19296,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon7", CreateObject(19296,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "xenon4"), GetPlayerVehicleID(playerid), 0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon5"), GetPlayerVehicleID(playerid),0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon6"), GetPlayerVehicleID(playerid), 0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon7"), GetPlayerVehicleID(playerid),0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
}
if(listitem == 2)
{
//verde
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "xenon8", CreateObject(19297,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon9", CreateObject(19297,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon10", CreateObject(19297,0,0,0,0,0,0));
SetPVarInt(playerid, "xenon11", CreateObject(19297,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "xenon8"), GetPlayerVehicleID(playerid), 0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon9"), GetPlayerVehicleID(playerid),0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon10"), GetPlayerVehicleID(playerid), 0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "xenon11"), GetPlayerVehicleID(playerid),0.0, 3.0, -0.8, 0.0, 0.0, 0.0);
}
//remover xenon
DestroyObject(GetPVarInt(playerid, "xenon"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon1"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon2"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon3"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon4"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon5"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon6"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon7"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon8"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon9"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon10"));
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "xenon11"));
DeletePVar(playerid, "Status");
}
return 1;