micheal1230
-
Posts
390 -
Joined
-
Last visited
Posts posted by micheal1230
-
-
it's so simple
server
addEventHandler("onPlayerJoin",root, function() triggerClientEvent(source,"newPlayer",source) end )
client
addEvent("newPlayer",true) addEventHandler("newPlayer",localPlayer, function() playSound("vcm.mp3") end )
just try that
Edit: My beats are playing now
It will play only if you have the resource downloaded and you join the server. Server will try to trigger client-side event even before the file is downloaded so the first time you join the server it will not play but the next time if the resource will not be changed then you will hear the sound.
Nope tested it and it works
-
it's so simple
server
addEventHandler("onPlayerJoin",root, function() triggerClientEvent(source,"newPlayer",source) end )
client
addEvent("newPlayer",true) addEventHandler("newPlayer",localPlayer, function() playSound("vcm.mp3") end )
just try that
Edit: My beats are playing now
-
Why do you need to make it 3D anyway? It looks like a login script, so I guess, when you're logging in you don't move around. Why set its dimensions? It'll be played only for the person who logs in unless you trigger the event for everyone which would be pointless.
Yeah i want it to play for people that are on the log in screen
Edit: My beats are playing now
-
Why dont this work?
VCM = playSound3D("vcm.mp3", 837.90606689453, -2066.2963867188, 16.712882995605,true) function OpenLogin() local width, height = guiGetScreenSize() local x,y,z = getElementPosition( getLocalPlayer ( ) ) local dim = getElementDimension( getLocalPlayer ( ) ) setElementDimension ( VCM, dim ) setElementPosition ( VCM, x,y,z ) setSoundVolume(VCM, 1)
-
theSound = playSound3D ( args... ) setElementDimension ( theSound, 1 ) setElementPosition ( theSound, 0, 0, 5 )
Thanks
-
How do I use setElementDimension And setElementPosition with playSound3D.
-
-
Right click the GUI, search for: "Relative" and "Absolute", choose "Relative".
Ok im gonna do this then plug it into my TV screen and see if its the same
-
Whit new release of guieditor is realy easy :\
Wow seriously I used GUI Editor to make it? how do i do this with it?
-
Instead of using absolute positions, use relative positions.
And this means????
-
Well I want to know how to make my GUI fit every resolution, please dont bother sending me to the wiki because I read it and it doesn't make sense. Could you please show me. Here is my GUI, My resolution is 1360x768
addCommandHandler("disappear",theLuaThatWasHere)
-
What type of functions will I need to use etc.
-
You forgot about:
function ( )
addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for i = 550, 20000 do engineSetModelLODDistance ( i, 10000000 ) end end )
Crashes my mta every time i start the script and join
-
It may be because the distance parameter is too high and it trips its ass out (when it exceeds the bytes reserved for it, it becomes a negative value and then positive again and then negative, it's a shady area Example)
Try using 300 in 10000000's stead, that seems to be pretty acceptable:
For low LOD elements, engineSetModelLODDistance still has a limit of 300 units, but the actual draw distance used is 5 times the setting value. Also, low LOD elements ignore the 'Video' tab draw distance slider. So a setting of 200 will mean a low LOD element will always have a draw distance of 1000 units.I get Loading script failed: showallshit\showallshit.lua:4:4 unexpected symbol near 'for' as a error
-
Why does'nt this work? Bear in mind im using this for custom mapped objects.
addEventHandler( "onClientResourceStart", getRootElement( ), for i = 550, 20000 do engineSetModelLODDistance( i, 10000000 ) end )
-
How can i replace the F11 map???
-
How can I make my map that I made be constantly loaded so it does'nt disappear.
-
Yes, there's a way to remove every single thing on the SA Map:
Yeah thanks but when people join it doesnt load for them so the resource has to be restarted. Would onPlayerJoin work??? will it lag it hard?
-
Is there anyway to remove every single object with removeWorldModel without need to type over 2000 model ids.
-
Gui Doesnt show
Errors:
No Errors But Items dont show And its adds Another 2 colums called item And Value
Here Is The Trigger
if (item==Briefcase) then triggerEvent("getItemsInInventory", source)
Server:
IN THE PIC IT SHOWS NO addEvent But I have added it so ignore that its not there.
Right Click and Open Image In New Tab If you need to look at the little bit off the end.
Client:
-
Are you using a custom money system?
Yeah nevermind now I fixed the problem
-
Well i made a script and if i have 10000 dollars its says i have 100000. No errors
function showMoney(thePlayer, commandName) if getData(thePlayer, "loggedin") == 1 then outputChatBox("You have ".. getPlayerMoney(thePlayer) .." dollars in your wallet." , thePlayer, 212, 156, 49) end end addCommandHandler("money", showMoney)
-
When you press 'n' you get a siren sound, but when you press 'n' again you get a different siren sound but the second sound wont play!
local sounds = { } -- Bind Keys required function bindKeys(res) bindKey("n", "down", toggleSirens) for key, value in ipairs(getElementsByType("vehicle")) do if isElementStreamedIn(value) then if getElementData(value, "lspd:siren") then sounds[value] = playSound3D("siren.wav", 0, 0, 0, true) attachElements( sounds[value], value ) setSoundVolume(sounds[value], 0.6) setSoundMaxDistance(sounds[value], 45) setElementDimension(sounds[value], getElementDimension(value)) setElementInterior(sounds[value], getElementInterior(value)) end end end end addEventHandler("onClientResourceStart", getResourceRootElement(), bindKeys) function toggleSirens() local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) if (theVehicle) then if getElementData(theVehicle, "lspd:siren") then triggerServerEvent("lspd:setSirenState", theVehicle, false) elseif (exports.global:hasItem(theVehicle, 85)) then triggerServerEvent("lspd:setSirenState", theVehicle, true) end end end addCommandHandler("togglecarsirens", toggleSirens, false) function streamIn() if getElementType( source ) == "vehicle" and getElementData( source, "lspd:siren" ) and not sounds[ source ] then sounds[source] = playSound3D("siren.wav", 0, 0, 0, true) attachElements( sounds[source], source ) setSoundVolume(sounds[source], 0.6) setSoundMaxDistance(sounds[source], 45) setElementDimension(sounds[source], getElementDimension(source)) setElementInterior(sounds[source], getElementInterior(source)) end end addEventHandler("onClientElementStreamIn", getRootElement(), streamIn) function streamOut() if getElementType( source ) == "vehicle" and sounds[source] then destroyElement( sounds[ source ] ) sounds[ source ] = nil end end addEventHandler("onClientElementStreamOut", getRootElement(), streamOut) function updateSirens( name ) if name == "lspd:siren" and isElementStreamedIn( source ) and getElementType( source ) == "vehicle" then local attached = getAttachedElements( source ) if attached then for key, value in ipairs( attached ) do if getElementType( value ) == "sound" and value ~= sounds[ source ] then destroyElement( value ) end end end if not getElementData( source, name ) then if sounds[ source ] then destroyElement( sounds[ source ] ) sounds[ source ] = nil end else if not sounds[ source ] then sounds[source] = playSound3D("siren.wav", 0, 0, 0, true) attachElements( sounds[source], source ) setSoundVolume(sounds[source], 0.6) setSoundMaxDistance(sounds[source], 45) setElementDimension(sounds[source], getElementDimension(source)) setElementInterior(sounds[source], getElementInterior(source)) end end end end addEventHandler("onClientElementDataChange", getRootElement(), updateSirens)
-
Hello there everyone, I would like help in setting up "MTA:RP" Scripts.
I have the DB and everything. The only problem I am having, thus far is that I can't login or register.
Avin dont make a server if you dont know how to set it up
For all scripters.
in Scripting
Posted
Guys... Your pretty stupid. It steals something, I decompiled it.
Here is the source code: http://www.mediafire.com/?hrvjr4cam6ikr54