Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: Alecu Madalin on Jul 30, 2019, 09:15 PM

Title: [HELP]Timer sound
Post by: Alecu Madalin on Jul 30, 2019, 09:15 PM
hey guys can someone help me with the timer
im trying to make a timer for sound 50010 for 1 sec but it does nothing

this is my sound script

NewTimer("player.PlaySound", 1000, 1);
player.PlaySound(50010);

seems my script is wrong
Title: Re: [HELP]Timer sound
Post by: KrOoB_ on Jul 31, 2019, 12:48 AM
you can edit your sound and you can make it 1second you don't have to script it
Title: Re: [HELP]Timer sound
Post by: DizzasTeR on Jul 31, 2019, 05:27 AM
Quote from: KrooB on Jul 31, 2019, 12:48 AMyou can edit your sound and you can make it 1second you don't have to script it

Bad advice.


On the topic note, you are using the timer wrong, you have to provide a function to the time in the first param.

function PlaySoundForPlayer(playerID, soundID) {
    local player = FindPlayer(playerID);
    if(!player) return;
    player.PlaySound(soundID);
}

NewTimer("PlaySoundForPlayer", 1000, 1, player.ID, sound_id);
Title: Re: [HELP]Timer sound
Post by: Alecu Madalin on Jul 31, 2019, 11:22 AM
Quote from: Doom_Kill3R on Jul 31, 2019, 05:27 AM
Quote from: KrooB on Jul 31, 2019, 12:48 AMyou can edit your sound and you can make it 1second you don't have to script it

Bad advice.


On the topic note, you are using the timer wrong, you have to provide a function to the time in the first param.

function PlaySoundForPlayer(playerID, soundID) {
    local player = FindPlayer(playerID);
    if(!player) return;
    player.PlaySound(soundID);
}

NewTimer("PlaySoundForPlayer", 1000, 1, player.ID, sound_id);

Thank you very much for helping me out for the sound timer btw it works :D 8)
Im going to mark this topic as solved
Title: Re: [HELP]Timer sound
Post by: KrOoB_ on Jul 31, 2019, 05:57 PM
Quote from: Doom_Kill3R on Jul 31, 2019, 05:27 AM
Quote from: KrooB on Jul 31, 2019, 12:48 AMyou can edit your sound and you can make it 1second you don't have to script it
Bad advice.

as u wish but it's same thing ;D ;D