Brunoo Posted March 4, 2013 Share Posted March 4, 2013 well i just want to know how to use the parameters of that event function playerSpawn (posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension) if (posX == -2655.1 and posY == 639.46 and posZ == 14.454) then playSoundFrontEnd ( source, 16 ) end addEventHandler("onPlayerSpawn", root, playerSpawn) this dosn't work ,what i need is that the sound will be played only if the player spawns at those coordinates -2655.1,639.46,14.454 and if he spawn in any an other position he dosn't get the sound so i'm able to do it with this event? Link to comment
myonlake Posted March 4, 2013 Share Posted March 4, 2013 That's a kind of unique scripting as I call it, meaning, that everything is precisely as you want it, but it will only work how you want it, but there are lot of exceptions, which then will cause the script to not work. What I suggest is to make a separate spawning script. You spawn the player in a function and it will play the sound to the player. You can also try to make something like.. Server-side addEventHandler("onPlayerSpawn", root, function(posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension) if (posX >= -2654 and posX <= -2656) and (posY >= 638 and posY <= 640) and (posZ >= 13 and posZ <= 15) then playSoundFrontEnd(source, 16) end end ) Link to comment
PaiN^ Posted March 4, 2013 Share Posted March 4, 2013 Why would you add unwanted arguments ? addEventHandler("onPlayerSpawn", root, function(posX, posY, posZ) if (posX == -2654) and (posY == 638) and (posZ == 13) then playSoundFrontEnd(source, 16) end end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now