Siren won't delete
#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


Messages In This Thread
Siren won't delete - by sammp - 09.05.2015, 18:59
AW: Siren won't delete - by Mencent - 09.05.2015, 19:27

Forum Jump:


Users browsing this thread: 1 Guest(s)