Siren won't delete
#1

uh , well I'm using the good ol' sirens added in 0.3.7 and im having a weird problem (which isnt linked to the new sirens).


When I try to destroy the object, it doesn't do it.

pawn Код:
public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
    {
        Siren[vehicleid] = CreateObject(19620, 0, 0, 0, 0, 0, 0, 0);
        if(newstate == 1 && !IsACarWithSirenObject(vehicleid))
        {
            AttachObjectToVehicle(Siren[vehicleid], vehicleid, 0.000000, -0.549499, 0.884999, 0.000000, 0.000000, 0.000000);
        }
        if(newstate == 0 && !IsACarWithSirenObject(vehicleid))
        {
            DestroyObject(Siren[vehicleid]);
        }
    }
Reply
#2

Hello!

Try this:
PHP код:
public OnVehicleSirenStateChange(playerid,vehicleid,newstate)
{
    
Siren[vehicleid] = CreateObject(19620,0,0,0,0,0,0,0);
    if(
newstate == && !IsACarWithSirenObject(vehicleid))
    {
        
AttachObjectToVehicle(Siren[vehicleid],vehicleid,0.00,-0.549499,0.884999,0.0000,0.0000,0.0000);
        return 
1;
    }
    else if(
newstate == && !IsACarWithSirenObject(vehicleid))
    {
        
DestroyObject(Siren[vehicleid]);
    }
    return 
1;

If it doesn't work, what prints here?
PHP код:
public OnVehicleSirenStateChange(playerid,vehicleid,newstate)
{
    
printf("vehicleid: %i - newstate: %i - Objekt-ID: %i",vehicleid,newstate,Siren[vehicleid]);
    
Siren[vehicleid] = CreateObject(19620,0,0,0,0,0,0,0);
    if(
newstate == && !IsACarWithSirenObject(vehicleid))
    {
        print(
"newstate == 1");
        
AttachObjectToVehicle(Siren[vehicleid],vehicleid,0.00,-0.549499,0.884999,0.0000,0.0000,0.0000);
        return 
1;
    }
    else if(
newstate == && !IsACarWithSirenObject(vehicleid))
    {
        print(
"newstate == 0");
        
DestroyObject(Siren[vehicleid]);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)