NeonStatus[MAX_VEHICLES];
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
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;
}
try doing
DestroyObject(carneon[vid]); DestroyObject(carneon2[vid]); and do vid = GetPlayerVehicleID(playerid); |
try doing
DestroyObject(carneon[vid]); DestroyObject(carneon2[vid]); and do vid = GetPlayerVehicleID(playerid); |
new vid = GetPlayerVehicleID(playerid); DestroyObject(carneon[vid]); DestroyObject(carneon2[vid]);
DestroyObject(carneon[GetPlayerVehicleID(playerid)]); DestroyObject(carneon2[GetPlayerVehicleID(playerid)]);
That can't be the solution, because:
Код:
new vid = GetPlayerVehicleID(playerid); DestroyObject(carneon[vid]); DestroyObject(carneon2[vid]); Код:
DestroyObject(carneon[GetPlayerVehicleID(playerid)]); DestroyObject(carneon2[GetPlayerVehicleID(playerid)]); |