Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. And I don't see why you say slowly. MTA updates really fast - I personally use nightly builds and they come out almost every day. SA-MP never has any updates, almost like once in a year or something - be happy to be part of MTA.
  2. Perhaps get a new computer. Nobody likes to play with a Windows 2000 and runs like an old Chevrolet. This is the new time, it's time for people to get a good computer to use if you play games.
  3. 1) Use the lua -tags when posting code here on forums. 2) '~~~~~~~' is not representing commenting, to make comments in your code, use '--' or '--[[ ]]' 3) You didn't write the 'function' correctly, you wrote it 'funtion' 4) You triggered the GUI for all players, not the one hitting the marker 5) You didn't check what kind of elements hit the marker, and whether it was in the corresponding dimension 6) getLocalPlayer() has a predefined name 'localPlayer', so no need to make any special ones for it 7) You checked whether the player was in the same team, twice I made the code a little simpler, try this. Server-side local theMarker1 = createMarker(1542.35608, -1682.45471, 12.55434, "cylinder", 2, 0, 0, 255, 150) addEventHandler("onResourceStart", resourceRoot, function() Policeteam = createTeam("Police", 100, 149, 237) end ) addEvent("Get.job", true) addEventHandler("Get.job", root, function() if getTeamName(getPlayerTeam(source)) == "Police" then exports["guimessages"]:outputServer(root, "Error: You are already working as a police", 255, 0, 0) else exports["guimessages"]:outputServer(root, "You are now working as a police", 0, 0, 255) setPlayerTeam(source, Policeteam) setPlayerNametagColor(source, 100, 149, 237) setElementModel(source, 280) giveWeapon(source, 3) end end ) addEventHandler("onMarkerHit", theMarker1, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then triggerClientEvent(hitElement, "onShowgui", hitElement) end end ) Client-side function toggleWindow() if not isElement(Window) then Window = guiCreateWindow(544, 186, 456, 422, "Police test", false) Getjob = guiCreateButton(34, 283, 145, 92, "Get job", false, Window) Cancel = guiCreateButton(247, 287, 144, 85, "Cancel", false, Window) Label = guiCreateLabel(69, 46, 321, 206, "Test", false, Window) showCursor(true) addEventHandler("onClientGUIClick", Getjob, function() triggerServerEvent("Get.job", localPlayer) destroyElement(Window) showCursor(false) end, false) else guiBringToFront(window) showCursor(true) end end addEvent("onShowgui", true) addEventHandler("onShowgui", root, toggleWindow)
  4. setWeaponFrozen is not a function name
  5. It's not possible, but it is possible to make your own text showing up when you enter the vehicle
  6. Kind of okay but not using your imagination much. Straight from CIT if I remember right.
  7. You're welcome, but 3ɑsн8 ɑʟsнɾq's code is good as well, but the thing is, as you want to keep it server-side, then keep it server-side.
  8. That's nothing what he wants. 1) Your code is client-side 2) You are triggering it to the local player as it's client-side -- Maybe this code will help you. Server-side setTimer(function() for i,v in ipairs(getElementsByType("player")) do if isElementInWater(v) then setElementHealth(v, getElementHealth(v)-5) end end end, 5000, 0)
  9. myonlake

    [HELP]GUi

    You might like these in the future: https://wiki.multitheftauto.com/wiki/Client_Commands https://wiki.multitheftauto.com/wiki/Server_Commands
  10. I want my three own map resources deleted. Only these! https://community.multitheftauto.com/index.php?p= ... ls&id=1645 https://community.multitheftauto.com/index.php?p= ... ls&id=1652 https://community.multitheftauto.com/index.php?p= ... ls&id=1680 -- Author changed from 50p to |Cryzis| from README and meta.xml. However, he forgot to change one last line from the README file where it has a link to 50p's forum profile. Cryzis is taking all the credit to himself by just changing the language. Remove please. https://community.multitheftauto.com/index.php?p= ... ls&id=6029 <info type="script" name="Banco sistema" version="3.1" author="|Cryzis|"/> DONE
  11. Java SDK for MTA is an MTA module. Perhaps don't post if you don't even know. so its LUA and JAVA?? "This SDK allows you to call exported MTA functions from Java over HTTP." https://wiki.multitheftauto.com/wiki/Java_SDK This is used in MTA, it is very useful.
  12. Java SDK for MTA is an MTA module. Perhaps don't post if you don't even know.
  13. MTA team can easily get any user from serial , and yet again , the serial cannot be changed. Is that so? How come my MTA always gets a new serial when I re-install it?
  14. Invalid resource (no content, nothing): https://community.multitheftauto.com/index.php?p= ... ls&id=6009 Modification + Can't download: https://community.multitheftauto.com/index.php?p= ... ls&id=6015 DONE
  15. Probably show us the code first. Two lines is not enough.
  16. Honestly speaking, you do not release a code, which has no single base. I never released my first codes, also because no one would use them but they are laggy and buggy as crap.
  17. Worst code I have ever seen in my life. Probably times out a bunch of people and lags the server with everything it can. This is the worst possible way of doing it.
  18. exports.players:getUserName ( player thePlayer )
  19. That means you haven't deleted the LOD object. You have to find out the LOD object's ID by going into your Map Editor, choosing the world item selection tool, move your cursor over the object and it should display the model ID and LOD ID.
  20. I can't see the pictures. Secondly, you haven't probably re-connected or went off from the streamer area? Because it will not be removed immediately from the streamer. You have to be out from the streamer range to apply it. For example, use freeroam resource to teleport to the other side of the map and then teleport back, should be gone.
  21. Well, just an example. local vehicles = {[420]=true, [438]=true} for i,v in ipairs(getElementsByType("vehicle")) do if vehicles[getElementModel(v)] then setVehicleLocked(v, false) end end
  22. Don't bother starting to script if you have no single idea of scripting in general.
  23. Everything. Try this. Client-side local musicStream = "http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls" addEventHandler("onClientResourceStart", function() sound = playSound(musicStream, true) end ) function makeRadioStayOff() setRadioChannel(0) cancelEvent() end addEventHandler("onClientPlayerRadioSwitch", root, makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter", root, makeRadioStayOff) addCommandHandler("radio", function(cmd) if not songOff then setSoundVolume(sound, 0) songOff = true removeEventHandler("onClientPlayerRadioSwitch", root, makeRadioStayOff) else setSoundVolume(sound, 1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch", root, makeRadioStayOff) end end ) addEventHandler("onClientRender", root, function() if not songOff then dxDrawText("[RADIO] Radio is switched on", 0, 0, 5, 5, tocolor(0, 0, 0, 255), 1, "default-bold") else dxDrawText("[RADIO] Radio is switched off", 0, 0, 5, 5, tocolor(0, 0, 0, 255), 1, "default-bold") end end )
×
×
  • Create New...