18.10.2011, 21:38
Title says it all. Here's the code:
pawn Код:
NeonStatus[MAX_VEHICLES];
pawn Код:
carneon[vid] = CreateObject(18648,0,0,0,0,0,0);
carneon2[vid] = CreateObject(18648,0,0,0,0,0,0);
AttachObjectToVehicle(carneon[vid], GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(carneon2[vid], GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
NeonStatus[vid] = 1;
// Creates & attaches neon
pawn Код:
CMD:neon(playerid, params[])
{
if(NeonStatus[GetPlayerVehicleID(playerid)] == 1)
{
NeonStatus[GetPlayerVehicleID(playerid)] = 0;
DestroyObject(carneon[GetPlayerVehicleID(playerid)]);
DestroyObject(carneon2[GetPlayerVehicleID(playerid)]);
// should destroy the object but doesn't.
}else
{
ShowPlayerDialog(playerid, NeonDialog, DIALOG_STYLE_LIST, "Select a color:", "Blue\r\nRed\r\nYellow\r\nGreen\r\nPink", "Select", "Cancel");
}
return 1;
}