19.10.2010, 14:50
I was working on a script but the plays a sounds where you are in a vehicle I use a command and it plays a sounds when I exit the vehicle it stops the sounds but no matter which vehicle I enter it keeps playing the sound, how can I make the command to be specific on a vehicle that I used the command on ?
code:
this is the command that activates the sounds
code:
this is the command that activates the sounds
pawn Код:
if ( g_BoomTimer[ playerid ] != -1 )
{
KillTimer( g_BoomTimer[ playerid ] );
g_BoomTimer[ playerid ] = -1;
}
else
{
g_BoomTimer[ playerid ] = SetTimerEx( "BoomSound", 1000, true, "i", playerid );
}
gEngine[playerid] = 1;
return 1;
}
pawn Код:
forward BoomSound( playerid );
public BoomSound( playerid )
{
new Float:x, Float:y, Float:z;
if(IsPlayerInAnyVehicle(playerid))
{
PlayerPlaySound(playerid, 1147, x, y, z);
}
}