09.05.2015, 19:27
Hello!
Try this:
If it doesn't work, what prints here?
Try this:
PHP код:
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.00,-0.549499,0.884999,0.0000,0.0000,0.0000);
return 1;
}
else if(newstate == 0 && !IsACarWithSirenObject(vehicleid))
{
DestroyObject(Siren[vehicleid]);
}
return 1;
}
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 == 1 && !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 == 0 && !IsACarWithSirenObject(vehicleid))
{
print("newstate == 0");
DestroyObject(Siren[vehicleid]);
}
return 1;
}