Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. Where is the table obj?
  2. Server Side: DownloadDisplay = textCreateDisplay() Text = textCreateTextItem("Your text here ...", 0.5, 0.5) textDisplayAddText(DownloadDisplay, Text) addEventHandler("onPlayerJoin", root, function() textDisplayAddObserver(DownloadDisplay, source) end) addEvent("onClientDownloadFinish", true) addEventHandler("onClientDownloadFinish", root, function() if textDisplayIsObserver(DownloadDisplay, source) then textDisplayRemoveObserver(DownloadDisplay, source) end end) Client Side: Timer = setTimer(function() if not isTransferBoxActive() then triggerServerEvent("onClientDownloadFinish", localPlayer) if isTimer(Timer) then killTimer(Timer) end end end, 1000, 0)
  3. TAPL

    OOP functions

    From the wiki meta: https://wiki.multitheftauto.com/wiki/Meta.xml
  4. TAPL

    Help my script

    You're welcome.
  5. TAPL

    Need help

    StatTable = { {"Weapon Skills", ""}, {"AK-47", 77}, {"M4", 78}, {"MP5", 76}, {"Pistol", 69}, {"Sawnoff Shotgun", 73}, {"Shotgun", 72}, {"Silenced Pistol", 70}, {"Sniper Rifle", 79}, {"Spaz-12", 74}, {"Uzi", 75}, {"Body Skills", ""}, {"Fat", 21}, {"Max Health", 24}, {"Stamina", 22}, {"Muscle", 23} } GUIEditor = { gridlist = {}, window = {}, button = {}} GUIEditor.window[1] = guiCreateWindow(581, 275, 375, 337, "Stat Panel", false) guiSetVisible(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(12, 25, 353, 257, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Stat", 0.4) guiGridListAddColumn(GUIEditor.gridlist[1], "Value", 0.4) GUIEditor.button[1] = guiCreateButton(105, 291, 158, 36, "Close", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") function enableStatPanel() if guiGetVisible(GUIEditor.window[1]) == false then updateGridList() if not isTimer(upTimer) then upTimer = setTimer(updateGridList, 3000, 0) end guiSetVisible(GUIEditor.window[1], true) showCursor(true) else if isTimer(upTimer) then killTimer(upTimer) end guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey("H","down", enableStatPanel) function updateGridList() guiGridListClear(GUIEditor.gridlist[1]) for _, i in pairs(StatTable) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], row, 1, i[1], false, false) guiGridListSetItemText(GUIEditor.gridlist[1], row, 2, i[2] ~= "" and getPedStat(localPlayer, i[2]) or "", false, false) end end function closeButton() guiSetVisible(GUIEditor.window[1], false) showCursor(false) if isTimer(upTimer) then killTimer(upTimer) end end addEventHandler("onClientGUIClick", GUIEditor.button[1], closeButton, false)
  6. TAPL

    Need help

    Why you even need xml, do it in a table better.
  7. TAPL

    Help my script

    Client Side: local sx, sy = guiGetScreenSize() local sx = sx/2 local sy = sy/2 function drawText() local width = dxGetTextWidth(theText, 3, "default") local height = dxGetFontHeight(3, "default") local leftB = sx - width/2 local topB = sy - (height + 5) local left = sx - width/2 local top = sy - height dxDrawText(theText, leftB+2, topB+2, left, top, tocolor(0, 0, 0, 255), 3, "default-bold", "left", "top", false, true, true) dxDrawText(ColorText..theText, leftB, topB, left, top, tocolor(255,255,255,255), 3, "default-bold", "left", "top", false, true, true,true) end function drawShout(text, color) if not isTimer(drawTimer) and text and color then addEventHandler("onClientRender", root, drawText) theText = text ColorText = color drawTimer = setTimer(function() removeEventHandler("onClientRender", root, drawText) end, 5000, 1) end end addEvent("onShouts", true) addEventHandler("onShouts", root, drawShout) Server Side: function shout(player, cmd, ...) local accountName = getAccountName(getPlayerAccount(player)) local message = table.concat({...}, " ") if isObjectInACLGroup("user."..accountName, aclGetGroup("Admin")) then triggerClientEvent(root, "onShouts", root, message, get("ColorText")) else outputChatBox("* #0080FFNo puedes usar este comando!", player, 255, 255, 255, true) end end addCommandHandler("shout", shout) Meta setting: > name="*ColorText" value="#0080FF" />>
  8. addEventHandler("onPlayerLogin", root, function(_, account) local engine = getAccountData(account, "Engine") if (engine) then setElementData(source, "Engine", 1) end end)
  9. what is hol? Make it yourself, we don't accept request.
  10. ID, x, y and z is not defined. createVehicle ( ID, x+10, y, z ) You need getElementPosition.
  11. ينقل الى قسم البرمجة
  12. TAPL

    export

    ينقل الى قسم البرمجة
  13. ينقل الى قسم البرمجة
  14. ينقل الى قسم البرمجة
  15. ينقل الى قسم البرمجة
  16. ينقل الى قسم البرمجة
  17. You're welcome.
  18. TAPL

    Buy Menu

    Post the code.
  19. Comma is missing at line 6 + There is [/b] for the forum tag?
  20. What?
  21. You're welcome.
  22. addEvent("freeze", true) addEventHandler("freeze", root, function (player) setElementFrozen(player, true) outputChatBox("You Have Been Frozen By "..getPlayerName(source)..".", player, 255, 0, 0) end) addEventHandler("onClientGUIClick", root, function () if (source == frez) then local row, col = guiGridListGetSelectedItem(playerlist) local select = guiGridListGetItemText(playerlist, row, col) if select and select ~= "" then local player = getPlayerFromName(select) if player then triggerServerEvent("freeze", getLocalPlayer(), player) end else outputChatBox("Please Select Player.", 255, 0, 0) end end end)
  23. Post the client.
  24. You must trigger to server side for setElementFrozen and for the output.
×
×
  • Create New...