26.12.2014, 22:42
please tell my is this even possible to do ? cuz i make him work but i get stuck in other way and i think is impossible to to :
so first i need attach siren to car i am using getvehiclepos but this siren works only while i am in car , and if so position updates realy slow so if u drive fast after few seconds u wont hear sirens atleast u make distance realy high ,and this code has one problem that i set timer but here is still short interval between sound files and when sound file ends its gets quiet for about 100miliseconds or something so sound ist perffect like using H in police vehicles , and i am still stuck on car check so i just comment him to test is it works , so please give my some advides and how to that i am in right car
Код:
if (PRESSED(KEY_CTRL_BACK))
{
//if(PlayerInfo[playerid][JobID] == 15)
//{
//if(IsPlayerInAnyVehicle(playerid))
//{
//for(new i=0; i<sizeof(PasienioCar); i++)
//{
// Vehicleid[ playerid ] = GetPlayerVehicleID( playerid );
// Model[ playerid ] = GetVehicleModel( Vehicleid[ playerid ] );
//if(Model[playerid] == 424)
//{
if(UsedH[playerid] == false)
{
new Vehicleid2;
Vehicleid2 = GetPlayerVehicleID( playerid );
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0,grojo;
GetVehiclePos(Vehicleid2, X, Y, Z);
grojo =0;
if(grojo == 0)
{
PlayAudioStreamForPlayer(playerid, "http://127.0.0.1/siren/sound_011.wav", X, Y, Z, Distance, 1);
grojo = 1;
}
sound11[playerid] = SetTimerEx("sirenos",3700,true,"d",playerid );
UsedH[playerid] = true;
}
else if(UsedH[playerid] == true)
{
KillTimer(sound11[playerid]);
UsedH[playerid] = false;
}
//}
//}
//}
//}
}

