Jump to content

Search the Community

Showing results for tags 'why'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. client side: server side: c.lua:5: attempt to concatenate local amount
  2. i created a dx panel, and i created some onClientClick event for this panel. but when i hide the panel, the onClientClick events are working.. how to fix this?
  3. code: addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports [ "scoreboard" ]:addScoreboardColumn ( "Jármű:", 3 ) end ) setTimer ( function ( ) local players = getElementsByType "player" for k, v in ipairs ( players ) do if ( isPedInVehicle(v) ) then local vehicle = getPedOccupiedVehicle(v) local carname = getVehicleName(vehicle) setElementData ( v, "Jármű:", tostring(carname) ) else setElementData ( v, "Jármű:", "Nincs") end end end, 2500, 0 ) and i get this error: ERROR: Loading script failed: xy/xy.lua:1: unexpected symbol near '?' how to fix this?
  4. local start = getTickCount() local one, one1 = -300, 604 local two, two1 = 0, 604 local screenW, screenH = guiGetScreenSize() local text = "" local pic = "j" function draw() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") local now = getTickCount() dxDrawRectangle(x,y, screenW * 0.2306, screenH * 0.0356, tocolor(0, 0, 0, 130), false) dxDrawText(" * "..text, x, y, screenW * 0.2340, screenH * 0.7044, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, true, false) end addEventHandler("onClientPlayerChangeNick", root, function(oldName, newName) addEventHandler("onClientRender", root,draw) text = string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. oldName .. " #FFffFFneve mostantól " .. string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. newName .. "" pic = "c" setTimer ( function() removeEventHandler("onClientRender", root, draw) end, 5000, 1 ) end ) this is my code. the dx things are working, just the animation does not working how to fix? sorry for my very bad english :C
  5. i downloaded a jail script from community, and when i add me to a jail, i can access the F1 how to disable fr gui in jail? server: Command = get("command") -- getTheCommand rRoot = getResourceRootElement(getThisResource()) ------ function getData(to) local file = xmlLoadFile("data.xml") jTable = {} tTable = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do local name = xmlNodeGetAttribute(v,"name") local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ") local int = xmlNodeGetAttribute(v,"int") local dim = xmlNodeGetAttribute(v,"dim") table.insert(jTable, {name,posX,posY,posZ,int,dim}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do local times = xmlNodeGetAttribute(v,"times") for i =1,50 do local iTime = gettok ( times, i, string.byte(',') ) if iTime then -- if tonumber(iTime) > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Minutes" if iTime > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Hours" end else iTimeDes = "Seconds" end table.insert(tTable,{iTime,iTimeDes}) end end end end triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event end addEvent("getDataz",true) addEventHandler("getDataz",root,getData) addCommandHandler ( Command, -- Adding The Command Handler function ( player, cmd ) if hasObjectPermissionTo ( player, "function.banPlayer" ) then triggerClientEvent(player,"jailShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end ) anims = { "F_smklean_loop", "M_smklean_loop", "M_smkstnd_loop", "M_smk_drag", "M_smk_in", "M_smk_loop", "M_smk_out", "M_smk_tap" , } function removeVehicle(thePlayer) if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end end function JailHim(jailed,theJails,time,timeDes,showWho,timeReady) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end removePedFromVehicle(thePlayer) for k,v in ipairs ( jTable ) do if theJails == v[1] then theJail = v end end if theJail then if tostring(time) then if timeReady == true then theTimex = tonumber(time) else theTimex = gettok ( time, 1, string.byte(timeDes) ) end if timeDes == "Hours" then theTimex = math.floor(theTimex*60*60*1000) elseif timeDes == "Minutes" then theTimex = math.floor(theTimex*60*1000) elseif timeDes == "Seconds" then theTimex = math.floor(theTimex*1000) end startJailTimer ( thePlayer , theTimex ) local x,y,z = theJail[2],theJail[3],theJail[4] local int = theJail[5] local dim = theJail[6] setElementInterior ( thePlayer, int ) setElementDimension ( thePlayer, dim ) setElementPosition (thePlayer,x,y,z ) setElementData(thePlayer,"jailed",true) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",true) toggleControl(thePlayer,"fire",false) if showWho ~= true then outputChatBox("** #FFFF00You Jailed [ "..getPlayerName(thePlayer).." #FFFF00] at "..theJail[1].." For "..time,source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Jailed By [ "..getPlayerName(source).." #FFFF00] at "..theJail[1].." For "..time,thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Jailed For "..time,root,255,0,0,true) local randomAnim setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2) else outputChatBox("** #FFFF00Please Select Time !",source,255,0,0,true) end else outputChatBox("** #FFFF00Please Select a Jail !",source,255,0,0,true) end end addEvent("JailHimx",true) addEventHandler("JailHimx",root,JailHim) function unJailHim(jailed,showWho) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end --if getElementData(thePlayer,"jailed") == true then setElementInterior ( thePlayer, 0) setElementDimension ( thePlayer, 0 ) setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125) setElementData(thePlayer,"jailed",false) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",false) if showWho ~= true then outputChatBox("** #FFFF00You Released [ "..getPlayerName(thePlayer).." #FFFF00]",source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Released by [ "..getPlayerName(source).." #FFFF00]",thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Released ",root,255,0,0,true) setPedAnimation(thePlayer) stopJailTimer(Player) toggleControl(thePlayer,"fire",true) -- setTimer(killPed,1500,1,thePlayer) --else -- outputChatBox("The Player is Not Jailed !",source,255,0,0,true) --end end addEvent("unJailHim",true)-- unJail addEventHandler("unJailHim",root,unJailHim) addEvent("onJailEnd",true) addEventHandler("onJailEnd",root,function(player) unJailHim(getPlayerName(player),true) end ) addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ] function() if getElementData(source,"jailed") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) end end end) addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ] function() if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) -- time = getElementData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000 startJailTimer(source,time) setElementData(source,"jailed",true) end end end ) ---- function startJailTimer(Player,theTime) -- to start mission timer .. if Player then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(theTime) fullTime = m..":"..s TimerText = textCreateTextItem ( "Time Left : "..tostring(fullTime).."", 0.39, 0.7 ,"medium",0,255,0,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, Player ) sortTimer:~(Player,TimerText,theTime) end end --Robbed from JailTimerr resource , and it was robbed from arc_ :p function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimer:~(plr,timer,time) -- to sort timer's :~ .. if timer and time then if isTimer(timer:~Timer) then killTimer(timer:~Timer) end timer:~Timer = setTimer(function(plr) time = time - 70 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,"Time Left : "..tostring(fullTime).."") if plr then setElementData(rRoot,""..getPlayerSerial(plr).."-t",time) end if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then onTimerFinish(plr,timer) end end , 50 , 0 ,plr ) end end function stopJailTimer(Player) textDestroyDisplay(TimerDisplay) if TimerText then textDestroyTextItem(TimerText) end if isTimer(timer:~Timer) then killTimer(timer:~Timer) end end function onTimerFinish(Player) -- on timer end stopJailTimer(Player) triggerEvent("onJailEnd",Player,Player) end client: lp = getLocalPlayer() rRoot = getResourceRootElement(getThisResource()) setElementData(lp,"jailed",false) ------ addEventHandler("onClientResourceStart",rRoot,function() triggerServerEvent("getDataz",lp,lp) end ) desz = {} addEvent("sendDataz",true) addEventHandler("sendDataz",root,function(jTable,tTable) ------ jWin = guiCreateWindow(460,172,445,416,"Jail System v2.1",false) --- Center Window --- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(jWin,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(jWin,x,y,false) ----- Center Window ----- guiSetVisible(jWin,false) guiWindowSetSizable(jWin,false) ------------------------- jBut = guiCreateButton(247,338,167,31,"Jail Him",false,jWin) tGrid = guiCreateGridList(240,184,190,144,false,jWin) guiGridListSetSelectionMode(tGrid,0) ------- -- sEdit = guiCreateEdit(14,380,217,23,"Search ..",false,jWin) -- -------- local timeC = guiGridListAddColumn( tGrid, "Time", 0.85 ) if timeC then for k,v in ipairs ( tTable ) do local time = v[1] local des = v[2] local row = guiGridListAddRow ( tGrid ) desz[row] = des guiGridListSetItemText ( tGrid, row, timeC, time.." "..des, false, true ) end local row = guiGridListAddRow ( tGrid ) guiGridListSetItemText ( tGrid, row, timeC,"Other ..", false, true ) end -------- jGrid = guiCreateGridList(240,31,190,144,false,jWin) guiGridListSetSelectionMode(jGrid,0) -------- local jailC = guiGridListAddColumn( jGrid, "Jail", 0.85 ) for k,v in ipairs ( jTable ) do local name = v[1] local row = guiGridListAddRow ( jGrid ) guiGridListSetItemText ( jGrid, row, jailC, name, false, false ) end jcBut = guiCreateButton(246,378,172,24,"Close",false,jWin) function jailShow () guiSetVisible(jWin,not guiGetVisible ( jWin ) ) showCursor(guiGetVisible ( jWin ) ) guiSetInputEnabled(guiGetVisible ( jWin ) ) destroyElement(pList) -- Players List pList = guiCreateGridList(14,31,218,338,false,jWin) column = guiGridListAddColumn( pList, "Player", 0.85 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end -- Players List end addEvent("jailShow",true) addEventHandler("jailShow",root,jailShow) function changeText(button,state,x,y) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) local thePlr = getPlayerFromName(sPlayer) if thePlr then local isJailed = getElementData(thePlr,"jailed") if isJailed == false then guiSetText(jBut,"Jail Him") elseif isJailed == true then guiSetText(jBut,"Release Him") end end end addEventHandler("onClientGUIClick",root,changeText) function onClick (button, state, absoluteX, absoluteY) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) jail = guiGridListGetItemText ( jGrid, guiGridListGetSelectedItem ( jGrid ), 1 ) time = guiGridListGetItemText ( tGrid, guiGridListGetSelectedItem ( tGrid ), 1 ) timeDes = tostring(desz[guiGridListGetSelectedItem ( tGrid )]) if ( source == jBut ) then if guiGetText(jBut) == "Jail Him" then if time ~= "Other .." then triggerServerEvent("JailHimx",lp,sPlayer,jail,time,timeDes) else createTimeSelect(sPlayer,jail) end elseif guiGetText(jBut) == "Release Him" then triggerServerEvent("unJailHim",lp,sPlayer) end ---------- elseif ( source == jcBut ) then guiSetVisible (jWin, false) showCursor (false) guiSetInputEnabled(false) end end addEventHandler( "onClientGUIClick", root, onClick ) ------------ end ) addEventHandler("onClientPlayerDamage",root,function(at) if getElementData(source,"jailed") == true then if at then cancelEvent() end end end ) ------- addEventHandler("onClientGUIClick",root,function() if source == sEdit then guiSetText(sEdit,"") --[[ else guiSetText(sEdit,"Search ..") --]] end end ) addEventHandler("onClientGUIChanged",root,function() if source == sEdit then ------ guiGridListClear(pList) for k,v in ipairs ( getElementsByType("player") ) do local name = string.lower(getPlayerName(v)) if name then if string.find (name,string.lower(guiGetText(sEdit)) ) then row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( v ), false, false ) end end end end ------ end ) ------ function createTimeSelect(theJailed,theJail) if not tostring(theJailed) then outputChatBox("** #FFFF00Please Select a Player !",255,0,0,true) return end if not tostring(theJail) then outputChatBox("** #FFFF00Please Select a Jail !",255,0,0,true) return end if isElement(TimeSelect_Window) then return end TimeSelect_Window = guiCreateWindow(550,397,270,125,"Enter Time",false) -- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(TimeSelect_Window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(TimeSelect_Window,x,y,false) -- -- guiSetVisible(jWin,false) -- TimeSelect_Edit = guiCreateEdit(15,37,89,26,"",false,TimeSelect_Window) TimeSelect_Label = guiCreateLabel(110,41,10,15,"in",false,TimeSelect_Window) TimeSelect_Grid = guiCreateGridList(126,31,130,95,false,TimeSelect_Window) guiGridListSetSelectionMode(TimeSelect_Grid,2) --- column = guiGridListAddColumn( TimeSelect_Grid, "", 0.80 ) r1 = guiGridListAddRow(TimeSelect_Grid) r2 = guiGridListAddRow(TimeSelect_Grid) r3 = guiGridListAddRow(TimeSelect_Grid) guiGridListSetItemText ( TimeSelect_Grid , r1, column, "Hours", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r2, column,"Minutes", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r3, column, "Seconds", false, false ) TimeSelect_Button = guiCreateButton(14,72,91,40,"OK",false,TimeSelect_Window) -- function onOk() if source == TimeSelect_Button then -- removeEventHandler("onClientGUIClick",root,onOk) -- ---------------- theTime = guiGetText(TimeSelect_Edit) timeType = guiGridListGetItemText ( TimeSelect_Grid, guiGridListGetSelectedItem ( TimeSelect_Grid ) ) -- destroyElement(TimeSelect_Window) jailShow () -- if tonumber(theTime) then if tostring(timeType) then triggerServerEvent("JailHimx",lp,theJailed,theJail,theTime.." "..timeType,timeType,true) else outputChatBox("** #FFFF00Please Select , Hours or Minutes or Seconds !",255,0,0,true) end else outputChatBox("** #FFFF00Please Enter a Number !",255,0,0,true) end ---------------- end end addEventHandler("onClientGUIClick",root,onOk) end
  6. I created a Brown Streak mod. And the dff&txd working fine, but the .col does not working. I got a warning in debugscript 3: mod.lua:14: Bad 'number' pointer @ engineReplaceCOL'(2) This is the mod.lua code: function replaceModel() local txd colsok = engineLoadCOL ( "v43.col" ) engineReplaceCOL ( colsok, 538) txd = engineLoadTXD ( "v43.txd" ) engineImportTXD ( txd, 538 ) dff = engineLoadDFF ( "v43.dff" ) engineReplaceModel ( dff, 538 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) addCommandHandler ( "reloadcar", replaceModel ) What wrong? How to fix this?
  7. local movingOffsetX, movingOffsetY = 0, 0 local isMoving = false bindKey('m', 'down', function() showCursor(not isCursorShowing()); end ) function drawRadar() showPlayerHudComponent("radar", false) if disableGTASAhealth then showPlayerHudComponent("health", false) end if disableGTASAarmor then showPlayerHudComponent("armour", false) end if disableGTASAoxygen then showPlayerHudComponent("breath", false) end if (not isPlayerMapVisible()) then if (isCursorShowing() and isMoving) then local cursorX, cursorY = getCursorPosition(); cursorX = cursorX * sx; cursorY = cursorY * sy; xFactor = cursorX - movingOffsetX; yFactor = cursorY - movingOffsetY; end local mW, mH = dxGetMaterialSize(rt) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxSetRenderTarget(rt, true) if alwaysRenderMap or getElementInterior(localPlayer) == 0 then dxDrawRectangle(xFactor, yFactor, worldW, worldH, 0xFF5E656B) dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/world.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) end dxSetRenderTarget() dxDrawRectangle((10)*xFactor, sy-((200+10))*yFactor, (300)*xFactor, (184)*yFactor, tocolor(0, 0, 0, 175)) dxDrawImage((10+5)*xFactor, sy-((200+5))*yFactor, (300-10)*xFactor, (175)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 255)) local rx, ry, rz = getElementRotation(localPlayer) local lB = (15)*xFactor local rB = (15+290)*xFactor local tB = sy-(205)*yFactor local bB = tB + (175)*yFactor local cX, cY = (rB+lB)/2, (tB+bB)/2 +(35)*yFactor local toLeft, toTop, toRight, toBottom = cX-lB, cY-tB, rB-cX, bB-cY for k, v in ipairs(getElementsByType("blip")) do local bx, by = getElementPosition(v) local actualDist = getDistanceBetweenPoints2D(x, y, bx, by) local maxDist = getBlipVisibleDistance(v) if actualDist <= maxDist and getElementDimension(v)==getElementDimension(localPlayer) and getElementInterior(v)==getElementInterior(localPlayer) then local dist = actualDist/(6000/((worldW+worldH)/2)) local rot = findRotation(bx, by, x, y)-camZ local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.min(dist, math.sqrt(toTop^2 + toRight^2)), rot) local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) local bid = getElementData(v, "customIcon") or getBlipIcon(v) local _, _, _, bcA = getBlipColor(v) local bcR, bcG, bcB = 255, 255, 255 if getBlipIcon(v) == 0 then bcR, bcG, bcB = getBlipColor(v) end local bS = getBlipSize(v) dxDrawImage(bpx -(blip*bS)*xFactor/2, bpy -(blip*bS)*yFactor/2, (blip*bS)*xFactor, (blip*bS)*yFactor, "image/blip/"..bid..".png", 0, 0, 0, tocolor(bcR, bcG, bcB, bcA)) end end if renderNorthBlip then local rot = -camZ+180 local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.sqrt(toTop^2 + toRight^2), rot) --get position local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position to screen local dist = getDistanceBetweenPoints2D(cX, cY, bpx, bpy) --get distance to the capped position local bpx, bpy = getPointFromDistanceRotation(cX, cY, dist, rot) --re-calculate position based on new distance if bpx and bpy then --if position was obtained successfully local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position just in case dxDrawImage(bpx -(blip*2)/2, bpy -(blip*2)/2, blip*2, blip*2, "image/blip/4.png", 0, 0, 0) --draw north (4) blip end end dxDrawImage(cX -(blip*2)*xFactor/2, cY -(blip*2)*yFactor/2, (blip*2)*xFactor, (blip*2)*yFactor, "image/player.png", camZ-rz, 0, 0) end end addEventHandler("onClientRender", root, drawRadar) addEventHandler('onClientClick', getRootElement(), function(button, state, cursorX, cursorY) if (not isPlayerMapVisible()) then local cursorX, cursorY = getCursorPosition(); if (button == 'left' and state == 'down') then if (cursorX >= xFactor and cursorX <= xFactor + worldW and cursorY >= yFactor and cursorY <= yFactor + worldH) then isMoving = true; movingOffsetX = cursorX - xFactor; movingOffsetY = cursorY - yFactor; end else isMoving = false; end end end ) No errors/warnings in debugscript 3, what the problem with this?
  8. local titles = { "AdminSegéd", "Moderátor", "SzuperModerátor", "Admin", "FőAdmin", "Tulajdonos", "Fejlesztő" } function getPlayerAdminTitle() local text = titles if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then text = "Tulajdonos" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("FoAdmin")) then text = "FőAdmin" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Adminseged")) then text = "AdminSegéd" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("KisAdmin")) then text = "Admin" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Fejleszto")) then text = "Fejlesztő" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) then text = "Moderátor" end end function getFixedName(player) if isElement(player) then local hisName = getPlayerName(player) if hisName then result = string.gsub(hisName, '#%x%x%x%x%x%x', '') if result then return result end end end end function adminuzi(thePlayer, commandName, ...) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("FoAdmin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Adminseged")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("KisAdmin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Fejleszto")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Moderator")) then if not (...) then outputChatBox("#00FF7F[Használat]:#FFFFFF /".. commandName .." [üzenet]", thePlayer, 0, 206, 209,true) else local adminrang = getPlayerAdminTitle(thePlayer) message = table.concat({...}, " ") local playerName = getFixedName ( thePlayer ) outputChatBox("#0088FF[SUPERFUN-Admin]#d8001f "..playerName..": "..message,getRootElement(),0,0,0,true) end end end addCommandHandler("asay", adminuzi, false, false) i have this script, and i get this warnings/error: How to fix this?
  9. I have this script: dxDrawRectangle(screenW * 0.7549, screenH * 0.6933 - 1 - (33*k), screenW * 0.2347, screenH * 0.0211, tocolor(0, 0, 0, 145), false) dxDrawText(v.text, screenW * 0.7535, screenH * 0.6933 - 1 - (66*k), screenW * 0.9896, screenH * 0.7144, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, true, false) and different resolutions the distance grow, or lessen. Picture: How to fix this problem? I want, that all resulotions distance the same. Thanks the help! And sorry for my very bad english!
  10. i have this script, and does not update online players number, why? local online = #getElementsByType("player") local messagesList = { online.."/30", "SF", } local currentMessage = 0 addEventHandler("onClientPreRender", getRootElement(), function() local online = #getElementsByType("player") dxDrawText(messagesList[currentMessage + 1], screenW * 0.6014+3, screenH * 0.9656+3, screenW * 0.6556, screenH * 0.9978, tocolor(0, 0, 0, 255), 2.20, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(messagesList[currentMessage + 1], screenW * 0.6014, screenH * 0.9656, screenW * 0.6556, screenH * 0.9978, tocolor(255, 255, 255, 255), 2.20, "default-bold", "center", "bottom", false, false, false, false, false) end ) function updateMessage() if (currentMessage == 1) then currentMessage = 0 else currentMessage = currentMessage + 1 end end setTimer(updateMessage, 2000, 0)
  11. I have this: addEventHandler('onPlayerQuit', root, function(reason) Reasons = { ["Unknown"] = "Nem tudni", ["Quit"] = "kilépett.", ["Kicked"] = "kirúgva a szerverről.", ["Banned"] = "kibanolva a szerverről.", ["Timed Out"] = "kifagyott.", ["Bad Connection"] = "rossz internetkapcsolat" } local name = getPlayerName(source) triggerClientEvent(root, "createNotification", root, "#FFffFF"..Reasons[reason], "simple", name) end ) and the "Quit", "Kicked", and "Banned" msg working fine, but the "Timed Out" no.. does not show the timed out notification, but why? yeah, and i got this error: S.lua:12: attempt to concatenate field '?' (a nil value) thanks the help!
  12. local screenW, screenH = guiGetScreenSize() function ahudd() dxDrawImage(screenW * 0.8424, screenH * 0.6289, screenW * 0.1194, screenH * 0.0256, "nbgg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.8444, screenH * 0.6322, screenW * 0.1153, screenH * 0.0189, "nn.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Jármű épség:", (screenW * 0.8424) + 1, (screenH * 0.6289) + 1, (screenW * 0.9618) + 1, (screenH * 0.6544) + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Jármű épség:", screenW * 0.8424, screenH * 0.6289, screenW * 0.9618, screenH * 0.6544, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end function asdxd() local playerVehicle = getPedOccupiedVehicle ( localPlayer ) if playerVehicle then local vehicleHealth = getElementHealth ( playerVehicle ) / 10 addEventHandler("onClientRender", root, ahudd) else removeEventHandler("onClientRender", root, ahudd) end end addEventHandler("onClientRender", root, asdxd) fileDelete("client.lua") why not working? i want, when the player get in a vehicle, show the dx element, and when get out, hide the dx element, and if player in a vehicle, the dx element show just for her
  13. local countdown = 120 G3 = guiCreateLabel(0.49, 0.67, 0.03, 0.02, tostring(countdown).." mp", true) guiSetFont(G3, "default-bold-small") guiSetVisible(G3,false) addEventHandler("onClientGUIClick",root, function () if source == buttonGuest then removeEventHandler("onClientRender",root,a123) addEventHandler("onClientRender", root, dxhavendeg) guiSetVisible(buttonLogin,false) guiSetVisible(buttonRegister,false) guiSetVisible(buttonGuest,false) guiSetVisible(editPassword,false) guiSetVisible(editUsername,false) setTimer(function () countdown = countdown - 1 if countdown >= 0 then guiSetText(G3, tostring(countdown)) else outputChatBox("asd") end end, 120000, 1000) end end ) what wrong?
  14. client: function asdasd111() removeEventHandler("onClientRender",root,a123) guiSetVisible(buttonLogin,false) guiSetVisible(buttonRegister,false) guiSetVisible(buttonGuest,false) guiSetVisible(editPassword,false) guiSetVisible(editUsername,false) guiSetVisible(G1,false) guiSetVisible(G2,false) showCursor(false) end addEvent ( "onClientPlayerLogin", true ) addEventHandler ( "onClientPlayerLogin", root, asdasd111 ) server: function triggerLogin ( player, username, password ) triggerClientEvent ( player, "onClientPlayerLogin", player, username, password ) end what wrong?
  15. i added DD maps, but doesn't working.. when i connect the server, show votemanager, i vote for example 7, and the map does not start.. Why? -.-
  16. i have a radar script, with "showPlayerHudComponent("radar", false)" but the radar, when change map will show again, why? how to fix? Race gamemode!
  17. function buyWeapon(thePlayer, command) local mycoins = exports.coinsystem:getPlayerCoin(thePlayer) if (mycoins >= 1) then giveWeapon(thePlayer, 31, 2000) exports.coinsystem:takePlayerCoin(thePlayer, prize) outputChatBox("you bought a M4.", thePlayer, 0, 255, 0, false) else outputChatBox("you don't have enough coins!", thePlayer, 255, 0, 0, false) end end addCommandHandler("buyw", buyWeapon) i got this error: xy.lua:17: attempt to compare number with nil
  18. function someName(killer,weapon,bodypart) if(killer == getLocalPlayer()) then return end if bodypart == 9 then local sound = playSound("headshot.mp3",false) end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), someName ) fileDelete("client.lua") what wrong?
  19. i added this to a nametag script: dxDrawColorText (getElementHealth(player).."%", sx-w- (offset*-10), sy - (offset*5), sx, sy - (offset*-15), tocolor(255,255,255,255), textscale*NAMETAG_TEXTSIZE or (textscale*NAMETAG_TEXTSIZE)/1.5, srfont2, "center", "center", false, false, false ) and for example when long the playername, the "100%" move to left direction. How to fix this? sorry for my very-very bad English:c
  20. fr_server.lua: function warpMe(targetPlayer) local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) if getElementData(targetPlayer, "IsWarpLocked") then outputChatBox("The player you want to warp to has locked warping.", source, 255, 0, 0, false) return end if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox("No free seats left in " .. getPlayerName(targetPlayer) .. "'s vehicle.", source, 255, 0, 0) end end addCommandHandler("lockwarp", function(player) setElementData(player, "IsWarpLocked", true) end) addCommandHandler("unlockwarp", function(player) removeElementData(player, "IsWarpLocked") end) fr_client.lua: {'chk', id='IsWarpLocked', text='Warp', onclick=toggleWarp, width=60},
×
×
  • Create New...