Jump to content

addcommandhandler[darkdragon look inside:P


kevin11

Recommended Posts

Posted (edited)

idk what to tell :S i dont know what function to use can anyone send me wiki page or tell me what function

function onSoundEvent ( )()
local sound = playSound("music.mp3",false) 
end
 
addCommandHandler("startc", onSoundEvent)

Edited by Guest
Posted
is this a client side file? did you add the file in the meta.xml?

yes its client

<meta>
<info type="script" version="1.0.0" />
<script src="music.lua" type="client"/>
<file src="music.mp3" />
meta>

Posted
dark u still onine?? my guests cant hear to music :roll: maybe a bug inside script

It's only heard by player who typed in the command. They can hear it when they type that command.

is it possible to that if i type it everyone hears it? :roll:

Posted

Yes. But frankly, you're too clueless about even basic syntax - you should read some more about Lua before you try anything.

Once you've gotten the basic Lua down, you can accomplish this by creating a client-side event and triggering it for everybody when the command is entered.

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted
Yes. But frankly, you're too clueless about even basic syntax - you should read some more about Lua before you try anything.

Once you've gotten the basic Lua down, you can accomplish this by creating a client-side event and triggering it for everybody when the command is entered.

this is client side... u mean trigger server side?

i am learning scripting a little more everyday (very little) but i cant do this because i thought it would play for everyone

can someone post solution? or how to make one?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...