Moin liebe Community!
Ich habe ein Problem mit meinen Sirenen.
Sie werden erstellt, aber nicht gelöscht. Vielleicht könnt ihr mir ja helfen.
Schonmal ein Danke im vorraus.
MFG Moritz (mjf)
if( newkeys & KEY_CROUCH )
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(sInfo[playerid][fraktion] == 1 || sInfo[playerid][fraktion] == 2 || sInfo[playerid][fraktion] == 3)
{
new modelid = GetVehicleModel(vehicleid);
new sirene[MAX_VEHICLES];
if(modelid == 541 || modelid == 560 || modelid == 426)
{
switch(modelid)
{
case 541:
{
if(sirene[vehicleid] == 0)
{
sirene[vehicleid] = CreateObject(18646, 0,0,-1000,0,0,0,100);
AttachObjectToVehicle(sirene[vehicleid], vehicleid, 0.524999,0.600000,0.300000,0.000000,0.000000,0.000000);
}
else
{
DestroyObject(sirene[vehicleid]);
sirene[vehicleid] = 0;
}
}
case 426:
{
if(sirene[vehicleid] == 0)
{
sirene[vehicleid] = CreateObject(18646, 0,0,-1000,0,0,0,100);
AttachObjectToVehicle(sirene[vehicleid], vehicleid, 0.524999,0.749999,0.375000,0.000000,0.000000,0.000000);
}
else
{
DestroyObject(sirene[vehicleid]);
sirene[vehicleid] = 0;
}
}
case 560:
{
if(sirene[vehicleid] == 0)
{
sirene[vehicleid] = CreateObject(18646, 0,0,-1000,0,0,0,100);
AttachObjectToVehicle(sirene[vehicleid], vehicleid, 0.524999,0.749999,0.449999,0.000000,0.000000,0.000000);
}
else
{
DestroyObject(sirene[vehicleid]);
sirene[vehicleid] = 0;
}
}
}
}
}
}
}
}