Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. myonlake

    [Help]Script

    Nicely put 50p. 1. Learn English 2. Get some motivation 3. Use your freaking brains 4. We do not script for you 5. Read what we tell you "sry cant know wat scriptz plz helpp!!1" -> Don't bother showing up on the latest posts stats on forums
  2. myonlake

    Scripting

    Rather make your own panel than trying to edit the existing one. You need to script a job, there's no function such as "createJob".
  3. Well, good you noticed, but at least the Wiki suggests to use it server-side rather than client-side (http://puu.sh/1kSvK). Also, the fact why it didn't work is most likely because you had an event on it. You do not need an event when using such functions.
  4. This means you are fetching data from a table. It is a good way to make your code with less lines/unnecessary crap.
  5. myonlake

    Question.

    If you need to keep it client-side, you can make a trigger on server-side and change the skin there.
  6. myonlake

    [Help]

    Then don't bother even starting working with MTA servers.
  7. https://wiki.multitheftauto.com/wiki/Scr ... troduction
  8. myonlake

    [Help]

    Learn scripting rather.
  9. myonlake

    [Help]

    Question: What do you want the scripter to do? It's a very simple question.
  10. I don't think there are team events, so you're gonna have to put the code after the spawnPlayer function.
  11. myonlake

    [Help]

    That's not what I asked... I asked what do you want someone to script? No one can help you if you only use a Google Translator to discuss.
  12. spawnPlayer You don't need setPlayerTeam when you have spawnPlayer by the way. Check the arguments from Wiki. Use XML functions when you want to connect map/xml with a script.
  13. myonlake

    MTA server plugin

    None - only the mabako's gamemode. ABRP is coming out soon - wait for it
  14. myonlake

    [Help]

    No one will script if you don't say what you want.
  15. Means the player doesn't have "joinTime" data set correctly. You could also try this: local PlayerCheckTime = getTickCount() local PlayerTodayTime = math.floor((PlayerCheckTime - tonumber(getElementData(thePlayer, "joinTime")))/1000) local PlayerOldTime = loadPlayerData(thePlayer, "playedTime") savePlayerData(thePlayer, "playedTime", PlayerOldTime + PlayerTodayTime) CheckAchievement(thePlayer, 6) setElementData(thePlayer, "joinTime", PlayerCheckTime)
  16. No problem, even though my code was more simple.
  17. myonlake

    Set Camera

    What? You want to fade camera in and out? Then use what Tomc0 told you first, which is "fadeCamera". If you want to fade the screen with something else, you could use dx-functions.
  18. Commands /teleportme - Toggles the teleporter GUI window meta.xml <meta> <info name="Teleporter" /> <script src="c_teleporter.lua" type="client" /> </meta> Client-side local sWdith, sHeight = guiGetScreenSize() local Width, Height = 231, 188 local X = (sWdith/2) - (Width/2) local Y = (sHeight/2) - (Height/2) addCommandHandler("teleportme", function(cmd) if not isElement(teleportWindow) then teleportWindow = guiCreateWindow(X, Y, Width, Height, "City Teleporter", false) guiWindowSetSizable(teleportWindow, false) showCursor(true) teleportLabel = guiCreateLabel(18.23, 30, 195, 33, "click a button to teleport to that location", false, teleportWindow) guiLabelSetHorizontalAlign(teleportLabel, "center", true) teleportButtonLS = guiCreateButton(18, 63, 195, 35, "Los Santos", false, teleportWindow) teleportButtonSF = guiCreateButton(18, 103, 195, 35, "San Fierro", false, teleportWindow) teleportButtonLV = guiCreateButton(18, 143, 195, 35, "Las Venturas", false, teleportWindow) addEventHandler("onClientGUIClick", teleportButtonLS, teleportPlayer, false) addEventHandler("onClientGUIClick", teleportButtonSF, teleportPlayer, false) addEventHandler("onClientGUIClick", teleportButtonLV, teleportPlayer, false) else destroyElement(teleportWindow) showCursor(false) end end ) function teleportPlayer(button, state) if button == "left" and state == "down" then if source == teleportButtonLS then setElementPosition(localPlayer, 1479.6, -1612.8, 14.0) setPedRotation(localPlayer, 0) outputChatBox("Welcome to Los Santos!") elseif source == teleportButtonSF then setElementPosition(localPlayer, -2265.5, 534.0, 35.0) setPedRotation(localPlayer, 270) outputChatBox("Welcome to San Fierro!") elseif source == teleportButtonLV then setElementPosition(localPlayer, 2036.9, 1545.2, 10.8 ) setPedRotation(localPlayer, 270) outputChatBox("Welcome to Las Venturas!") end destroyElement(teleportWindow) showCursor(false) end end
  19. Hmm, interesting how client-side and server-side can both cause a lot of trouble sometimes I will test triggering it server-side tomorrow. EDIT: It is working. Cheers!
  20. Kind of unfinished script I see. Client-side local fishTank = createMarker(-205.8, -573.3, 1, "cylinder", 260, 255, 0, 0, 150) addEventHandler("onClientMarkerHit", fishTank, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" then if matchingDimension then outputChatBox("You can /fish here.", 0, 255, 0, false) end end end ) addEvent("goFishing", true) addEventHandler("goFishing", root, function() if isElementWithinMarker(source, fishTank) then triggerServerEvent("castOutput", source) else outputChatBox("You can't /fish here!", 255, 0, 0, false) end end ) Server-side addCommandHandler("fish", function(player, cmd) if not exports.global:hasItem(player, 49) then outputChatBox("You need a rod to fish.", player, 255, 0, 0, false) else triggerClientEvent(player, "goFishing", player) end end ) addEvent("castOutput", true) addEventHandler("castOutput", root, function() outputChatBox("You cast out...", source, 0, 255, 0, false) end )
  21. Well, probably you can make a small trick. getElementHealth setElementData getElementData setElementHealth
  22. Hey, For some reason the below code doesn't work like how I want it to. I have done this many times and this time it doesn't really work with me. Probably a silly typo or something in the script. Client-side bindKey("K", "down", function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then if getVehicleController(vehicle) == localPlayer then setVehicleLocked(vehicle, not isVehicleLocked(vehicle)) outputChatBox("Vehicle " .. (isVehicleLocked(vehicle) and "" or "un") .. "locked.", 255, 180, 0, false) end end end ) Server-side addEventHandler("onVehicleStartExit", root, function(player, seat, jacked, door) if isVehicleLocked(source) then cancelEvent() outputChatBox("The door is locked.", player, 255, 0, 0, false) end end ) addEventHandler("onVehicleEnter", root, function(player, seat, jacked) if not isVehicleLocked(source) then if tonumber(getElementData(source, "vehicle.owner")) == 0 then outputChatBox("This " .. getVehicleName(source) .. " is a civilian vehicle.", player, 255, 180, 0, false) elseif not tonumber(getElementData(source, "vehicle.owner")) then outputChatBox("This " .. getVehicleName(source) .. " belongs to " .. getElementData(source, "vehicle.owner"):gsub("_", " ") .. ".", player, 255, 180, 0, false) end else local x, y, z = getElementPosition(player) removePedFromVehicle(player) setElementPosition(player, x, y, z + 2) end end )
  23. I just suggest making your own gamemode instead of trying to edit an unfinished gamemode.
×
×
  • Create New...