15.04.2014, 18:50
como sempre gente com o ppc_trucking
include PPC_Dialogs:
include PPC_Dialogs:
pawn Код:
Dialog_Neon(playerid, response, listitem)
{
// Just close the dialog if the player clicked "Cancel"
if(!response) return 1;
// Setup local variables
new vehicleid;
// Get the player's vehicle
vehicleid = GetPlayerVehicleID(playerid);
// Check if the player chose anothet option than "Remove neons"
if (listitem != 7)
{
// Check if the vehicle already has neon lights attached
if (AVehicleData[vehicleid][NeonLeft] != 0)
{
// Delete the current neon-lights and clear the variables
DestroyObject(AVehicleData[vehicleid][NeonLeft]);
DestroyObject(AVehicleData[vehicleid][NeonRight]);
AVehicleData[vehicleid][NeonLeft] = 0;
AVehicleData[vehicleid][NeonRight] = 0;
}
}
// Process the option chosen from the dialog
if (listitem == 0) // Police Light
{
AVehicleData[vehicleid][NeonLeft] = CreateObject(18646,0,0,0,0,0,0);
AVehicleData[vehicleid][NeonRight] = CreateObject(18646,0,0,0,0,0,0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonLeft], vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonRight], vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~p~Neon policial", 3500, 5);
}
if (listitem == 1) // Red light
{
AVehicleData[vehicleid][NeonLeft] = CreateObject(18647,0,0,0,0,0,0);
AVehicleData[vehicleid][NeonRight] = CreateObject(18647,0,0,0,0,0,0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonLeft], vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonRight], vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~r~Neon Vermelho", 3500, 5);
}
if (listitem == 2) // Blue light
{
AVehicleData[vehicleid][NeonLeft] = CreateObject(18648,0,0,0,0,0,0);
AVehicleData[vehicleid][NeonRight] = CreateObject(18648,0,0,0,0,0,0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonLeft], vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonRight], vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~b~Neon azul", 3500, 5);
}
if (listitem == 3) // Green Light
{
AVehicleData[vehicleid][NeonLeft] = CreateObject(18649,0,0,0,0,0,0);
AVehicleData[vehicleid][NeonRight] = CreateObject(18649,0,0,0,0,0,0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonLeft], vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonRight], vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~g~Neon verde", 3500, 5);
}
if (listitem == 4) // Yellow Light
{
AVehicleData[vehicleid][NeonLeft] = CreateObject(18650,0,0,0,0,0,0);
AVehicleData[vehicleid][NeonRight] = CreateObject(18650,0,0,0,0,0,0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonLeft], vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonRight], vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~y~Neon amarelo", 3500, 5);
}
if (listitem == 5) // Pink Light
{
AVehicleData[vehicleid][NeonLeft] = CreateObject(18651,0,0,0,0,0,0);
AVehicleData[vehicleid][NeonRight] = CreateObject(18651,0,0,0,0,0,0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonLeft], vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonRight], vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~p~Neon rosa", 3500, 5);
}
if (listitem == 6) // White Light
{
AVehicleData[vehicleid][NeonLeft] = CreateObject(18652,0,0,0,0,0,0);
AVehicleData[vehicleid][NeonRight] = CreateObject(18652,0,0,0,0,0,0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonLeft], vehicleid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(AVehicleData[vehicleid][NeonRight], vehicleid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Neon branco", 3500, 5);
}
if (listitem == 7) // Remove neons
{
// Delete the current neon-lights and clear the variables
DestroyObject(AVehicleData[vehicleid][NeonLeft]);
DestroyObject(AVehicleData[vehicleid][NeonRight]);
AVehicleData[vehicleid][NeonLeft] = 0;
AVehicleData[vehicleid][NeonRight] = 0;
GameTextForPlayer(playerid, "Neons foram removidos do seu veнculo", 3500, 5);
}
return 1;
}