SaNoR

Members
  • Content count

    13
  • Joined

  • Last visited

  • Days Won

    1

SaNoR last won the day on October 15

SaNoR had the most liked content!

Community Reputation

6 Neutral

About SaNoR

  • Rank
    Square

Recent Profile Visitors

97 profile views
  1. SaNoR

    Server side variable to client side dxDraw

    triggerServerEvent("getshops", getRootElement()) Attach trigger to button or "onClientRender"
  2. SaNoR

    Server side variable to client side dxDraw

    Server: function getShops() for k, v in ipairs(shops) do triggerClientEvent("getshopsClient", root, shops[k][4]) end end addEvent("getshops", true) addEventHandler("getshops", getRootElement(), getShops) Client: local cost = 0 addEvent("getshopsClient", true) addEventHandler("getshopsClient", root, function(value) cost = value end) ... dxDrawText("#ffffffCost: #6ad622"..cost.. " $" ,x/2+ 10, y/2+index*58+18.5, panelSize[1], 25*2.3, tocolor(66, 244, 220, 255), 0.8, font2, "left", "top", false, false, false, true) ...
  3. SaNoR

    How to prevent outputChatBox Spam in a for?

    function func() local text = "" for index, player in ipairs(getElementsByType("player")) do if getElementData(player,"Money") == 10000 then local len = string.len(text) local name = getPlayerName(player) if len == 0 then text = name elseif len > 0 and len <= 256 then if (len + string.len(tostring(", "..name))) > 256 then outputChatBox(text, player) text = name else text = text..", "..name end end end end if string.len(text) > 0 then outputChatBox(text, player) end end
  4. SaNoR

    Difficulties with Lua patterns

    You are welcome 😉
  5. SaNoR

    i need help :(

    dxDrawRectangle(screenWidth/3.3595, screenHeight/2.4406, screenWidth/2.4710, screenHeight/5.4961, tocolor(0, 0, 0, alpha))
  6. SaNoR

    Difficulties with Lua patterns

    "^%u(%l+)_%u(%l+)$"
  7. marker1 = createMarker( 364, 174, 1009, "cylinder", 1.5, 255, 255, 0, 170) function nachalo ( hitElement, matchingDimension ) setElementInterior( source, 3 ) setElementDimension( source, 14343 ) local elementType = getElementType( hitElement ) setElementModel ( hitElement, 1 ) end addEventHandler( "onMarkerHit", marker1, nachalo )
  8. SaNoR

    i need help :(

    bindKey("F1", "down", function() if show then show = false else show = true end end)
  9. SaNoR

    Is it possible?

    tbl = {"function", "local", "if", "elseif", "else", "then", "end", "print", "math.random", "math.max"} local text = [[function test() local x = 2 if x == 2 then print(x) math.random(1, 10) math.max(2, 9, 1, 4) end end]] addEventHandler("onClientRender", root, function() local color = "#FFFFFF" for i,v in ipairs(tbl) do if text:find(" "..v) or text:find(v.." ") then if i > 0 and i <= 7 then color = "#0000FF" elseif i > 7 then color = "#A6E22D" end text = text:gsub(v, color..v.."#FFFFFF") end end dxDrawText(text, 15, sh/3,_,_,_, 2, "default-bold", "left", "top", false, false, false, true) end)
  10. SaNoR

    Respawn vehicle by command

    addCommandHandler("createvehicle", function(player, cmd, id, numberplate) if isElement(player) and id then local matrix = getElementMatrix(player) local x = 3 * matrix[1][1] + 0 * matrix[2][1] - 0 * matrix[3][1] + matrix[4][1] local y = 3 * matrix[1][2] + 0 * matrix[2][2] - 0 * matrix[3][2] + matrix[4][2] local z = 3 * matrix[1][3] + 0 * matrix[2][3] - 0 * matrix[3][3] + matrix[4][3] local rX, rY, rZ = getElementRotation(player) local vehicle = createVehicle(id, x, y, z, rX, rY, rZ, numberplate) if isElement(vehicle) then outputChatBox("You have created a "..getVehicleNameFromModel(id), player, 0, 255, 0) else outputChatBox("Wrong id", player, 255, 0, 0) end else outputChatBox("/createvehicle [id] [numberplate] (createvehicle 415 X001UY)", player, 255, 0, 0) end end)
  11. SaNoR

    HELP how to check ID from DB Paradise RP??

    OnVehicleStartEnter
  12. addEventHandler("onPlayerDamage", root, function() if getElementHealth(source) < 10 then setElementHealth(source, 100) end end)