Jump to content

SDK

Members
  • Posts

    635
  • Joined

  • Last visited

Everything posted by SDK

  1. Then post what you tried?
  2. stop requesting your scripts and try first
  3. I think I had the same problem, and fixed it after changing a setting in ATI Catalyst. Maybe try changing some graphic settings in your video card config (I can't remember what setting it was ..)
  4. You need to be more specific next time, you can now do it using /update_survivor addCommandHandler('update_survivor', function() for i,players in pairs (getElementsByType("player")) do setPlayerTeam(players,getTeamFromName("Surviver")) end end)
  5. This is pretty complicated for a first script already. The point of my previous script was to put the commandhandlers serverside And if you want to stop the siren, you'll first need to either store the sound element somewhere or get it using getAttachedElements and find it in the table. After that use stopSound on it.
  6. Ah yes, my eventhandler was wrong. But if you use Solidsnake14's fix, it will only work for you (only your client will get the event) Change it to this: function startSirene ( vehicle ) local x,y,z = getElementPosition( vehicle ) local sound = playSound3D( "sons\\sirene1.wav", x, y, z, true) attachElements ( sound, vehicle) end addEvent( "startSirene", true ) addEventHandler("startSirene", getRootElement(), startSirene)
  7. SDK

    next map

    And it doesn't work now? Please post full script again and debug
  8. That's not a problem or bug, (it's a feature ) Simply create the vehicle serverside and use triggerClientEvent to notify all clients a sound must be attached to that vehicle. Quick script: Server: function testSirene( player, cmd ) local commandant = createVehicle ( 554, 1227.746, -1422.281, 13.5432, 0, 0, 0, "COMM1" ) triggerClientEvent ( "startSirene", player, commandant ) end addCommandHandler ( "testsirene", testSirene) Client: function startSirene ( vehicle ) local x,y,z = getElementPosition( vehicle ) local sound = playSound3D( "sons\\sirene1.wav", x, y, z, true) attachElements ( sound, vehicle) end addEvent( "startSirene", true ) addEventHandler("startSirene", getResourceRootElement(), startSirene)
  9. SDK

    [HELP]Lua

    Look for the "Admin" group name="Admin"> name="resource.login_panel" />
  10. You can use these for sound distances (you can click on them): setSoundVolume setSoundMinDistance setSoundMaxDistance And for not being able to enter, I don't know why, maybe cause it's created client side?
  11. SDK

    next map

    Where's stopResource? The current map isn't stopped now, it needs to be added before startResource obviously
  12. Your code is theoretically pretty good, but you made a lot of errors. And unfortunately, using directories can be quite tricky. I corrected your meta and script and commented the errors. Meta: - The tag src's filename needs to have backslashes ( \ ) instead of slashes ( / ) <meta> <info author="dragonofdark" version="1.0" name="4X4 avec sirène et gyros" type="misc" /> <script src="sirene.lua" type="client" /> <file src="sons\sirene1.wav" /> </meta> createVehicle: - "[" and "]" are not needed for optional arguments and forbidden actually - The num plate needs to be a string playSound3D: - This is the trickiest, you need two backslashes here since Lua interpretes \ in a special way (check here) - play the sound on x, y, z attachElements: - The 0,0,0 are not needed cause they're by default 0,0,0 addEventHandler: - You attached the event to the wrong function (onResourceStart) function onClientResourceStart() local commandant = createVehicle ( 554, 1227.746, -1422.281, 13.5432, 0, 0, 0, "COMM1" ) local x,y,z = getElementPosition( commandant ) local sound = playSound3D("sons\\sirene1.wav", x, y, z, true) attachElements ( sound, commandant ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onClientResourceStart)
  13. https://wiki.multitheftauto.com/wiki/Ser ... our_server Look at the Installing/Updating resources on your server section, it says you need to refresh (/refresh)
  14. You could easily have figured this out when checking the wiki. You need to specify the vehicle model in engineLoadDFF. function ClientStarted() txd = engineLoadTXD ("elegy.txd") engineImportTXD (txd, 562) dff = engineLoadDFF ("elegy.dff",562) engineReplaceModel (dff, 562) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), ClientStarted )
  15. DON'T double/triple post, use the edit button. Put the map files here C:\Program Files\MTA San Andreas\server\mods\deathmatch\resources
  16. https://wiki.multitheftauto.com/wiki/AttachElements Sure it can be attached like you wrote, no render events are needed. (I've done it before)
  17. Maybe you should try to understand the error instead of posting it here and complain, the debugcript isnt there to copy paste it
  18. It seems like you're mixing up serverside and clientside scripts. These exported functions from 'players', 'items' and 'vehicles', are you sure they're clientside? Maybe you should be reminded that only the GUI scripts should run clientside, all other scripts like buying and spawning are supposed to be triggered serverside (in an other script file) using events.
  19. Try this https://nightly.multitheftauto.com/ports/
  20. SDK

    Save To Mysql

    I don't see the code to load all the player stats when logging in, only saving, where is it?
  21. SDK

    Please Help Guys

    why how will that help??? somebody please fix this i know its possible. Afaik, that resourceshas markers inside interiors, so you could look how it's done there if no one helps you further
  22. Seems like you forgot to remove some end's. Use /debugscript 3 to detect loading errors.
  23. popTires = true function breakCar(player, cmd) if popTires == true then setVehicleWheelStates( getPedOccupiedVehicle(player), 1, 1, 1, 1 ) end end addCommandHandler ( "pop", breakCar )
  24. SDK

    Please Help Guys

    Try looking inside the Interiors resource
  25. SDK

    Please Help Guys

    https://wiki.multitheftauto.com/wiki/SetElementInterior Look at the description, it has x, y and z arguments, try it that way. (Not sure, never worked with interiors tbh)
×
×
  • Create New...