SnoopCat Posted September 29, 2010 Posted September 29, 2010 hey hello i need a script to race when a player its ready to race play a sound to advice i need to know what i did wrong here plz if any 1 can help me.. function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) local sound = playSound("1.wav") setSoundVolume(sound, 0.5) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) VISIT TSW RACING SERVER http://tswracing.net/
12p Posted September 29, 2010 Posted September 29, 2010 function player_Spawn ( hisTeam )-- Other event, other parameters... local sound = playSound("1.wav",false) -- I suggest add "false", for prevent a loop. setSoundVolume(sound, 0.5) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), player_Spawn ) --"onClientPlayerSpawn", not "onPlayerSpawn". Well, easy. playSound is only-client-side function, so you can't use "onPlayerSpawn" event, you must use the client event.
SnoopCat Posted September 29, 2010 Author Posted September 29, 2010 function player_Spawn ( hisTeam )-- Other event, other parameters... local sound = playSound("1.wav",false) -- I suggest add "false", for prevent a loop. setSoundVolume(sound, 0.5) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), player_Spawn ) --"onClientPlayerSpawn", not "onPlayerSpawn". Well, easy. playSound is only-client-side function, so you can't use "onPlayerSpawn" event, you must use the client event. well isnt working i mean how to do it sound when a player its ready to race ORR when a player join server i tried to do it but isnt working VISIT TSW RACING SERVER http://tswracing.net/
dzek (varez) Posted September 29, 2010 Posted September 29, 2010 and did you set type="client" in meta.xml ? Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
SnoopCat Posted September 29, 2010 Author Posted September 29, 2010 and did you set type="client" in meta.xml ? of course.... VISIT TSW RACING SERVER http://tswracing.net/
[DMC] Posted September 29, 2010 Posted September 29, 2010 function player_Spawn ( ) local sound = playSound("1.wav",false) setSoundVolume(sound, 2.0) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), player_Spawn ) try this
dzek (varez) Posted September 29, 2010 Posted September 29, 2010 and did you add your wav to meta.xml? aslo are you sure your file is named *.wav not *.WAV ? Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
SnoopCat Posted September 29, 2010 Author Posted September 29, 2010 its ok i do they work BUTTT i have a new problem.... if 2 players on server the sound plays 2 time if 3 then 3 times at same time when a player do spawn at map and the thing i want its play them separately and u can only hear the sound when ur ready and NOT when others are ready too. VISIT TSW RACING SERVER http://tswracing.net/
dzek (varez) Posted September 29, 2010 Posted September 29, 2010 change: getRootElement() to getLocalPlayer() Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
SnoopCat Posted September 29, 2010 Author Posted September 29, 2010 thx varez i will see if works VISIT TSW RACING SERVER http://tswracing.net/
SnoopCat Posted September 29, 2010 Author Posted September 29, 2010 (edited) change:getRootElement() to getLocalPlayer() srry for Repost but i have to say thx to all ppl who help me make this possible since its my first script thx To: varez (i edited it cuz isnt Vares ) SolidSnake14 [DMC] Edited September 29, 2010 by Guest VISIT TSW RACING SERVER http://tswracing.net/
Castillo Posted September 29, 2010 Posted September 29, 2010 change:getRootElement() to getLocalPlayer() srry for Repost but i have to say thx to all ppl who help me make this possible since its my first script thx To: Vares SolidSnake14 [DMC] write varez nick as "varez" else he will get angry. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dzek (varez) Posted September 29, 2010 Posted September 29, 2010 Solid - i won't, this is just notice, because i dont like the look of first capital in this word. Topic locked, because topic author created new one: viewtopic.php?f=91&t=29273 Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Recommended Posts