Jump to content

Help with script


=RM=Mario

Recommended Posts

Posted

Hi,ive been trying for many hours to get this to work,but failed.even tried to go on irc,well any ways im trying to make a script for Custom music to play at Grove Steet.and no there is no warinings or errors in debugscript,so please help

function onResourceStart()
local sound = playSound3D("xenon.mp3", 2484.0263671875, -1668.2800292969, 13.34375, true)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart)

and here is meta file if theres any mistakes

</meta>
<info author="Mario" description="Music at Grove" version="1.0" type="map" />
   <script src="musicxeno.lua" type="client" />
   <file src="xenon.mp3" />
</meta>

firemafia15.png
Posted

Completely crazy idea, I'm probably WAYYY off here, but maybe it's because you defined this resource as type="map" but it doesn't have a map or race file defined.

Try type="script".

Posted

Basically, you just debug your code. After you call playSound3D your local sound variable will hold a value/data of what playSound3D returned. If playSound3D failed the sound variable will hold false. So, to find out what that sound variable is you need to show that to yourself with outputDebugString or outputChatBox functions.

outputChatBox( tostring( sound ) ); -- you need to use tostring because playSound3D doesn't return string

Posted

sorry for the noob Question....but where do i type this?

outputChatBox( tostring( sound ) ); -- you need to use tostring because playSound3D doesn't return string

firemafia15.png
Posted
function onResourceStart()
local sound = playSound3D("xenon.mp3", 2484.0263671875, -1668.2800292969, 13.34375, true)
outputChatBox( tostring( sound ) )
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart)

Posted
function onResourceStart()
local sound = playSound3D("xenon.mp3", 2484.0263671875, -1668.2800292969, 13.34375, true)
outputChatBox( tostring( sound ) )
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart)

did this,nothing..

firemafia15.png
Posted
i dont see anything in chatbox,and music isnt playing

- Are you sure you started the script?

- Are you sure your script is updated?

- Make sure you don't edit the resource in "resourcecache" folder.

- Is this folder or zip resource? If it's zip resource, make sure you don't have a folder with the same name.

Posted
i dont see anything in chatbox,and music isnt playing

- Are you sure you started the script?

- Are you sure your script is updated?

- Make sure you don't edit the resource in "resourcecache" folder.

- Is this folder or zip resource? If it's zip resource, make sure you don't have a folder with the same name.

yes i started script with admin Panel,yes i made sure i didnt edit resourcecache,and its a Folder

firemafia15.png
Posted

Your meta.xml:

<[color=#FF0000]/[/color]meta>
<info author="Mario" description="Music at Grove" version="1.0" type="map" />
   <script src="musicxeno.lua" type="client" />
   <file src="xenon.mp3" />
</meta>

I think this is right:

<meta>
<info author="Mario" description="Music at Grove" version="1.0" type="map" />
   <script src="musicxeno.lua" type="client" />
   <file src="xenon.mp3" />
</meta>

Posted
Your meta.xml:

<[color=#FF0000]/[/color]meta>
<info author="Mario" description="Music at Grove" version="1.0" type="map" />
   <script src="musicxeno.lua" type="client" />
   <file src="xenon.mp3" />
</meta>

I think this is right:

<meta>
<info author="Mario" description="Music at Grove" version="1.0" type="map" />
   <script src="musicxeno.lua" type="client" />
   <file src="xenon.mp3" />
</meta>

This is correct...

I'm going to stop helping people at 5am.

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...