-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
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)
-
From the wiki meta: https://wiki.multitheftauto.com/wiki/Meta.xml
-
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)
-
Why you even need xml, do it in a table better.
-
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" />>
-
addEventHandler("onPlayerLogin", root, function(_, account) local engine = getAccountData(account, "Engine") if (engine) then setElementData(source, "Engine", 1) end end)
-
what is hol? Make it yourself, we don't accept request.
-
ID, x, y and z is not defined. createVehicle ( ID, x+10, y, z ) You need getElementPosition.
-
ينقل الى قسم البرمجة
-
Comma is missing at line 6 + There is [/b] for the forum tag?
-
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)
-
You must trigger to server side for setElementFrozen and for the output.
