Jump to content

Search the Community

Showing results for tags 'scripting'.

  • 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. I want get online player count from my secondary server, and show with a label.. But how is it possible?
  2. I wanna get remaining time from the video, but does not working.. Why? function callback(data, error) if (error ~= 0) then return outputChatBox(error) end if (data == "ERROR") then return outputChatBox("data error") end local data = fromJSON("["..data.."]") if (data) then local minutes, seconds = convertTime(tonumber(data.length)) if seconds < 10 then seconds = "0"..seconds end outputChatBox("Title: "..data.title) outputChatBox("Length: "..minutes..":"..seconds ) outputChatBox("Remaining: "..data.remaining) loadBrowserURL( browser, data.link ) end end
  3. Tenho um sistema de concessionária porém, qualquer player não logado (guest) consegue comprar carros, e isso ta bugando, como faço pra apenas jogadores logados terem acesso a concessionária ? Client: function centerWindow ( center_window ) local sx, sy = guiGetScreenSize ( ) local windowW, windowH = guiGetSize ( center_window, false ) local x, y = ( sx - windowW ) / 2, ( sy - windowH ) / 2 guiSetPosition ( center_window, x, y, false ) end local customCarNames = -- Ids dos veiculos pra add mais copie e cole um abaixo do outro e mude o nome { [541] = 'Bugatti Veyron'; [494] = 'Jaguar F-Type'; [506] = 'Pagani Zonda F'; [550] = 'Porsche Panamera'; } setTimer ( function () local theCol = getElementData(root, "BlockExportCol") function isInColExport () if isElement(theCol) and isElementWithinColShape(localPlayer,theCol) then return true else return false end end function ClientExplosionCFunction() if isInColExport () then cancelEvent () end end addEventHandler("onClientExplosion", root, ClientExplosionCFunction) end , 1000, 1 ) local screX, screY = guiGetScreenSize() Window_VS = guiCreateWindow(373, 219, 557, 303,"Painel de Veiculos Comprados",false) guiSetAlpha(Window_VS, 0.88) guiWindowSetSizable(Window_VS, false) guiSetVisible(Window_VS, false) centerWindow(Window_VS) Grid_VS = guiCreateGridList(10, 28, 361, 235, false, Window_VS) guiGridListSetSelectionMode(Grid_VS, 1) guiGridListAddColumn(Grid_VS, "Nome", 0.4) guiGridListAddColumn(Grid_VS, "Preço", 0.3) guiGridListAddColumn(Grid_VS, "HP Auto", 0.2) Button_VS_sn_s = guiCreateStaticImage(381, 28, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_sn_o = guiCreateStaticImage(381, 28, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_sn = guiCreateLabel(381, 28, 166, 25, "Spawnar", false, Window_VS) guiSetFont(Button_VS_sn, "default-bold-small") guiLabelSetColor(Button_VS_sn, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_sn, "center") guiLabelSetHorizontalAlign(Button_VS_sn, "center") Button_VS_dy_s = guiCreateStaticImage(381, 63, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_dy_o = guiCreateStaticImage(381, 63, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_dy = guiCreateLabel(381, 63, 166, 25, "Remover", false, Window_VS) guiSetFont(Button_VS_dy, "default-bold-small") guiLabelSetColor(Button_VS_dy, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_dy, "center") guiLabelSetHorizontalAlign(Button_VS_dy, "center") Button_VS_Warp_s = guiCreateStaticImage(381, 98, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_Warp_o = guiCreateStaticImage(381, 98, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_Warp = guiCreateLabel(381, 98, 166, 25, "Teleport", false, Window_VS) guiSetFont(Button_VS_Warp, "default-bold-small") guiLabelSetColor(Button_VS_Warp, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Warp, "center") guiLabelSetHorizontalAlign(Button_VS_Warp, "center") Button_VS_Warp_info = guiCreateLabel(428, 500, 103, 26, "Teleport: 500$", false) guiSetFont(Button_VS_Warp_info, "default-bold-small") guiLabelSetColor(Button_VS_Warp_info, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Warp_info, "center") guiLabelSetHorizontalAlign(Button_VS_Warp_info, "center") --Button_VS_Warp_info Button_VS_Fix_s = guiCreateStaticImage(381, 133, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_Fix_o = guiCreateStaticImage(381, 133, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_Fix = guiCreateLabel(381, 133, 166, 25, "Fixar", false, Window_VS) guiSetFont(Button_VS_Fix, "default-bold-small") guiLabelSetColor(Button_VS_Fix, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Fix, "center") guiLabelSetHorizontalAlign(Button_VS_Fix, "center") Button_VS_Fix_info = guiCreateLabel(428, 500, 103, 26, "Conserto: 500$", false) guiSetFont(Button_VS_Fix_info, "default-bold-small") guiLabelSetColor(Button_VS_Fix_info, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_Fix_info, "center") guiLabelSetHorizontalAlign(Button_VS_Fix_info, "center") Button_VS_lk_s = guiCreateStaticImage(381, 168, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_lk_o = guiCreateStaticImage(381, 168, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_lk = guiCreateLabel(381, 168, 166, 25, "Aberto - Fechado", false, Window_VS) guiSetFont(Button_VS_lk, "default-bold-small") guiLabelSetColor(Button_VS_lk, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_lk, "center") guiLabelSetHorizontalAlign(Button_VS_lk, "center") Button_VS_sl_s = guiCreateStaticImage(381, 203, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_sl_o = guiCreateStaticImage(381, 203, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_sl = guiCreateLabel(381, 203, 166, 25, "Vender Veiculo", false, Window_VS) guiSetFont(Button_VS_sl, "default-bold-small") guiLabelSetColor(Button_VS_sl, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_sl, "center") guiLabelSetHorizontalAlign(Button_VS_sl, "center") Button_VS_give_s = guiCreateStaticImage(381, 238, 166, 25, "images/button_standard.png", false, Window_VS) Button_VS_give_o = guiCreateStaticImage(381, 238, 166, 25, "images/button_mouse.png", false, Window_VS) Button_VS_give = guiCreateLabel(381, 238, 166, 25, "Vender Para o Jogador", false, Window_VS) guiSetFont(Button_VS_give, "default-bold-small") guiLabelSetColor(Button_VS_give, 255, 255, 255) guiLabelSetVerticalAlign(Button_VS_give, "center") guiLabelSetHorizontalAlign(Button_VS_give, "center") adLabel = guiCreateLabel(130, 269, 296, 24, "Loja De carros", false, Window_VS) -------------- Nome do seu servidor guiSetFont(adLabel, "default-bold-small") guiLabelSetHorizontalAlign(adLabel, "center", false) guiLabelSetVerticalAlign(adLabel, "center") guiSetVisible(Button_VS_sn_o,false)-- guiSetVisible(Button_VS_dy_o,false)-- guiSetVisible(Button_VS_Warp_o,false) guiSetVisible(Button_VS_Warp_info,false) guiSetVisible(Button_VS_Fix_o,false) guiSetVisible(Button_VS_Fix_info,false) guiSetVisible(Button_VS_lk_o,false) guiSetVisible(Button_VS_sl_o,false) guiSetVisible(Button_VS_give_o,false) --Button_VS_Warp_info --Button_VS_Fix_info Window_CHK = guiCreateWindow(screX/2-155,screY/2-60,310,120,"Vender Veiculo!",false) guiSetVisible(Window_CHK, false) guiSetProperty(Window_CHK, "AlwaysOnTop", "true") guiWindowSetSizable(Window_CHK, false) Label_CHK = guiCreateLabel(21,28,266,36,"",false,Window_CHK) guiLabelSetColor(Label_CHK, 38, 122, 216) guiLabelSetHorizontalAlign(Label_CHK,"center",true) Button_CHK_Y = guiCreateButton(17,73,129,36,"Deseja Vender?",false,Window_CHK) Button_CHK_N = guiCreateButton(161,73,129,36,"Cancelar",false,Window_CHK) function updateGridList() local data = getElementData(localPlayer, "VehicleInfo") if data then local rw, cl = guiGridListGetSelectedItem(Grid_VS) guiGridListClear(Grid_VS) for i, data in ipairs (data) do local carName = customCarNames[ data['Model'] ] or getVehicleNameFromModel(data["Model"]) local ID = data["ID"] local Cost = data["Cost"] local HP = math.floor(data["HP"]) local PreCost = math.ceil(Cost*.9*HP/100/10) local row = guiGridListAddRow(Grid_VS) guiGridListSetItemText(Grid_VS, row, 1, carName, false, true) guiGridListSetItemData(Grid_VS, row, 1, ID) guiGridListSetItemText(Grid_VS, row, 2, PreCost, false, true) guiGridListSetItemText(Grid_VS, row, 3, HP.." HP", false, true) end guiGridListSetSelectedItem(Grid_VS, rw, cl) end end bindKey("F7", "down", function() if getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then if getElementData(localPlayer, "MissionWarProtection") and getElementData(localPlayer, "MissionProtection")then return end guiSetVisible(Window_VS, not guiGetVisible(Window_VS)) guiSetVisible (Window_CHK, false) showCursor(guiGetVisible(Window_VS)) end end) triggerServerEvent("onOpenGui", localPlayer) addEventHandler("onClientElementDataChange", root, function(dd) if getElementType(source) == "player" and source == localPlayer and dd == "VehicleInfo" then local data = getElementData(source, dd) if data then updateGridList() end end end) function WINDOW_CLICK_VEHICLE (button, state, absoluteX, absoluteY) local id = guiGridListGetSelectedItem(Grid_VS) local ID = guiGridListGetItemData(Grid_VS, id, 1) if source == Button_VS_close then guiSetVisible(Window_VS, false) showCursor(false) end if (source == Grid_VS) then if id == -1 and idd then guiGridListSetSelectedItem(Grid_VS, idd, 1) return false else idd = guiGridListGetSelectedItem(Grid_VS) end elseif id == -1 then elseif (source == Button_VS_sn) then if not isInColExport () then triggerServerEvent("SpawnMyVehicle", localPlayer, ID) end elseif (source == Button_VS_dy) then triggerServerEvent("DestroyMyVehicle", localPlayer, ID) elseif (source == Button_VS_lt) then triggerServerEvent("LightsMyVehicle", localPlayer, ID) elseif (source == Button_VS_bp) then triggerServerEvent("BlipMyVehicle", localPlayer, ID) elseif (source == Button_VS_lk) then triggerServerEvent("LockMyVehicle", localPlayer, ID) elseif (source == Button_VS_sl) then guiSetVisible(Window_CHK, true) local carName = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 1) local carprice = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 2) guiSetText(Label_CHK, 'Você deseja realmente vender seu "'..carName..'" por $'..carprice) elseif source == Button_VS_give then createPlayersList(id) elseif source == Button_CHK_Y then triggerServerEvent("SellMyVehicle", localPlayer, ID) guiSetVisible(Window_VS, false) guiSetVisible(Window_CHK, false) showCursor(false) elseif source == Button_CHK_N then guiSetVisible (Window_CHK, false) elseif source == Button_VS_Spc then if getElementInterior(localPlayer) == 0 then if getElementData(localPlayer,"Stats") < 2 then SpecVehicle(ID) end end elseif source == Button_VS_Fix then triggerServerEvent("FixMyVehicle", localPlayer, ID) elseif source == Button_VS_Warp then if not isInColExport () then triggerServerEvent("WarpMyVehicle", localPlayer, ID) end elseif source == Button_PLS_Y then local row = guiGridListGetSelectedItem ( playerList_PLS ) if row and row ~= -1 then -- if guiGridListGetItemText ( playerList_PLS, row, 1 ) == getPlayerName ( localPlayer ) then -- return true -- end if (tonumber(guiGetText (edit_PLS_price)) or 0) >= 0 then outputMessage ( "#c1c1c1Esperar uma resposta do jogador.", 10, 250, 10,true ) invitations_send = true triggerServerEvent ( 'inviteToBuyCarSended', localPlayer, guiGridListGetItemText ( playerList_PLS, row, 1 ), guiGetText (edit_PLS_price) or 0, guiGridListGetItemText(Grid_VS, id, 1), guiGridListGetItemData(Grid_VS, id, 1) ) destroyElement ( Window_PLS ) end end elseif source == Button_PLS_N then destroyElement ( Window_PLS) end end addEventHandler("onClientGUIClick", resourceRoot, WINDOW_CLICK_VEHICLE) function invitationsClickVehicle () if source == Button_ABC_Y then showCursor ( false ) destroyElement ( Window_ABC ) if getPlayerMoney () >= ( tonumber(inv_price) or 0 ) then triggerServerEvent ("invitationBuyCarAccepted",localPlayer, inv_player, inv_acc, inv_price, inv_veh_name, inv_veh_id) else triggerServerEvent ("invitationBuyCarNotAccepted",localPlayer, inv_player ) end if #listOfInvitations > 0 then createAcceptBuyCarWindow (listOfInvitations[1][1],listOfInvitations[1][2],listOfInvitations[1][3],listOfInvitations[1][4] ) table.remove (listOfInvitations,1) end elseif source == Button_ABC_N then showCursor ( false ) triggerServerEvent ("invitationBuyCarNotAccepted",localPlayer, inv_player ) destroyElement ( Window_ABC ) if #listOfInvitations > 0 then createAcceptBuyCarWindow (listOfInvitations[1][1],listOfInvitations[1][2],listOfInvitations[1][3],listOfInvitations[1][4] ) table.remove (listOfInvitations,1) end end end addEventHandler("onClientGUIClick", resourceRoot, invitationsClickVehicle) function createPlayersList (row_id) showCursor ( true ) Window_PLS = guiCreateWindow(screX/2-155,screY/2-220,310,420,"Venda de carros!",false) guiSetVisible(Window_PLS, true) guiSetProperty(Window_PLS, "AlwaysOnTop", "true") guiWindowSetSizable(Window_PLS, false) Label_PLS_info = guiCreateLabel(21,28,266,36,"Digite o preço dos carros:",false,Window_PLS) edit_PLS_price = guiCreateEdit ( 110,58,90,36, guiGridListGetItemText(Grid_VS, row_id, 2) or 0, false, Window_PLS ) guiLabelSetColor(Label_PLS_info, 38, 122, 216) guiLabelSetHorizontalAlign(Label_PLS_info,"center",true) Button_PLS_Y = guiCreateButton(17,379,129,36,"Vender",false,Window_PLS) Button_PLS_N = guiCreateButton(161,379,129,36,"Fechar",false,Window_PLS) addEventHandler("onClientGUIChanged", edit_PLS_price, function(element) guiSetText ( edit_PLS_price, string.gsub (guiGetText( edit_PLS_price ), "%a", "") ) end) playerList_PLS = guiCreateGridList ( 21, 100, 268, 265, false, Window_PLS ) local column = guiGridListAddColumn( playerList_PLS, "Jogadores", 0.85 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList_PLS ) guiGridListSetItemText ( playerList_PLS, row, column, getPlayerName ( player ), false, false ) end end end --createPlayersList () listOfInvitations = {} inv_player, inv_acc, inv_price, inv_veh_name, inv_veh_id = nil, nil, nil, nil, nil addEvent("recieveInviteToBuyCar", true) addEventHandler("recieveInviteToBuyCar", root, function(player, acc, price, veh_name, veh_id) if player and price and acc and veh_name and veh_id then if getPlayerFromName ( player ) then if not isElement ( Window_ABC ) then createAcceptBuyCarWindow (player,acc,price, veh_name, veh_id) else table.insert ( listOfInvitations, {player,acc,price, veh_name, veh_id}) end else outputMessage ( "#c1c1c1Jogador não pode ser encontrado", source, 250, 10, 10,true) end end end) addEvent("cleanCarInvitations", true) addEventHandler("cleanCarInvitations", root, function() invitations_send = false end) function createAcceptBuyCarWindow(player,acc,price, veh_name, veh_id) showCursor ( true ) inv_player, inv_acc, inv_price, inv_veh_name, inv_veh_id = player,acc,price, veh_name, veh_id Window_ABC = guiCreateWindow(screX/2-155,screY/2-220,410,100,"Venda de carros",false) guiSetVisible(Window_ABC, true) guiSetProperty(Window_ABC, "AlwaysOnTop", "true") guiWindowSetSizable(Window_ABC, false) Label_ABC_info = guiCreateLabel(10,28,390,36,player.." Te ofereceu o "..veh_name.." por "..price.."$ (o seu dinheiro: "..getPlayerMoney() .."$)",false,Window_ABC) guiLabelSetColor(Label_ABC_info, 38, 216, 38) guiLabelSetHorizontalAlign(Label_ABC_info,"center",true) Button_ABC_Y = guiCreateButton(17,70,129,36,"Comprar",false,Window_ABC) Button_ABC_N = guiCreateButton(264,70,129,36,"Cancelar",false,Window_ABC) end function SpecVehicle(id) if spc then removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false return end for i, vehicle in ipairs(getElementsByType("vehicle")) do if getElementData(vehicle, "Owner") == localPlayer and getElementData(vehicle, "ID") == id then cVeh = vehicle spc = true addEventHandler("onClientPreRender", root, Sp) guiSetVisible(Window_VS, false) showCursor(false) break end end end function Sp() if isElement(cVeh) then local x, y, z = getElementPosition(cVeh) setElementFrozen(localPlayer, true) setCameraMatrix(x, y-1, z+15, x, y, z) else removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false end end ShopMarkersTable = {} local ShopTable = { --------- Ids de cada um na sua loja do mesmo jeito que adicionou la encima bote aqui e mude os preços tambem [1] = {ID = {{541, 700000} ,{494, 500000} ,{506, 900000} ,{550, 450000} }, vPosX = 2134, vPosY = -1170, vPosZ = 28.15, PosX = 2133, PosY = -1149, PosZ = 23.4, CamX = 2134.1, CamY = -1160, CamZ = 35, lookAtX = 2133.3, lookAtY = -1168, lookAtZ = 28}, [2] = {ID = {{541, 700000} ,{494, 500000} ,{506, 900000} ,{550, 450000} }, vPosX = 552, vPosY = -1288, vPosZ = 18, PosX = 562, PosY = -1270, PosZ = 16, CamX = 552, CamY = -1275.82, CamZ = 21.61, lookAtX = 552, lookAtY = -1276.77, lookAtZ = 21.29}, [3] = {ID = {{541, 700000} ,{494, 500000} ,{506, 900000} ,{550, 450000} }, vPosX = 1942.5, vPosY = 2052, vPosZ = 11, PosX = 1946, PosY = 2068, PosZ = 10, CamX = 1930.36, CamY = 2052.78, CamZ = 14.71, lookAtX = 1931.36, lookAtY = 2052.78, lookAtZ = 14.43}, [4] = {ID = {{541, 700000} ,{494, 500000} ,{506, 900000} ,{550, 450000} }, vPosX = -1950, vPosY = 266, vPosZ = 36.2, PosX = -1954, PosY = 299, PosZ = 34, CamX = -1960.18, CamY = 266.06, CamZ = 37.94, lookAtX = -1959.2, lookAtY = 266.06, lookAtZ = 37.73}, [5] = {ID = {{541, 700000} ,{494, 500000} ,{506, 900000} ,{550, 450000} }, vPosX = -1660, vPosY = 1213, vPosZ = 7, PosX = -1634, PosY = 1199, PosZ = 6, CamX = -1648.9, CamY = 1212.27, CamZ = 10.16, lookAtX = -1649.88, lookAtY = 1212.27, lookAtZ = 9.94} } VehicleShop_Window = guiCreateWindow(screX-350,screY-450, 343, 436, "Shop de Veiculos", false) guiSetVisible(VehicleShop_Window, false) guiWindowSetSizable(VehicleShop_Window , false) guiSetAlpha(VehicleShop_Window, 0.8) carGrid = guiCreateGridList(9, 20, 324, 329, false, VehicleShop_Window) guiGridListSetSelectionMode(carGrid, 0) carColumn = guiGridListAddColumn(carGrid, "Nome", 0.5) costColumn = guiGridListAddColumn(carGrid, "Preço", 0.4) carButton_s = guiCreateStaticImage(14, 355, 86, 56, "images/button_standard.png", false, VehicleShop_Window) carButton_o = guiCreateStaticImage(14, 355, 86, 56, "images/button_mouse.png", false, VehicleShop_Window) carButton = guiCreateLabel(14, 355, 86, 56, "Comprar", false, VehicleShop_Window) guiSetFont(carButton, "default-bold-small") guiLabelSetColor(carButton, 255, 255, 255) guiLabelSetVerticalAlign(carButton, "center") guiLabelSetHorizontalAlign(carButton, "center") carColorButton_s = guiCreateStaticImage(128, 355, 86, 56, "images/button_standard.png", false, VehicleShop_Window) carColorButton_o = guiCreateStaticImage(128, 355, 86, 56, "images/button_mouse.png", false, VehicleShop_Window) carColorButton = guiCreateLabel(128, 355, 86, 56, "Pintar", false, VehicleShop_Window) guiSetFont(carColorButton, "default-bold-small") guiLabelSetColor(carColorButton, 255, 255, 255) guiLabelSetVerticalAlign(carColorButton, "center") guiLabelSetHorizontalAlign(carColorButton, "center") closeButton_s = guiCreateStaticImage(237, 355, 86, 56, "images/button_standard.png", false, VehicleShop_Window) closeButton_o = guiCreateStaticImage(237, 355, 86, 56, "images/button_mouse.png", false, VehicleShop_Window) closeButton = guiCreateLabel(237, 355, 86, 56, "Sair", false, VehicleShop_Window) guiSetFont(closeButton, "default-bold-small") guiLabelSetColor(closeButton, 255, 255, 255) guiLabelSetVerticalAlign(closeButton, "center") guiLabelSetHorizontalAlign(closeButton, "center") guiSetVisible(carButton_o,false) guiSetVisible(closeButton_o,false) guiSetVisible(carColorButton_o,false) addEventHandler( "onClientMouseLeave", root, function() if source == Button_VS_sn then guiSetVisible(Button_VS_sn_s,true) guiSetVisible(Button_VS_sn_o,false) elseif source == Button_VS_dy then guiSetVisible(Button_VS_dy_s,true) guiSetVisible(Button_VS_dy_o,false) elseif source == Button_VS_Warp then guiSetVisible(Button_VS_Warp_s,true) guiSetVisible(Button_VS_Warp_o,false) guiSetVisible(Button_VS_Warp_info,false) elseif source == Button_VS_Fix then guiSetVisible(Button_VS_Fix_s,true)--Button_VS_Fix_info guiSetVisible(Button_VS_Fix_o,false) guiSetVisible(Button_VS_Fix_info,false) elseif source == Button_VS_lk then guiSetVisible(Button_VS_lk_s,true) guiSetVisible(Button_VS_lk_o,false) elseif source == Button_VS_sl then guiSetVisible(Button_VS_sl_s,true) guiSetVisible(Button_VS_sl_o,false) elseif source == Button_VS_give then guiSetVisible(Button_VS_give_s,true) guiSetVisible(Button_VS_give_o,false) elseif source == carButton then guiSetVisible(carButton_s,true) guiSetVisible(carButton_o,false) elseif source == closeButton then guiSetVisible(closeButton_s,true) guiSetVisible(closeButton_o,false) elseif source == carColorButton then guiSetVisible(carColorButton_s,true) guiSetVisible(carColorButton_o,false) end end) addEventHandler( "onClientMouseEnter", root, function() if source == Button_VS_sn then guiSetVisible(Button_VS_sn_s,false) guiSetVisible(Button_VS_sn_o,true) elseif source == Button_VS_dy then guiSetVisible(Button_VS_dy_s,false) guiSetVisible(Button_VS_dy_o,true) elseif source == Button_VS_Warp then guiSetVisible(Button_VS_Warp_s,false) guiSetVisible(Button_VS_Warp_o,true) guiSetVisible(Button_VS_Warp_info,true) elseif source == Button_VS_Fix then guiSetVisible(Button_VS_Fix_s,false)--Button_VS_Fix_info guiSetVisible(Button_VS_Fix_o,true) guiSetVisible(Button_VS_Fix_info,true) elseif source == Button_VS_lk then guiSetVisible(Button_VS_lk_s,false) guiSetVisible(Button_VS_lk_o,true) elseif source == Button_VS_sl then guiSetVisible(Button_VS_sl_s,false) guiSetVisible(Button_VS_sl_o,true) elseif source == Button_VS_give then guiSetVisible(Button_VS_give_s,false) guiSetVisible(Button_VS_give_o,true) elseif source == Button_VS_give then guiSetVisible(Button_VS_give_s,false) guiSetVisible(Button_VS_give_o,true) elseif source == carButton then guiSetVisible(carButton_s,false) guiSetVisible(carButton_o,true) elseif source == closeButton then guiSetVisible(closeButton_s,false) guiSetVisible(closeButton_o,true) elseif source == carColorButton then guiSetVisible(carColorButton_s,false) guiSetVisible(carColorButton_o,true) end end) for i, M in ipairs(ShopTable) do ShopMarker = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 2, 38, 122, 216) ShopMarkerShader = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 2, 38, 122, 216) ShopMarkersTable[ShopMarker] = true setElementData ( ShopMarker, "shopID", i ) setElementID(ShopMarker, tostring(i)) createBlipAttachedTo(ShopMarker, 55, 2, 255, 255, 255, 255, 0, 400) end function getVehicleModelFromNewName (name) for i,v in pairs ( customCarNames ) do if v == name then return i end end return false end addEventHandler("onClientGUIClick", resourceRoot, function() if (source == carGrid) then local carName = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 1) local carprice = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 2) if guiGridListGetSelectedItem(carGrid) ~= -1 then guiSetText(CarName, carName) guiSetText(CarPrice, "$"..carprice) local carID = getVehicleModelFromNewName(carName) or getVehicleModelFromName(carName) if isElement(veh) then setElementModel(veh, carID) return end veh = createVehicle(carID, ShopTable[i]["vPosX"], ShopTable[i]["vPosY"], ShopTable[i]["vPosZ"]) setVehicleDamageProof(veh, true) setElementFrozen(veh, true) setVehicleColor(veh, r1, g1, b1, r2, g2, b2) timer = setTimer(function() local x, y, z = getElementRotation(veh) setElementRotation(veh, x, y, z+3) end, 50, 0) else guiSetText(CarName, "Noun") guiSetText(CarPrice, "Noun") r1, g1, b1, r2, g2, b2 = math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255) if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end end elseif (source == carColorButton) then openColorPicker() elseif (source == carButton) then if guiGridListGetSelectedItem(carGrid) then local carName = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 1) local carID = getVehicleModelFromNewName(carName) or getVehicleModelFromName(carName) local carCost = guiGridListGetItemText (carGrid, guiGridListGetSelectedItem(carGrid), 2) local r1, g1, b1, r2, g2, b2 = getVehicleColor(veh, true) triggerServerEvent("onBuyNewVehicle", localPlayer, carID, carCost, r1, g1, b1, r2, g2, b2) outputMessage("#c1c1c1Você acabou de comprar um: #00FF66"..carName, 38, 122, 216, true) guiSetVisible(VehicleShop_Window, false) showCursor(false) setElementFrozen(localPlayer, false) fadeCamera(false, 1.0) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end end elseif (source == closeButton) then if guiGetVisible(VehicleShop_Window) then guiSetVisible(VehicleShop_Window, false) showCursor(false) setElementFrozen(localPlayer, false) fadeCamera(false, 1.0) setElementData ( localPlayer, "atVehShop", false) setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1) if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end end end end) function openColorPicker() if (colorPicker.isSelectOpen) or not isElement(veh) then return end colorPicker.openSelect(colors) end function closedColorPicker() end function updateColor() if (not colorPicker.isSelectOpen) then return end local r, g, b = colorPicker.updateTempColors() if (veh and isElement(veh)) then r1, g1, b1, r2, g2, b2 = getVehicleColor(veh, true) if (guiCheckBoxGetSelected(checkColor1)) then r1, g1, b1 = r, g, b end if (guiCheckBoxGetSelected(checkColor2)) then r2, g2, b2 = r, g, b end setVehicleColor(veh, r1, g1, b1, r2, g2, b2) end end addEventHandler("onClientRender", root, updateColor) --[[addCommandHandler("xx", function() local x, y, z, lx, ly, lz = getCameraMatrix() setCameraMatrix(x, y, z, lx, ly, lz) outputChatBox(x..", "..y..", "..z..", "..lx..", "..ly..", "..z) end)]] addEventHandler("onClientMarkerHit", resourceRoot, function(player) if getElementType(player) ~= "player" or player ~= localPlayer or isPedInVehicle(player) then return end if ShopMarkersTable[source] then i = tonumber(getElementID(source)) guiGridListClear(carGrid) for i, v in ipairs(ShopTable[i]["ID"]) do local carName = customCarNames[ v[1] ] or getVehicleNameFromModel(v[1]) local row = guiGridListAddRow(carGrid) guiGridListSetItemText(carGrid, row, 1, carName, false, true) guiGridListSetItemText(carGrid, row, 2, tostring(v[2]), false, true) end setCameraMatrix(ShopTable[i]["CamX"], ShopTable[i]["CamY"], ShopTable[i]["CamZ"], ShopTable[i]["lookAtX"], ShopTable[i]["lookAtY"], ShopTable[i]["lookAtZ"]) guiSetVisible(VehicleShop_Window, true) showCursor(true) setElementData ( player, "atVehShop", getElementData ( source, "shopID")) guiGridListSetSelectedItem(carGrid, 0, 1) setTimer(function() setElementFrozen(localPlayer, true) local carName = guiGridListGetItemText(carGrid, 0, 1) local carID = getVehicleModelFromNewName(carName) or getVehicleModelFromName(carName) local x, y, z = ShopTable[i]["vPosX"], ShopTable[i]["vPosY"], ShopTable[i]["vPosZ"] if isElement(veh) then destroyElement(veh) end if isTimer(timer) then killTimer(timer) end r1, g1, b1, r2, g2, b2 = math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255) veh = createVehicle(carID, x, y, z) setVehicleDamageProof(veh, true) setElementFrozen(veh, true) setVehicleColor(veh, r1, g1, b1, r2, g2, b2) timer = setTimer(function() local x, y, z = getElementRotation(veh) setElementRotation(veh, x, y, z+3) end, 50, 0) end, 100, 1) end end) addEventHandler("onClientRender", getRootElement(), function() local x2, y2, z2 = getElementPosition(localPlayer) for index, car in pairs(getElementsByType('vehicle')) do if(getElementData(car,'ownercar')) then local x, y, z = getElementPosition(car) z = z+1 local sx, sy = getScreenFromWorldPosition(x, y, z) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 20) then local fontbig = 2-(distance/10) local owner = getElementData(car, "ownercar") if(owner) then dxDrawBorderedCarText("Proprietário: "..(owner), sx, sy, sx, sy, tocolor(255, 255, 255, 255), fontbig, "default-bold", "center") end end end end end for i, v in ipairs ( ShopTable ) do local sx, sy = getScreenFromWorldPosition(v.PosX, v.PosY, v.PosZ+1) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D ( x2, y2, z2,v.PosX, v.PosY, v.PosZ ) if distance < 30 then local fontbig = 3-(distance/10) --dxDrawBorderedCarText("", sx, sy, sx, sy, tocolor(212, 179, 17, 200), fontbig, "default-bold", "center") end end end end) function dxDrawBorderedCarText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) end function outputMessage (text, r, g, b) return exports["scr-Lib"]:outputMessage(text, r, g, b); end Server: customCarNames = -- новые названия { } shopsVehSpawns = { [1] = { 2131, -1133, 25.6, 0,0,359 }, [2] = { 555, -1278, 18, 0,0,100 }, [3] = { 1941, 2097, 10.8, 0,0,350 }, [4] = { -1988, 272, 36, 0,0,259 }, [5] = { -1642, 1213, 7.17, 0,0, 227 }, } function getFreeID() local result = dbPoll(dbQuery(db, "SELECT ID FROM VehicleList ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end function getVehicleByID(id) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "ID") == id then v = veh break end end return v end function updateVehicleInfo(player) if isElement(player) then local result = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(player))), -1) if type(result) == "table" then setElementData(player, "VehicleInfo", result) end end end addEventHandler("onResourceStart", resourceRoot, function() db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS VehicleList (ID, Account, Model, X, Y, Z, RotZ, Colors, Upgrades, Paintjob, Cost, HP, new_hydr)") for i, player in ipairs(getElementsByType("player")) do updateVehicleInfo(player) end end) addEvent("onOpenGui", true) addEventHandler("onOpenGui", root, function() updateVehicleInfo(source) end) function destroyVehicle(theVehicle) if isElement(theVehicle) then local Owner = getElementData(theVehicle, "Owner") if Owner then local x, y, z = getElementPosition(theVehicle) local _, _, rz = getElementRotation(theVehicle) local r1, g1, b1, r2, g2, b2 = getVehicleColor(theVehicle, true) local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 upgrade = "" for _, upgradee in ipairs (getVehicleUpgrades(theVehicle)) do if upgrade == "" then upgrade = upgradee else upgrade = upgrade..","..upgradee end end local Paintjob = getVehiclePaintjob(theVehicle) or 3 local id = getElementData(theVehicle, "ID") dbExec(db, "UPDATE VehicleList SET X = ?, Y = ?, Z = ?, RotZ = ?, HP = ?, Colors = ?, Upgrades = ?, Paintjob = ?, new_hydr = ? WHERE Account = ? AND ID = ?", x, y, z, rz, getElementHealth(theVehicle), color, upgrade, Paintjob, getElementData ( theVehicle, "NewHydr") and 1 or 0, getAccountName(getPlayerAccount(Owner)), id) updateVehicleInfo(Owner) local attached = getAttachedElements(theVehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end end destroyElement(theVehicle) end end addEvent("onBuyNewVehicle", true) addEventHandler("onBuyNewVehicle", root, function(Model, cost, r1, g1, b1, r2, g2, b2) abc = false local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) for i, data in ipairs (data) do if data["Model"] == Model then abc = true break end end if #data >= 10 then outputMessage("#c1c1c1Desculpe, mas você só pode comprar #00FF6610#FFFFFF veiculos.", source, 38, 122, 216, true) return end if abc then outputMessage("#c1c1c1Você já tem este veiculo.", source, 38, 122, 216, true) return end if getPlayerMoney(source) >= tonumber(cost) then takePlayerMoney ( source, cost ) local x, y, z = getElementPosition(source) local _, _, rz = getElementRotation(source) local shopID = getElementData ( source, "atVehShop") local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 if shopID and shopsVehSpawns[shopID] then vehicle = createVehicle(Model, shopsVehSpawns[shopID][1], shopsVehSpawns[shopID][2], shopsVehSpawns[shopID][3], shopsVehSpawns[shopID][4], shopsVehSpawns[shopID][5], shopsVehSpawns[shopID][6]) else vehicle = createVehicle(Model, x-5, y+5, z, 0, 0, rz) end setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) setElementData(vehicle, "Owner", source) local NewID = getFreeID() setElementData(vehicle, "ID", NewID) dbExec(db, "INSERT INTO VehicleList VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", NewID, getAccountName(getPlayerAccount(source)), Model, x-5, y+5, z, rz, color, "", 3, cost, 1000, 0) outputMessage("#c1c1c1Por: #00FF66$"..cost, source, 38, 122, 216, true) updateVehicleInfo(source) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) warpPedIntoVehicle ( source, vehicle ) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 150, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) else outputMessage("#c1c1c1Você não tem grana para comprar este veiculo.", source, 38, 122, 216, true) end end) vv = {} addEvent("SpawnMyVehicle", true) addEventHandler("SpawnMyVehicle", root, function(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then if getVehicleByID(id) then outputMessage("#c1c1c1O seu veiculo #00FF66"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1já está spawnado.", source, 38, 122, 216, true) else local color = split(data[1]["Colors"], ',') r1 = color[1] or 255 g1 = color[2] or 255 b1 = color[3] or 255 r2 = color[4] or 255 g2 = color[5] or 255 b2 = color[6] or 255 vehicle = createVehicle(data[1]["Model"], data[1]["X"], data[1]["Y"], data[1]["Z"], 0, 0, data[1]["RotZ"]) setElementData(vehicle, "ID", id) local upd = split(tostring(data[1]["Upgrades"]), ',') for i, upgrade in ipairs(upd) do addVehicleUpgrade(vehicle, upgrade) end local Paintjob = data[1]["Paintjob"] or 3 setVehiclePaintjob(vehicle, Paintjob) setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) if tonumber(data[1]["HP"]) <= 255.5 then data[1]["HP"] = 255 end if data[1]["new_hydr"] and data[1]["new_hydr"] == 1 then setElementData(vehicle, "NewHydr", true) else setElementData(vehicle, "NewHydr", false) end setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) setElementHealth(vehicle, data[1]["HP"]) setElementData(vehicle, "Owner", source) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 50, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) outputMessage("#c1c1c1O seu veiculo #00FF66"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi spawnado.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Há um problema com o veiculo, notifique o administrador.", source, 38, 122, 216, true) end end) addEvent("DestroyMyVehicle", true) addEventHandler("DestroyMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then destroyVehicle(vehicle) outputMessage ("#c1c1c1O seu veiculo #00FF66"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi removido.", source, 38, 122, 216, true) else outputMessage("#c1c1c1Selecione um veiculo.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("LightsMyVehicle", true) addEventHandler("LightsMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local Vehicle = getPedOccupiedVehicle(source) if Vehicle == vehicle then if getVehicleOverrideLights(vehicle) ~= 2 then setVehicleOverrideLights(vehicle, 2) outputMessage("#c1c1c1Seu veiculo #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1teve as luzes acesas.", source, 38, 122, 216, true) elseif getVehicleOverrideLights(vehicle) ~= 1 then setVehicleOverrideLights(vehicle, 1) outputMessage("#c1c1c1Seu veiculo #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1teve as luzes apagadas.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Você não está no veiculo!", source, 38, 122, 216, true) end else outputMessage("#c1c1c1O seu veiculo não está spawnado.", source, 38, 122, 216, true) end end) addEvent("LockMyVehicle", true) addEventHandler("LockMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then if not isVehicleLocked(vehicle) then setVehicleLocked(vehicle, true) setVehicleDoorsUndamageable(vehicle, true) setVehicleDoorState(vehicle, 0, 0) setVehicleDoorState(vehicle, 1, 0) setVehicleDoorState(vehicle, 2, 0) setVehicleDoorState(vehicle, 3, 0) outputMessage("#c1c1c1O seu transporte #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #00FF66fechado.", source, 38, 122, 216, true) elseif isVehicleLocked(vehicle) then setVehicleLocked(vehicle, false) setVehicleDoorsUndamageable(vehicle, false) outputMessage("#c1c1c1O seu transporte #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #00FF66aberto.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("BlipMyVehicle", true) addEventHandler("BlipMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then if not getElementData(vehicle, "ABlip") then setElementData(vehicle, "ABlip", true) createBlipAttachedTo(vehicle, 41, 2, 255, 0, 0, 255, 0, 65535, source) outputMessage("#c1c1c1O seu transporte #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi marcado no mapa, usar #00FF66F11#c1c1c1 para encontrá-lo.", source, 38, 122, 216, true) else local attached = getAttachedElements(vehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end setElementData(vehicle, "ABlip", false) outputMessage("#c1c1c1O seu veículo #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1teve o blip removido.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1O seu veiculo não está spawnado.", source, 38, 122, 216, true) end end) addEvent("FixMyVehicle", true) addEventHandler("FixMyVehicle", root, function(id) if getPlayerMoney(source) >= tonumber(500) then takePlayerMoney ( source, 500 ) local vehicle = getVehicleByID(id) if isElement(vehicle) then fixVehicle(vehicle) setVehicleEngineState(vehicle, true) if isVehicleDamageProof(vehicle) then setVehicleDamageProof(vehicle, false) end end dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND ID = ?", 1000, getAccountName(getPlayerAccount(source)), id) updateVehicleInfo(source) outputMessage ("#c1c1c1O seu transporte foi reparado.", source, 38, 122, 216, true) else outputMessage("#c1c1c1Você não tem dinheiro suficiente para reparar.", source, 38, 122, 216, true) outputMessage("#c1c1c1Preço: #00FF66$500.", source, 38, 122, 216, true) end end) addEvent("WarpMyVehicle", true) addEventHandler("WarpMyVehicle", root, function(id) if not isPedInVehicle (source) then if getElementInterior(source) == 0 then if getPlayerMoney(source) >= tonumber(500) then local vehicle = getVehicleByID(id) if isElement(vehicle) then takePlayerMoney ( source, 500 ) local x, y, z = getElementPosition(source) setElementPosition(vehicle, x, y, z) warpPedIntoVehicle ( source, vehicle ) outputMessage ("#c1c1c1O seu veiculo #00FF66"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi entregue a você.", source, 38, 122, 216, true) else outputMessage("#c1c1c1O seu veiculo não está spawnado.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Você não tem os meios de se teletransportar para o veiculo.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Você só poderá mudar de veiculo se sair do atual.", source, 38, 122, 216, true) end else outputMessage("#c1c1c1Nós não podemos dirigir seu veiculo. Por favor, sair do outro veiculo.", source, 38, 122, 216, true) end end) addEvent("SellMyVehicle", true) addEventHandler("SellMyVehicle", root, function(id) local vehicle = getVehicleByID(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then local Money = math.ceil((data[1]["Cost"]*.9)*math.floor(data[1]["HP"])/100/10) givePlayerMoney (source, Money) if isElement(vehicle) then destroyElement(vehicle) end dbExec(db, "DELETE FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id) updateVehicleInfo(source) outputMessage("#c1c1c1Você vendeu o seu veiculo por #00FF66$"..Money, source, 38, 122, 216, true) end end) function getDataOnLogin(_, account) updateVehicleInfo(source) end addEventHandler("onPlayerLogin", root, getDataOnLogin) function SaveVehicleDataOnQuit() for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "Owner") == source then destroyVehicle(veh) end end end addEventHandler("onPlayerQuit", root,SaveVehicleDataOnQuit) addEvent("inviteToBuyCarSended", true) addEventHandler("inviteToBuyCarSended", root, function(player, price, veh_name, veh_id) if player and price and veh_name and veh_id then local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "recieveInviteToBuyCar", pl, getPlayerName (source), getAccountName(getPlayerAccount(source)), price, veh_name, veh_id ) else outputMessage ( "#c1c1c1O jogador não foi encontrado, a venda foi cancelada", source, 250, 10, 10, true) triggerClientEvent ( source, "cleanCarInvitations", source ) end end end) addEvent("invitationBuyCarNotAccepted", true) addEventHandler("invitationBuyCarNotAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputMessage ( "#c1c1c1O jogador recusou-se a comprar o seu carro", pl, 250, 10, 10,true) end end) addEvent("invitationBuyCarAccepted", true) addEventHandler("invitationBuyCarAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) local avail = false if pl and getAccountName ( getPlayerAccount (pl)) == acc then avail = true triggerClientEvent ( pl, "cleanCarInvitations", pl ) --outputMessage ( "Игрок отказался покупать ваше авто", pl, 250, 10, 10) else for i, v in ipairs( getElementsByType ( 'player' ) ) do if getAccountName(getPlayerAccount ( v )) == acc then avail = true pl = v break end end end price = tonumber(price) or 0 if avail then if isGuestAccount ( getPlayerAccount ( source ) ) then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputMessage ( "#c1c1c1Você não está logado em sua conta, a transação foi cancelada", source, 250, 10, 10,true ) outputMessage ( "#c1c1c1O jogador não entrou na conta, a transação foi cancelada", pl, 250, 10, 10,true ) return true end if getPlayerMoney ( source ) >= price then local vehicle = getVehicleByID(tonumber(veh_id)) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(pl)), veh_id), -1) if type(data) == "table" and #data ~= 0 and isElement ( vehicle ) then givePlayerMoney ( pl, price ) takePlayerMoney ( source, price ) dbExec(db, "UPDATE VehicleList SET Account = ? WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), getAccountName(getPlayerAccount(pl)), veh_id) updateVehicleInfo(source) updateVehicleInfo(pl) setElementData(vehicle, "Owner", source) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) outputMessage("#c1c1c1Você vendeu o seu veiculo por #00FF66$"..price, pl, 38, 122, 216, true) outputMessage("#c1c1c1Você comprou um carro por #00FF66$"..price, source, 38, 122, 216, true) triggerClientEvent ( pl, "cleanCarInvitations", pl ) else outputMessage ( "#c1c1c1A máquina não pode ser encontrado, o negócio é cancelado", source, 250, 10, 10,true ) outputMessage ( "#c1c1c1A máquina não pode ser encontrado, o negócio é cancelado. Tente carro desova.", pl, 250, 10, 10,true ) triggerClientEvent ( pl, "cleanCarInvitations", pl ) end else outputMessage ( "#c1c1c1Você não tem dinheiro suficiente, a transação foi cancelada", source, 250, 10, 10,true ) end else outputMessage ( "#c1c1c1O jogador não foi encontrado, a operação foi cancelada", source, 250, 10, 10,true) end end) function outputMessage (text, player, r, g, b) return exports["scr-Lib"]:outputMessage(player, text, r, g, b); end
  4. teria como passar um valor de uma variavel do client para o servidor? e o servidor respassar outro valor para o client? exemplo: -- Client Online = 0 function dxText() dxDrawText(Online .. " Online", 612, 312, 728, 344, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, true, false, false, false) end function botaoAtivacao() Entrar = guiCreateButton(618, 367, 115, 47, "Entrar", false) addEventHandler("onClientGUIClick", Entrar, Ativacao, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), botaoAtivacao) function Ativacao() triggerServerEvent("Entrada", getLocalPlayer()) end no Script da parte do client e criado uma variavel global chamada Online, nela e enserido um valor q é concatenado com o dxDrawText apos isto crio um botao fazendo a chamada no servidor. --Server function tab(teamName) RPG = createTeam("RPG", 0, 0, 0, 255) end addEventHandler("onResourceStart", resourceRoot, tab) function click() if RPG then setPlayerTeam(source, RPG) Online = Online +1 end end addEvent("Entrada", true) addEventHandler("Entrada", getRootElement(), click) na parte do servidor eu crio uma team chamada RPG, quando o player clicka no botao ele e inserido na team e apos isto a variavel Online e dado um novo valor só q esse valor nao é repassado para o client. Como posso repassala para o Client?
  5. Olá pessoal, tudo bom ? Coloquei um radar no meu servidor e queria saber como faço para a Area-Verde aparecer nele! Ja tenho as areas verdes criadas! Pórem quero saber como faz para elas aparecerem no radar, pois no radar elas nao aparecem. Agradeço muito se poderem tirar um tempinho pra me ajudar Script do Radar: -------------------------------------------------------------------------------------------------- -- Distributed under the Creative Commons Attribution-NonCommercial 4.0 International license -- -- Version: (release) 1.0.0 -- -- Original author: Kacper "MrTasty (aka Addon)" Stasiak -- -- Special thanks to: Doomed_Space_Marine (useful functions) -- -- robhol (useful functions) -- -------------------------------------------------------------------------------------------------- --Features local enableBlips = true local renderNorthBlip = true local alwaysRenderMap = false --true = always render map, false = only render when in interior world 0 (radar will stay, only the map will stop rendering) local alwaysRenderOxygen = false --true = always render oxygen, false = only when oxygen not full/local player in water local disableGTASAhealth = true --Disable GTASA's HUD health display local disableGTASAarmor = true --Disable GTASA's HUD armour display local disableGTASAoxygen = true --Disable GTASA's HUD oxygen display --Dimensions & Sizes local worldW, worldH = 3072, 3072 --map image dimensions - if map image changed, please edit appropriately local blip = 12 --Blip size, pixels relative to 1366x768 resolution --Colours - Notice: Health colours smoothly according it local player's HP. local healthOkayR, healthOkayG, healthOkayB = 102, 204, 102 --RGB for health which is 'okay' (50% or more) local healthBadR, healthBadG, healthBadB = 200, 200, 0 --RGB for health which is 'bad' (25%) local healthCriticalR, healthCriticalG, healthCriticalB = 200, 0, 0 --RGB for health which is 'critically low' (near/at 0%) local armorColorR, armorColorG, armorColorB = 0, 102, 255 local oxygenColorR, oxygenColorG, oxygenColorB = 255, 255, 0 ------------------------------------------------------------------------------------ --Do not modify anything below unless you're absolutely sure of what you're doing.-- ------------------------------------------------------------------------------------ local sx, sy = guiGetScreenSize() local rt = dxCreateRenderTarget(290, 175) local xFactor, yFactor = sx/1366, sy/768 local yFactor = xFactor --otherwise the radar looses it's 2:3 ratio. -- Useful functions -- function findRotation(x1,y1,x2,y2) --Author: Doomed_Space_Marine & robhol local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) --Author: robhol local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; 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 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(0, 0, mW, mH, 0xFF7CA7D1) --render background dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/mapa.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) end dxSetRenderTarget() dxDrawRectangle((10)*xFactor, sy-((200+10))*yFactor, (300)*xFactor, (200)*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, 150)) local health = math.max(math.min(getElementHealth(localPlayer)/(0.232018558500192*getPedStat(localPlayer, 24) -32.018558511152), 1), 0) local armor = math.max(math.min(getPedArmor(localPlayer)/100, 1), 0) local oxygen = math.max(math.min(getPedOxygenLevel(localPlayer)/(1.5*getPedStat(localPlayer, 225) +1000), 1), 0) local r, g, b if health >= 0.25 then r, g, b = interpolateBetween(healthBadR, healthBadG, healthBadB, healthOkayR, healthOkayG, healthOkayB, math.floor(health*20)/10, "InOutQuad") else r, g, b = interpolateBetween(healthCriticalR, healthCriticalB, healthCriticalB, healthBadR, healthBadG, healthBadB, math.floor(health*20)/10, "InOutQuad") end local col = tocolor(r, g, b, 190) local bg = tocolor(r, g, b, 100) dxDrawRectangle((15)*xFactor, sy-(25)*yFactor, (142.5)*xFactor, (10)*yFactor, bg) dxDrawRectangle((15)*xFactor, sy-(25)*yFactor, (142.5*health)*xFactor, (10)*yFactor, col) if alwaysRenderOxygen or (oxygen < 1 or isElementInWater(localPlayer)) then dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (67.5)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 100)) dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (67.5*armor)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 190)) dxDrawRectangle((237.5)*xFactor, sy-(25)*yFactor, (67.5)*xFactor, (10)*yFactor, tocolor(oxygenColorR, oxygenColorG, oxygenColorB, 100)) dxDrawRectangle((237.5)*xFactor, sy-(25)*yFactor, (67.5*oxygen)*xFactor, (10)*yFactor, tocolor(oxygenColorR, oxygenColorG, oxygenColorB, 190)) else dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (142.5)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 100)) dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (142.5*armor)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 190)) end 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("onClientResourceStop", resourceRoot, function() showPlayerHudComponent("radar", true) if disableGTASAhealth then showPlayerHudComponent("health", true) end if disableGTASAarmor then showPlayerHudComponent("armour", true) end if disableGTASAoxygen then showPlayerHudComponent("breath", true) end end)
  6. Olá pessoal do forum, tenho um ''DX Money'' no meu servidor, abaixo mostrarei a imagem dele pelo print https://prnt.sc/kytkfg Eu escrevi no print, onde quero mais ou menos q ele apareça, caso possam me ajudar! No print, ele esta entre o velocimetro não sei se conseguiram ver escrito "- $799,200", eu queria que ele aparecesse mais ou menos a partir dali onde esta a seta do mta, não muito perto do hud, porque ele esta praticamente dentro do velocimetro, o script dele esta abaixo, OBS:Ele tem só´1 arquivo.lua q é o client ------------------------------------------------------------------------- Client: local playerMoney = getPlayerMoney ( localPlayer ) local messages = { } local sx, sy = guiGetScreenSize ( ) addEventHandler ( "onClientRender", root, function ( ) local tick = getTickCount ( ) if ( playerMoney ~= getPlayerMoney ( localPlayer ) ) then local pM = getPlayerMoney ( localPlayer ) if ( pM > playerMoney ) then local diff = pM - playerMoney table.insert ( messages, { diff, true, tick + 5000, 180 } ) else local diff = playerMoney - pM table.insert ( messages, { diff, false, tick + 5000, 180 } ) end playerMoney = pM end if ( #messages > 7 ) then table.remove ( messages, 1 ) end for index, data in ipairs ( messages ) do local v1 = data[1] local v2 = data[2] local v3 = data[3] local v4 = data[4] dxDrawRectangle ( sx - 220, (sy-20)-(index*25), 200, 20, tocolor ( 0, 0, 0, v4 ) ) if ( v2 ) then dxDrawText ( "+ $"..convertNumber ( v1 ), sx - 200, (sy-18)-(index*25), 50, 20, tocolor ( 0, 255, 0, v4+75 ), 1, 'default-bold' ) else dxDrawText ( "- $"..convertNumber ( v1 ), sx - 200, (sy-18)-(index*25), 50, 20, tocolor ( 255, 0, 0, v4+75 ), 1, 'default-bold' ) end if ( tick >= v3 ) then messages[index][4] = v4-2 if ( v4 <= 25 ) then table.remove ( messages, index ) end end end end ) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end
  7. Boa tarde, alguem sabe o nome desse mod? usam ele em todos os servidores praticamente. LINK DA IMAGEM DELE ABAIXO: https://imgur.com/a/fXq0oRK
  8. Hello friends ! Aren't there any easy way to get the offset position of X, Y and Z of an attaching element, that can be used as "attachElements" function's arguments ? Please tell me a way if you know.
  9. É um script de proteção de bases! Tipo, apenas quem está na acl ''MARINHA'' pode ir para a base da marinha brasileira, como faço pra mais de uma acl poder ir para essa base? SCRIPT: RestricLocation = {} TeleportLocation = {} EnabledAlarm = true ColCuboid = false --------------------------------------- CONFIGS -------------------------------------------- RestricLocation["location1"] = {-264.21362304688,3335.7004394531,1.1062507629395} -- Local 1 RestricLocation["location2"] = {775.92932128906,2741.86544785156,150.10624694824} -- Local 2 TeleportLocation = {1976.0953369141,-1924.1055908203,13.546875} -- Local de TP GroupName = "MARINHA" -- Nome da Gang ou Grupo ACL GroupNameBy = 2 -- 1 para Gang, e 2 para ACL MsgInvasao = "Base da MARINHA! Você não pode entrar aqui!" EnableVehicleGodMode = true -- Habilitar HabilitarAdmin = false -- Todos admins vao poder entrar na base GodMode = false -- Ao entrar na área protegida, habilita GodMode NaoAtirar = false -- Ao entrar na área protegida, não podera atirar --------------------------------------- CONFIGS -------------------------------------------- function sendMsg(iplayer,msg) outputChatBox ( msg, iplayer, 255, 0, 0, true ) end function EnterPlace ( theElement ) local veh = getPedOccupiedVehicle(theElement) local accName = getAccountName(getPlayerAccount(theElement)) if HabilitarAdmin == true then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then return end end if (getElementType ( theElement ) == "player") and (PlayerHaveLevel (theElement) == false) then sendMsg(theElement,MsgInvasao) if veh then setElementPosition( veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else setElementPosition( theElement, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) end sendMsgOwners(theElement) elseif getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,true) end end function ExitPlace ( theElement ) if GodMode == true then setElementData(theElement,"blood",12000) end if NaoAtirar == true then toggleControl(theElement, "fire", true) toggleControl(theElement, "vehicle_fire", true) toggleControl(theElement, "vehicle_secondary_fire", true) toggleControl(theElement, "aim_weapon", true) end if getElementType ( theElement ) == "vehicle" then SetVehicleGodMode(theElement,false) end end function PlayerHaveLevel( PlayerID ) if GroupNameBy == 1 then if ( getElementData ( PlayerID , "gang" ) == GroupName ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end else local accName = getAccountName ( getPlayerAccount ( PlayerID ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( GroupName ) ) ) then if GodMode == true then setElementData(PlayerID,"blood",999999999999999) end if NaoAtirar == true then toggleControl (PlayerID, "fire", false) toggleControl (PlayerID, "vehicle_fire", false) toggleControl (PlayerID, "vehicle_secondary_fire", false) toggleControl (PlayerID, "aim_weapon", false) end return true else return false end end end function ResourceStart( ) LoadLocations() CreateCollision() end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ),ResourceStart) function LoadLocations() local RX, RY, RZ, WRX, WRX, WRX if(RestricLocation["location1"][1] > RestricLocation["location2"][1]) then RestricLocation["maxx"] = RestricLocation["location1"][1] RestricLocation["minx"] = RestricLocation["location2"][1] else RestricLocation["maxx"] = RestricLocation["location2"][1] RestricLocation["minx"] = RestricLocation["location1"][1] end if(RestricLocation["location1"][2] > RestricLocation["location2"][2]) then RestricLocation["maxy"] = RestricLocation["location1"][2] RestricLocation["miny"] = RestricLocation["location2"][2] else RestricLocation["maxy"] = RestricLocation["location2"][2] RestricLocation["miny"] = RestricLocation["location1"][2] end if(RestricLocation["location1"][3] > RestricLocation["location2"][3]) then RestricLocation["maxz"] = RestricLocation["location1"][3] RestricLocation["minz"] = RestricLocation["location2"][3] else RestricLocation["maxz"] = RestricLocation["location2"][3] RestricLocation["minz"] = RestricLocation["location1"][3] end end function CreateCollision() RX = RestricLocation["minx"] WRX = RestricLocation["maxx"] - RestricLocation["minx"] RY = RestricLocation["miny"] WRY = RestricLocation["maxy"] - RestricLocation["miny"] RZ = RestricLocation["minz"] WRZ = RestricLocation["maxz"] - RestricLocation["minz"] ColCuboid = createColCuboid ( RX, RY, RZ, WRX, WRY, WRZ ) if ColCuboid then addEventHandler ( "onColShapeHit", ColCuboid, EnterPlace ) addEventHandler ( "onColShapeLeave", ColCuboid, ExitPlace ) else outputDebugString("Erro, verifique: location1 e location2") end end function ResourceStop( ) destroyElement ( ColCuboid ) end addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ),ResourceStop) function sendMsgOwners( PlayerID ) local connectedPlayers = getElementsByType ( "player" ) for i, aPlayer in ipairs(connectedPlayers) do if(PlayerHaveLevel (aPlayer) == true) then sendMsg(aPlayer," O Jogador " ..getPlayerName ( PlayerID ) .." esta tentando invadir a sua BASE !") end end end function SetVehicleGodMode( VehicleID, godEoD ) if EnableVehicleGodMode == true then setElementData(VehicleID, "godmode", godEoD) setVehicleDamageProof (VehicleID, godEoD ) end end
  10. Boa noite galera! Gostaria de saber se coloquei o ''modo superman ( Voar )'' corretamente em meu painel vip, caso tenha algo errado, [ agradeceria muito se vcs me reenviarem tudo corrigido ] desculpem o incomodo, sou iniciante em script, e meu servidor esta lotando muito! o ''tudo corrigido'' ali, quis dizer, me mandar o script inteiro, porém as coisas que eu errei, já corrigidas! pessoal muito obrigado se puderem fazer isso por mim! atenciosamente: eu de novo rsrsrs, devem ter me visto em um monte de topicos por ai ne kssks SERVER: function showPanel(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP DIAMANTE")) then triggerClientEvent(thePlayer, "abrirVip", getRootElement()) end end function onResStart() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "o", "down", showPanel) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStart) function onPlayerJoin() bindKey(source, "o", "down", showPanel) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin) function cleanAll(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "o", "down", showPanel) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAll) function skinVip1() setElementModel(source, 0) displayServerMessage(source, "Você Pegou Skin VIP DIAMANTE 2", "confirm") end addEvent("skinVip1", true) addEventHandler("skinVip1", getRootElement(), skinVip1) function skinVip2() setElementModel(source, 123) displayServerMessage(source, "Você Pegou Skin VIP DIAMANTE 1", "confirm") end addEvent("skinVip2", true) addEventHandler("skinVip2", getRootElement(), skinVip2) function vidacolete() setPedStat(source, 24, 999) setElementHealth(source, 200) setPedArmor(source, 100) displayServerMessage(source, "Vida 200% e Colete", "confirm") end addEvent("vidacolete", true) addEventHandler("vidacolete", getRootElement(), vidacolete) function kitarmas1() giveWeapon(source, 1, 2000) giveWeapon(source, 2, 2000) giveWeapon(source, 10, 2000) giveWeapon(source, 23, 2000) giveWeapon(source, 26, 2000) giveWeapon(source, 28, 2000) giveWeapon(source, 31, 2000) giveWeapon(source, 34, 2000) giveWeapon(source, 37, 2000) giveWeapon(source, 39, 2000) giveWeapon(source, 43, 2000) giveWeapon(source, 46, 2000) displayServerMessage(source, "Você Pegou Kit Armas 1", "confirm") end addEvent("kitarmas1", true) addEventHandler("kitarmas1", getRootElement(), kitarmas1) function kitarmas2() giveWeapon(source, 1, 2000) giveWeapon(source, 6, 2000) giveWeapon(source, 10, 2000) giveWeapon(source, 22, 2000) giveWeapon(source, 25, 2000) giveWeapon(source, 29, 2000) giveWeapon(source, 31, 2000) giveWeapon(source, 34, 2000) giveWeapon(source, 37, 2000) giveWeapon(source, 39, 2000) giveWeapon(source, 43, 2000) giveWeapon(source, 46, 2000) displayServerMessage(source, "Você Pegou Kit Armas 2", "confirm") end addEvent("kitarmas2", true) addEventHandler("kitarmas2", getRootElement(), kitarmas2) function habilidades() setPedStat(source, 69, 1000) setPedStat(source, 70, 1000) setPedStat(source, 71, 1000) setPedStat(source, 72, 1000) setPedStat(source, 73, 1000) setPedStat(source, 74, 1000) setPedStat(source, 75, 1000) setPedStat(source, 76, 1000) setPedStat(source, 77, 1000) setPedStat(source, 78, 1000) setPedStat(source, 79, 1000) displayServerMessage(source, "Você Pegou Todas Habilidades", "confirm") end addEvent("habilidades", true) addEventHandler("habilidades", getRootElement(), habilidades) function jetpack1() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia do Veiculo Primeiro", "warning") return end givePedJetPack(source) displayServerMessage(source, "Jetpack Ativado", "confirm") end addEvent("jetpack1", true) addEventHandler("jetpack1", getRootElement(), jetpack1) function jetpack2() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia do Veiculo Primeiro", "warning") return end removePedJetPack(source) displayServerMessage(source, "Jetpack Desativado", "warning") end addEvent("jetpack2", true) addEventHandler("jetpack2", getRootElement(), jetpack2) function invisivel1() if getElementAlpha(source) == 255 then setElementAlpha(source, 0) setPlayerNametagShowing(source, false) displayServerMessage(source, "Skin Invisivel Ativado", "confirm") end end addEvent("invisivel1", true) addEventHandler("invisivel1", getRootElement(), invisivel1) function invisivel2() if getElementAlpha(source) == 0 then setElementAlpha(source, 255) setPlayerNametagShowing(source, true) displayServerMessage(source, "Skin Invisivel Desativado", "warning") end end addEvent("invisivel2", true) addEventHandler("invisivel2", getRootElement(), invisivel2) function velocidade1() displayServerMessage(source, "Sua Velocidade Esta Lenta", "confirm") end addEvent("velocidade1", true) addEventHandler("velocidade1", getRootElement(), velocidade1) function velocidade2() displayServerMessage(source, "Sua Velocidade Esta Rapida", "confirm") end addEvent("velocidade2", true) addEventHandler("velocidade2", getRootElement(), velocidade2) function velocidade3() displayServerMessage(source, "Sua Velocidade Esta Normal", "confirm") end addEvent("velocidade3", true) addEventHandler("velocidade3", getRootElement(), velocidade3) function proVeiculo1() if isPedInVehicle(source) then if isVehicleDamageProof(getPedOccupiedVehicle(source)) == false then setVehicleDamageProof(getPedOccupiedVehicle(source), true) displayServerMessage(source, "Proteção Veiculo Ativado", "confirm") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("proVeiculo1", true) addEventHandler("proVeiculo1", getRootElement(), proVeiculo1) function proVeiculo2() if isPedInVehicle(source) then if isVehicleDamageProof(getPedOccupiedVehicle(source)) == true then setVehicleDamageProof(getPedOccupiedVehicle(source), false) displayServerMessage(source, "Proteção Veiculo Desativado", "warning") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("proVeiculo2", true) addEventHandler("proVeiculo2", getRootElement(), proVeiculo2) function veiculoInvisivel1() if isPedInVehicle(source) then if getElementAlpha(getPedOccupiedVehicle(source)) == 255 then setElementAlpha(getPedOccupiedVehicle(source), 0) displayServerMessage(source, "Veiculo Invisivel Ativado", "confirm") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("veiculoInvisivel1", true) addEventHandler("veiculoInvisivel1", getRootElement(), veiculoInvisivel1) function veiculoInvisivel2() if isPedInVehicle(source) then if getElementAlpha(getPedOccupiedVehicle(source)) == 0 then setElementAlpha(getPedOccupiedVehicle(source), 255) displayServerMessage(source, "Veiculo Invisivel Desativado", "warning") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("veiculoInvisivel2", true) addEventHandler("veiculoInvisivel2", getRootElement(), veiculoInvisivel2) function agua1() if isPedInVehicle(source) then triggerClientEvent(source, "aguaTrue", getRootElement()) displayServerMessage(source, "Dirigir Sobre Água Ativado", "confirm") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("agua1", true) addEventHandler("agua1", getRootElement(), agua1) function agua2() if isPedInVehicle(source) then triggerClientEvent(source, "aguaFalse", getRootElement()) displayServerMessage(source, "Dirigir Sobre Água Desativado", "warning") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("agua2", true) addEventHandler("agua2", getRootElement(), agua2) function fly1() if isPedInVehicle(source) then triggerClientEvent(source, "flyTrue", getRootElement()) displayServerMessage(source, "Voar Com o Carro Ativado", "confirm") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("fly1", true) addEventHandler("fly1", getRootElement(), fly1) function fly2() if isPedInVehicle(source) then triggerClientEvent(source, "flyFalse", getRootElement()) displayServerMessage(source, "Voar Com o Carro Desativado", "warning") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("fly2", true) addEventHandler("fly2", getRootElement(), fly2) function spon() triggerClientEvent(source, "Superman.Start", getRootElement()) displayServerMessage(source, "Modo Superman Ativado.", "confirm") end addEvent("spon", true) addEventHandler("spon", root, spon) function spoff() triggerClientEvent(source, "Superman.Stop", getRootElement()) displayServerMessage(source, "Modo Superman Desativado.", "warning") end addEvent("spoff", true) addEventHandler("spoff", root, spoff) function andar1() setPedWalkingStyle(source, 126) displayServerMessage(source, "Estilo Andar 1 Ativado", "confirm") end addEvent("andar1", true) addEventHandler("andar1", getRootElement(), andar1) function andar2() setPedWalkingStyle(source, 122) displayServerMessage(source, "Estilo Andar 2 Ativado", "confirm") end addEvent("andar2", true) addEventHandler("andar2", getRootElement(), andar2) function andar3() setPedWalkingStyle(source, 0) displayServerMessage(source, "Estilo Andar Desativado", "warning") end addEvent("andar3", true) addEventHandler("andar3", getRootElement(), andar3) function jump1() if isPedInVehicle(source) then triggerClientEvent(source, "jumpStart", getRootElement()) displayServerMessage(source, "Pular Com o Veiculo Ativado", "confirm") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("jump1", true) addEventHandler("jump1", getRootElement(), jump1) function jump2() if isPedInVehicle(source) then triggerClientEvent(source, "jumpStop", getRootElement()) displayServerMessage(source, "Pular Com o Veiculo Desativado", "warning") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("jump2", true) addEventHandler("jump2", getRootElement(), jump2) veiculo = {} function carro() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia Do Veiculo Primeiro", "warning") return end if veiculo[source] and isElement(veiculo[source]) then destroyElement(veiculo[source]) end local x, y, z = getElementPosition(source) veiculo[source] = createVehicle(411, x, y, z) warpPedIntoVehicle(source, veiculo[source]) displayServerMessage(source, "Você Pegou Carro Vip", "confirm") end addEvent("carro", true) addEventHandler("carro", getRootElement(), carro) veiculo = {} function moto() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia Do Veiculo Primeiro", "warning") return end if veiculo[source] and isElement(veiculo[source]) then destroyElement(veiculo[source]) end local x, y, z = getElementPosition(source) veiculo[source] = createVehicle(522, x, y, z) warpPedIntoVehicle(source, veiculo[source]) displayServerMessage(source, "Você Pegou Moto Vip", "confirm") end addEvent("moto", true) addEventHandler("moto", getRootElement(), moto) -- //#Mensages function displayServerMessage(source, message, type) triggerClientEvent(source, "servermessages", getRootElement(), message, type) end -- //#Status addEvent("callServerAccountName", true) addEventHandler("callServerAccountName", root, function (thePlayer) if thePlayer then local account = getPlayerAccount(thePlayer) if account then if isGuestAccount(account) then setElementData(thePlayer,"account-name", "Não logado") else local accountName = getAccountName(account) setElementData(thePlayer, "account-name", accountName) end end end end ) addEventHandler("onPlayerLogin", root, function() local accountName = getAccountName(getPlayerAccount(source)) setElementData(source, "account-name", accountName) end ) addEventHandler("onPlayerLogout", root, function() setElementData(source, "account-name", "Não logado") end ) function Events() if eventName == "onResourceStart" then for k,v in ipairs(getElementsByType("player")) do setElementData(v, "IP", getPlayerIP(v)) end elseif eventName == "onPlayerJoin" then setElementData(source, "IP", getPlayerIP(source)) end end addEventHandler("onResourceStart", resourceRoot, Events) addEventHandler("onPlayerJoin", root, Events) addEvent("online", true) addEventHandler("online", getRootElement(), function() setElementData(source,"maxPlayers",getMaxPlayers(source)) setElementData(source,"numPlayers",getPlayerCount(source)) end) CLIENT: local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) local Font_1 = dxCreateFont("font/font.ttf", 14) local Font_2 = dxCreateFont("font/font.ttf", 9) local Font_3 = dxCreateFont("font/font.ttf", 13) local Font_4 = dxCreateFont("font/font.ttf", 14) local Font_5 = dxCreateFont("font/font.ttf", 11) local movertexto = 0 cor = {} vip1 = false function dxPainelVip1() dxDrawRectangle(x*423, y*184, x*520, y*500, tocolor(0, 0, 0, 111), false) dxDrawRectangle(x*425, y*186, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("Painel Vip", x*425, y*186, x*941, y*221, tocolor(255, 255, 255, 255), x*1.00, Font_1, "center", "center", false, false, false, false, false) local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 10 dxDrawImage(x*486, y*186, x*192, y*138, "img/jogador.png", angle, 0, -40, tocolor(255, 255, 255, 255), false) dxDrawImage(x*685, y*186, x*192, y*138, "img/veiculo.png", angle, 0, -40, tocolor(255, 255, 255, 255), false) cor[1] = tocolor(0, 0, 0, 111) cor[2] = tocolor(0, 0, 0, 111) if cursorPosition(x*820, y*247, x*104, y*25) then cor[1] = tocolor(0, 111, 255, 255) end if cursorPosition(x*443, y*247, x*104, y*25) then cor[2] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*820, y*247, x*104, y*25, cor[1], false) dxDrawRectangle(x*443, y*247, x*104, y*25, cor[2], false) dxDrawText("Veiculo", x*820, y*247, x*924, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawText("Jogador", x*443, y*247, x*547, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawLine(x*427, y*223, x*936, y*223, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*289, x*937, y*289, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*644, x*937, y*644, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*681, y*298, x*681, y*634, tocolor(255, 255, 255, 255), x*1, false) movertexto = movertexto + 0.999*3 local movertexto1, movertexto2 = interpolateBetween (x*430, y*653, 0, x*630, y*653, 0, movertexto, "SineCurve") dxDrawRectangle(x*425, y*647, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("@Copyright - #Horus todos os direitos reservados!", movertexto1, movertexto2, x, y, tocolor(255, 255, 255, 255), x*1.00, Font_3, "left", "top", false, false, false, false, false) cor[3] = tocolor(0, 0, 0, 111) cor[4] = tocolor(0, 0, 0, 111) cor[5] = tocolor(0, 0, 0, 111) cor[6] = tocolor(0, 0, 0, 111) cor[7] = tocolor(0, 0, 0, 111) cor[8] = tocolor(0, 0, 0, 111) cor[9] = tocolor(0, 0, 0, 111) cor[10] = tocolor(0, 0, 0, 111) cor[11] = tocolor(0, 0, 0, 111) cor[12] = tocolor(0, 0, 0, 111) cor[13] = tocolor(0, 0, 0, 111) cor[14] = tocolor(0, 0, 0, 111) cor[15] = tocolor(0, 0, 0, 111) cor[16] = tocolor(0, 0, 0, 111) cor[17] = tocolor(0, 0, 0, 111) cor[18] = tocolor(0, 0, 0, 111) cor[19] = tocolor(0, 0, 0, 111) cor[20] = tocolor(0, 0, 0, 111) if cursorPosition(x*465, y*328, x*180, y*26) then cor[3] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*358, x*180, y*26) then cor[4] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*421, x*180, y*26) then cor[5] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*451, x*180, y*26) then cor[6] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*482, x*180, y*26) then cor[7] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*328, x*180, y*26) then cor[8] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*388, x*84, y*26) then cor[9] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*388, x*84, y*26) then cor[10] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*544, x*180, y*26) then cor[11] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*574, x*180, y*26) then cor[12] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*604, x*180, y*26) then cor[13] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*451, x*84, y*26) then cor[14] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*451, x*84, y*26) then cor[15] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*513, x*84, y*26) then cor[16] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*513, x*84, y*26) then cor[17] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*574, x*84, y*26) then cor[18] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*574, x*84, y*26) then cor[19] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*604, x*180, y*26) then cor[20] = tocolor(0, 111, 255, 255) end dxDrawText("Skins", x*465, y*303, x*645, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*328, x*180, y*26, cor[3], false) dxDrawRectangle(x*465, y*358, x*180, y*26, cor[4], false) dxDrawText("Skin DIAMANTE 1", x*465, y*328, x*645, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Skin DIAMANTE 2", x*465, y*358, x*645, y*384, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Armas", x*465, y*394, x*645, y*417, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*421, x*180, y*26, cor[5], false) dxDrawRectangle(x*465, y*451, x*180, y*26, cor[6], false) dxDrawRectangle(x*465, y*482, x*180, y*26, cor[7], false) dxDrawText("Kit 1", x*465, y*421, x*645, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Kit 2", x*465, y*451, x*645, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Habilidade", x*465, y*482, x*645, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Vida Colete", x*720, y*303, x*900, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*328, x*180, y*26, cor[8], false) dxDrawText("Vida Colete", x*720, y*328, x*900, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Jet Pack", x*720, y*364, x*900, y*385, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*388, x*84, y*26, cor[9], false) dxDrawRectangle(x*816, y*388, x*84, y*26, cor[10], false) dxDrawText("Pegar", x*720, y*388, x*804, y*414, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Tirar", x*816, y*388, x*900, y*414, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Velocidade Do Jogo", x*465, y*518, x*645, y*539, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*544, x*180, y*26, cor[11], false) dxDrawRectangle(x*465, y*574, x*180, y*26, cor[12], false) dxDrawRectangle(x*465, y*604, x*180, y*26, cor[13], false) dxDrawText("Lento", x*465, y*544, x*645, y*570, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Rapido 3x", x*465, y*574, x*645, y*600, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Normal", x*465, y*604, x*645, y*630, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Skin Invisivel", x*720, y*426, x*900, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*451, x*84, y*26, cor[14], false) dxDrawRectangle(x*816, y*451, x*84, y*26, cor[15], false) dxDrawText("Ativar", x*720, y*451, x*804, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*816, y*451, x*900, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Superman", x*720, y*487, x*900, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*513, x*84, y*26, cor[16], false) dxDrawRectangle(x*816, y*513, x*84, y*26, cor[17], false) dxDrawText("On", x*720, y*513, x*804, y*539, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Off", x*816, y*513, x*900, y*539, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Estilo De Andar", x*720, y*549, x*900, y*570, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*574, x*84, y*26, cor[18], false) dxDrawRectangle(x*816, y*574, x*84, y*26, cor[19], false) dxDrawRectangle(x*720, y*604, x*180, y*26, cor[20], false) dxDrawText("Stylo 1", x*720, y*574, x*804, y*600, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Stylo 2", x*816, y*574, x*900, y*600, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Andar Normal", x*720, y*604, x*900, y*630, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) cor[19] = tocolor(0, 0, 0, 111) if cursorPosition(x*630, y*247, x*104, y*25) then cor[19] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*630, y*247, x*104, y*25, cor[19], false) dxDrawText("Seu Status", x*630, y*247, x*734, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) end vip2 = false function dxPainelVip2() dxDrawRectangle(x*423, y*184, x*520, y*500, tocolor(0, 0, 0, 111), false) dxDrawRectangle(x*425, y*186, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("VIP DIAMANTE", x*425, y*186, x*941, y*221, tocolor(255, 255, 255, 255), x*1.00, Font_1, "center", "center", false, false, false, false, false) local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 10 dxDrawImage(x*486, y*186, x*192, y*138, "img/jogador.png", angle, 0, -30 , tocolor(255, 255, 255, 255), false) dxDrawImage(x*685, y*186, x*192, y*138, "img/veiculo.png", angle, 0, -30 , tocolor(255, 255, 255, 255), false) cor[1] = tocolor(0, 0, 0, 111) cor[2] = tocolor(0, 0, 0, 111) if cursorPosition(x*820, y*247, x*104, y*25) then cor[1] = tocolor(0, 111, 255, 255) end if cursorPosition(x*443, y*247, x*104, y*25) then cor[2] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*820, y*247, x*104, y*25, cor[1], false) dxDrawRectangle(x*443, y*247, x*104, y*25, cor[2], false) dxDrawText("Veiculo", x*820, y*247, x*924, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawText("Jogador", x*443, y*247, x*547, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawLine(x*427, y*223, x*936, y*223, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*289, x*937, y*289, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*644, x*937, y*644, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*681, y*298, x*681, y*634, tocolor(255, 255, 255, 255), x*1, false) movertexto = movertexto + 0.999*3 local movertexto1, movertexto2 = interpolateBetween (x*430, y*653, 0, x*630, y*653, 0, movertexto, "SineCurve") dxDrawRectangle(x*425, y*647, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("@Copyright - #Horus todos os direitos reservados!", movertexto1, movertexto2, x, y, tocolor(255, 255, 255, 255), x*1.00, Font_3, "left", "top", false, false, false, false, false) cor[3] = tocolor(0, 0, 0, 111) cor[4] = tocolor(0, 0, 0, 111) cor[5] = tocolor(0, 0, 0, 111) cor[6] = tocolor(0, 0, 0, 111) cor[7] = tocolor(0, 0, 0, 111) cor[8] = tocolor(0, 0, 0, 111) cor[9] = tocolor(0, 0, 0, 111) cor[10] = tocolor(0, 0, 0, 111) cor[11] = tocolor(0, 0, 0, 111) cor[12] = tocolor(0, 0, 0, 111) cor[13] = tocolor(0, 0, 0, 111) cor[14] = tocolor(0, 0, 0, 111) cor[15] = tocolor(0, 0, 0, 111) cor[16] = tocolor(0, 0, 0, 111) cor[17] = tocolor(0, 0, 0, 111) cor[18] = tocolor(0, 0, 0, 111) if cursorPosition(x*465, y*328, x*180, y*26) then cor[3] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*358, x*180, y*26) then cor[4] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*421, x*180, y*26) then cor[5] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*451, x*180, y*26) then cor[6] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*328, x*180, y*26) then cor[7] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*358, x*180, y*26) then cor[8] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*512, x*180, y*26) then cor[9] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*542, x*180, y*26) then cor[10] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*421, x*180, y*26) then cor[11] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*451, x*180, y*26) then cor[12] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*512, x*180, y*26) then cor[13] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*542, x*180, y*26) then cor[14] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*602, x*84, y*26) then cor[15] = tocolor(0, 111, 255, 255) end if cursorPosition(x*561, y*602, x*84, y*26) then cor[16] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*602, x*84, y*26) then cor[17] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*602, x*84, y*26) then cor[18] = tocolor(0, 111, 255, 255) end dxDrawText("Veiculos", x*465, y*303, x*645, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*328, x*180, y*26, cor[3], false) dxDrawRectangle(x*465, y*358, x*180, y*26, cor[4], false) dxDrawText("Moto", x*465, y*328, x*645, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Carro", x*465, y*358, x*645, y*384, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Indestrutivel", x*465, y*394, x*645, y*417, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*421, x*180, y*26, cor[5], false) dxDrawRectangle(x*465, y*451, x*180, y*26, cor[6], false) dxDrawText("Ativar", x*465, y*421, x*645, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*465, y*451, x*645, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Colorido 'Rainbow'", x*720, y*303, x*900, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*328, x*180, y*26, cor[7], false) dxDrawRectangle(x*720, y*358, x*180, y*26, cor[8], false) dxDrawText("Ativar", x*720, y*328, x*900, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*720, y*358, x*900, y*384, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Invisivel", x*465, y*487, x*645, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*512, x*180, y*26, cor[9], false) dxDrawRectangle(x*465, y*542, x*180, y*26, cor[10], false) dxDrawText("Ativar", x*465, y*512, x*645, y*538, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*465, y*542, x*645, y*568, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Farol Colorido 'Rainbow'", x*720, y*394, x*900, y*415, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*421, x*180, y*26, cor[11], false) dxDrawRectangle(x*720, y*451, x*180, y*26, cor[12], false) dxDrawText("Ativar", x*720, y*421, x*900, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*720, y*451, x*900, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Pular 'Jum Car'", x*720, y*487, x*900, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*512, x*180, y*26, cor[13], false) dxDrawRectangle(x*720, y*542, x*180, y*26, cor[14], false) dxDrawText("Ativar", x*720, y*513, x*900, y*538, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*720, y*543, x*900, y*568, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Andar Na Agua", x*465, y*578, x*645, y*599, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*602, x*84, y*26, cor[15], false) dxDrawRectangle(x*561, y*602, x*84, y*26, cor[16], false) dxDrawText("Ativar", x*465, y*602, x*549, y*627, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*561, y*602, x*645, y*627, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Vooar", x*720, y*578, x*900, y*599, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*602, x*84, y*26, cor[17], false) dxDrawRectangle(x*816, y*602, x*84, y*26, cor[18], false) dxDrawText("Ativar", x*720, y*602, x*804, y*627, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*816, y*603, x*900, y*628, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) cor[19] = tocolor(0, 0, 0, 111) if cursorPosition(x*630, y*247, x*104, y*25) then cor[19] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*630, y*247, x*104, y*25, cor[19], false) dxDrawText("Seu Status", x*630, y*247, x*734, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) end vip3 = false function dxPainelVip3() setTimer(function() triggerServerEvent("online",getLocalPlayer()) end, 100, 1, true) local nome = getPlayerName(getLocalPlayer()) local vida = math.floor(getElementHealth(getLocalPlayer())) local colete = math.floor(getPedArmor(getLocalPlayer())) local oxigenio = math.floor(getPedOxygenLevel(getLocalPlayer())) local ip = getElementData(getLocalPlayer(), "IP") local ping = getPlayerPing (getLocalPlayer()) local skin = getElementModel (getLocalPlayer()) local weaponAmmo = getPedTotalAmmo (getLocalPlayer()) local weaponID = getPedWeapon(getLocalPlayer()) local weaponName = getWeaponNameFromID(weaponID) local time = getRealTime() local hours = time.hour local minutes = time.minute local seconds = time.second if (hours >= 0 and hours < 10) then hours = "0"..time.hour end if (minutes >= 0 and minutes < 10) then minutes = "0"..time.minute end if (seconds >= 0 and seconds < 10) then seconds = "0"..time.second end local meses = {"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"} local dias = {"Domingo", "Segunda Feira", "Terça Feira", "Quarta Feira", "Quinta Feira", "Sexta Feira", "Sabado"} local dia = ("%02d"):format(time.monthday) local ano = ("%02d"):format(time.year + 1900) local diaa = dias[time.weekday + 1] local mes = meses[time.month + 1] local num = getElementData (getLocalPlayer(), "numPlayers") local max = getElementData (getLocalPlayer(), "maxPlayers") dxDrawRectangle(x*423, y*32, x*520, y*144, tocolor(0, 0, 0, 111), false) dxDrawRectangle(x*425, y*34, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("Seu Status", x*425, y*34, x*941, y*69, tocolor(255, 255, 255, 255), x*1.00, Font_1, "center", "center", false, false, false, false, false) dxDrawLine(x*427, y*69, x*937, y*69, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*169, x*937, y*169, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*681, y*75, x*681, y*165, tocolor(255, 255, 255, 255), x*1, false) dxDrawColorText("Nome: "..nome, x*440, y*79, x*655, y*93, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Conta: #006FFF"..tostring(getElementData(getLocalPlayer(), "account-name")), x*440, y*93, x*655, y*107, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Vida: #006FFF"..vida.."#FFFFFF% | Colete: #006FFF"..colete.."#FFFFFF% | Oxigenio: #006FFF"..oxigenio.."#FFFFFF%", x*440, y*107, x*655, y*121, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Ip: #006FFF"..(ip or "N/A"), x*440, y*121, x*655, y*135, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) if getElementData(getLocalPlayer(),"FPS") then playerFPS = getElementData(getLocalPlayer(),"FPS") else playerFPS = 0 end dxDrawColorText("Ping: #006FFF"..ping.." #FFFFFF|#FFFFFF Fps: #006FFF"..playerFPS, x*440, y*135, x*655, y*149, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Skin: #006FFF"..skin, x*440, y*149, x*655, y*163, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Arma: #006FFF"..weaponName.." #FFFFFF(#FFFFFFId: #006FFF"..weaponID.."#FFFFFF) (#FFFFFFMunicao: #006FFF"..weaponAmmo.."#FFFFFF)", x*695, y*79, x*910, y*93, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Hora: #006FFF"..hours.." #FFFFFF: #006FFF"..minutes.." #FFFFFF: #006FFF"..seconds, x*695, y*93, x*910, y*107, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Data: #006FFF"..dia.." #FFFFFF/ #006FFF"..mes.." #FFFFFF/ #006FFF"..ano, x*695, y*107, x*910, y*121, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Dia Da Semana: #006FFF"..diaa, x*695, y*121, x*910, y*135, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) local veh = getPedOccupiedVehicle(getLocalPlayer()) if veh then local veiculo = getVehicleName(veh, getLocalPlayer()) local vehiclehealth = math.floor(getElementHealth(veh)/10) dxDrawColorText("Veiculo: #006FFF"..veiculo.." #FFFFFF| #FFFFFFDanos: #006FFF"..vehiclehealth.."%", x*695, y*135, x*910, y*149, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) else dxDrawColorText("Veiculo: #006FFFN#FFFFFF/#006FFFA", x*695, y*135, x*910, y*149, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) end dxDrawColorText("Jogadores Online: #006FFF"..tostring(num).." #FFFFFF/ #006FFF"..tostring(max), x*695, y*149, x*910, y*163, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) end function clickVip1(button, state) if vip1 == true and vip2 == false and button == "left" and state == "down" then if cursorPosition(x*820, y*247, x*104, y*25) then playSoundFrontEnd(3) vip1 = false vip2 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip2) removeEventHandler("onClientRender", getRootElement(), dxPainelVip1) end end if vip1 == true and vip3 == false and button == "left" and state == "down" then if cursorPosition(x*630, y*247, x*104, y*25) then playSoundFrontEnd(3) vip3 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip3) end end if vip2 == true and vip1 == false and button == "left" and state == "down" then if cursorPosition(x*443, y*247, x*104, y*25) then playSoundFrontEnd(3) vip2 = false vip1 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip1) removeEventHandler("onClientRender", getRootElement(), dxPainelVip2) end end if vip2 == true and vip3 == false and button == "left" and state == "down" then if cursorPosition(x*630, y*247, x*104, y*25) then playSoundFrontEnd(3) vip3 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip3) end end if vip1 and button == "left" and state == "down" then if cursorPosition(x*465, y*328, x*180, y*26) then triggerServerEvent("skinVip1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*358, x*180, y*26) then triggerServerEvent("skinVip2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*328, x*180, y*26) then triggerServerEvent("vidacolete", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*421, x*180, y*26) then triggerServerEvent("kitarmas1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*451, x*180, y*26) then triggerServerEvent("kitarmas2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*481, x*180, y*26) then triggerServerEvent("habilidades", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*388, x*84, y*26) then triggerServerEvent("jetpack1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*388, x*84, y*26) then triggerServerEvent("jetpack2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*451, x*84, y*26) then triggerServerEvent("invisivel1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*574, x*84, y*26) then triggerServerEvent("andar1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*574, x*84, y*26) then triggerServerEvent("andar2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*604, x*180, y*26) then triggerServerEvent("andar3", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*513, x*84, y*26) then triggerServerEvent("spon", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*513, x*84, y*26) then triggerServerEvent("spoff", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*451, x*84, y*26) then triggerServerEvent("invisivel2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*544, x*180, y*26) then triggerServerEvent("velocidade1", getLocalPlayer()) setGameSpeed(0.5) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*574, x*180, y*26) then triggerServerEvent("velocidade2", getLocalPlayer()) setGameSpeed(5) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*604, x*180, y*26) then triggerServerEvent("velocidade3", getLocalPlayer()) setGameSpeed(1) playSoundFrontEnd(1) end end if vip2 and button == "left" and state == "down" then if cursorPosition(x*465, y*358, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("carro", getLocalPlayer()) elseif cursorPosition(x*465, y*328, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("moto", getLocalPlayer()) elseif cursorPosition(x*465, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("agua1", getLocalPlayer()) elseif cursorPosition(x*561, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("agua2", getLocalPlayer()) elseif cursorPosition(x*720, y*512, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("jump1", getLocalPlayer()) elseif cursorPosition(x*720, y*542, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("jump2", getLocalPlayer()) elseif cursorPosition(x*720, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("fly1", getLocalPlayer()) elseif cursorPosition(x*816, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("fly2", getLocalPlayer()) elseif cursorPosition(x*465, y*421, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("proVeiculo1", getLocalPlayer()) elseif cursorPosition(x*465, y*451, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("proVeiculo2", getLocalPlayer()) elseif cursorPosition(x*465, y*512, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("veiculoInvisivel1", getLocalPlayer()) elseif cursorPosition(x*465, y*542, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("veiculoInvisivel2", getLocalPlayer()) elseif cursorPosition(x*720, y*328, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowEnabled", true) servermessages("Rainbow car ativado", "confirm") elseif cursorPosition(x*720, y*358, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowEnabled", false) servermessages("Rainbow car desativado", "warning") elseif cursorPosition(x*720, y*421, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowHeadlights", true) servermessages("Rainbow luzes ativado", "confirm") elseif cursorPosition(x*720, y*451, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowHeadlights", false) servermessages("Rainbow luzes desativado", "warning") end end end addEventHandler("onClientClick", getRootElement(), clickVip1) function abrirVip() if vip1 == false then if not fontScale then fontScale = screenW/40 end showCursor(true) vip1 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip1) else showCursor(false) vip1 = false vip2 = false vip3 = false removeEventHandler("onClientRender", getRootElement(), dxPainelVip1) removeEventHandler("onClientRender", getRootElement(), dxPainelVip2) removeEventHandler("onClientRender", getRootElement(), dxPainelVip3) end end addEvent("abrirVip", true) addEventHandler("abrirVip", getRootElement(), abrirVip) function fecharVip() if (vip1 and vip2 == true) then removeEventHandler("onClientRender", getRootElement(), dxPainelVip1) removeEventHandler("onClientRender", getRootElement(), dxPainelVip2) removeEventHandler("onClientRender", getRootElement(), dxPainelVip3) showCursor(false) vip1 = false vip2 = false vip3 = false end end bindKey("O", "down", fecharVip) addEvent("abrirVip", true) addEventHandler("abrirVip", getRootElement(), fecharVip) function cursorPosition(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local fullx, fully = guiGetScreenSize() cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end -- //#FPS local counter = 0 local starttick local currenttick addEventHandler("onClientRender", getRootElement(), function() if not starttick then starttick = getTickCount() end counter = counter + 1 currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(getLocalPlayer(), "FPS", counter) counter = 0 starttick = false end end ) -- //#Texto Cor function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or Font_5 if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local clip = false if dxGetTextWidth(str:gsub("#%x%x%x%x%x%x","")) > bx then clip = true end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 local text = "" local broke = false while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) if clip then local text_ = "" for i = 1,string.len(cap) do if dxGetTextWidth(text,scale,font) < bx then text = text..""..string.sub(cap,i,i) text_ = text_..""..string.sub(cap,i,i) else broke = true break end end cap = text_ end dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str and not broke then cap = str:sub(last) if clip then local text_ = "" for i = 1,string.len(cap) do if dxGetTextWidth(text,scale,font) < bx then text = text..""..string.sub(cap,i,i) text_ = text_..""..string.sub(cap,i,i) else broke = true break end end cap = text_ end dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font) end end -- //#Dirigir Sobre Água function aguaTrue() setWorldSpecialPropertyEnabled("hovercars", true) end addEvent("aguaTrue", true) addEventHandler("aguaTrue", getRootElement(), aguaTrue) function aguaFalse() setWorldSpecialPropertyEnabled("hovercars", false) end addEvent("aguaFalse", true) addEventHandler("aguaFalse", getRootElement(), aguaFalse) -- //#Fly Car function flyTrue() setWorldSpecialPropertyEnabled("aircars", true) end addEvent("flyTrue", true) addEventHandler("flyTrue", getRootElement(), flyTrue) function flyFalse() setWorldSpecialPropertyEnabled("aircars", false) end addEvent("flyFalse", true) addEventHandler("flyFalse", getRootElement(), flyFalse) -- //#Laser [Vip] local dots = {} CMD_LASERCOLOR = "laser" laserWidth = 0.5 dotSize = .05 picklasercolor = 0 colorPickerInitialized = 0 color = {r=255, g=0, b=0, a=255} function onClientStartLaser(res) if res == getThisResource() then setLaserEnabled(getLocalPlayer(), false) setLaserColor(getLocalPlayer(), color.r, color.g, color.b, color.a) if colorPickerInitialized == 0 then initColorPicker() end elseif res == getResourceFromName("colorpicker") then if colorPickerInitialized == 0 then initColorPicker() end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onClientStartLaser) function onClientStopLaser(res) if res == getThisResource() then setLaserEnabled(getLocalPlayer(), false) end end addEventHandler("onClientResourceStop", getRootElement(), onClientStopLaser) function onElementDataChange(dataName, oldValue) if getElementType(source) == "player" and source == getLocalPlayer() and dataName == "laser.on" then local newValue = getElementData(source, dataName) if oldValue == true and newValue == false then unbindKey("aim_weapon", "both", aimKeyPressed) elseif oldValue == false and newValue == true then bindKey("aim_weapon", "both", aimKeyPressed) end end end addEventHandler("onClientElementDataChange", getLocalPlayer(), onElementDataChange) function renderLaser() for _, player in ipairs(getElementsByType("player")) do if getElementData(player, "laser.on") then drawLaser(player) end end end addEventHandler("onClientRender", getRootElement(), renderLaser) function aimKeyPressed(key, state) if state == "down" then setElementData(getLocalPlayer(), "laser.aim", true, true) elseif state == "up" then setElementData(getLocalPlayer(), "laser.aim", false, true) end end function drawLaser(player) if getElementData(player, "laser.on") then local targetself = getPedTarget(player) if targetself and targetself == player then targetself = true else targetself = false end if getElementData(player, "laser.aim") and isPlayerWeaponValidForLaser(player) == true and targetself == false then local x, y, z = getPedWeaponMuzzlePosition(player) if not x then outputDebugString("getPedWeaponMuzzlePosition failed") x, y, z = getPedTargetStart(player) end local x2, y2, z2 = getPedTargetEnd(player) if not x2 then return end local x3, y3, z3 = getPedTargetCollision(player) local r, g, b, a = getLaserColor(player) if x3 then dxDrawLine3D(x, y, z, x3, y3, z3, tocolor(r, g, b, a), laserWidth) drawLaserDot(player, x3, y3, z3) else dxDrawLine3D(x, y, z, x2, y2, z2, tocolor(r, g, b, a), laserWidth) destroyLaserDot(player) end else destroyLaserDot(player) end else destroyLaserDot(player) end end function drawLaserDot(player, x, y, z) if not dots[player] then dots[player] = createMarker(x, y, z, "corona", .02, getLaserColor(player)) else setElementPosition(dots[player], x, y, z) end end function destroyLaserDot(player) if dots[player] and isElement(dots[player]) then destroyElement(dots[player]) dots[player] = nil end end function setLaserColor(player, r, g, b, a) setElementData(player, "laser.red", r) setElementData(player, "laser.green", g) setElementData(player, "laser.blue", b) setElementData(player, "laser.alpha", a) return true end function getLaserColor(player) r = getElementData(player, "laser.red") g = getElementData(player, "laser.green") b = getElementData(player, "laser.blue") a = getElementData(player, "laser.alpha") return r, g, b, a end function isPlayerWeaponValidForLaser(player) local weapon = getPedWeapon(player) if weapon and weapon > 21 and weapon < 39 and weapon ~= 35 and weapon ~= 36 then return true end return false end function setLaserEnabled(player, state) if not player or isElement(player) == false then return false end if getElementType(player) ~= "player" then return false end if state == nil then return false end if state == true then setElementData(player, "laser.on", true, true) setElementData(player, "laser.aim", false, true) return true elseif state == false then setElementData(player, "laser.on", false, true) setElementData(player, "laser.aim", false, true) return true end return false end function isLaserEnabled(player) if getElementData(player, "laser.on") == true then return true else return false end end function toggleLaserEnabled(cmd) if isLaserEnabled(getLocalPlayer()) == false then setLaserEnabled(getLocalPlayer(), true) end end addEvent("toggleLaserEnabled", true) addEventHandler("toggleLaserEnabled", getRootElement(), toggleLaserEnabled) function toggleLaserDisabled(cmd) if isLaserEnabled(getLocalPlayer()) == true then setLaserEnabled(getLocalPlayer(), false) end end addEvent("toggleLaserDisabled", true) addEventHandler("toggleLaserDisabled", getRootElement(), toggleLaserDisabled) function changeLaserColor(cmd, r, g, b, a) local getVip = getElementData(getLocalPlayer(), "vip:expire") if getVip then if colorPickerInitialized == 1 and getResourceFromName("colorpicker") then color.r, color.g, color.b, color.a = getLaserColor(getLocalPlayer()) picklasercolor = 1 if exports.colorpicker:requestPickColor(true, true, "Escolha o Laser Color", color.r, color.g, color.b, color.a) == false then exports.colorpicker:cancelPickColor() return false end return true else if r and g and b and a then r, g, b, a = tonumber(r), tonumber(g), tonumber(b), tonumber(a) if r and g and b and a then if r < 0 or g < 0 or b < 0 or a < 0 or r > 255 or g > 255 or b > 255 or a > 255 then servermessages("sintaxe: /laser r g b a", "confirm") return false else servermessages("Cor do laser: "..r.." "..g.." "..b.." "..a.."", "confirm") setLaserColor(getLocalPlayer(), r, g, b, a) return true end end end end servermessages("sintaxe: /laser r g b a", "confirm") return false else outputChatBox("#030303[#B30A0AComandos#030303] #FFFFFFVocê não tem acesso ao comandos #00AFF0/laser", 255, 255, 255, true) end end addCommandHandler("laser", changeLaserColor) function initColorPicker() if getResourceFromName("colorpicker") == false then return false end addEventHandler("onClientPickedColor", getLocalPlayer(), function(r, g, b, a) if picklasercolor == 1 then setLaserColor(source, r, g, b, a) end end) addEventHandler("onClientCancelColorPick", getLocalPlayer(), function() if picklasercolor == 1 then setLaserColor(source, color.r, color.g, color.b, color.a) picklasercolor = 0 end end) colorPickerInitialized = 1 return true end -- //#Rainbow Car rainbow = {} function rainbowCar() for _, player in pairs(getElementsByType("player")) do if getElementData(player, "rainbowEnabled") then local vehicle = getPedOccupiedVehicle(player) if vehicle then if not rainbow[player] then rainbow[player] = 0 return end local r, g, b = getVehicleColor(vehicle, true) if rainbow[player] == 0 then if r < 250 then r = r + 3 if r > 255 then r = 250 end else rainbow[player] = 1 end end if rainbow[player] == 1 then if g < 250 then g = g + 3 else rainbow[player] = 2 end elseif rainbow[player] == 2 then if b < 255 then if r > 0 then r = r - 3 else r = 0 end b = b + 3 if b > 255 then b = 255 end else rainbow[player] = 3 end elseif rainbow[player] == 3 then if g > 0 then if r > 0 then r = r - 3 else r = 0 end g = g - 3 if g < 0 then g = 0 end else rainbow[player] = 4 end elseif rainbow[player] == 4 then if b > 0 then b = b - 3 if b < 0 then b = 0 end else b = 0 rainbow[player] = 0 end end setVehicleColor(vehicle, r, g, b) end end end end addEventHandler("onClientPreRender", getRootElement(), rainbowCar) -- //#Rainbow Luzes rainbowHeadlights = {} function rainbowLuzes() for _, player in pairs(getElementsByType("player")) do if getElementData(player, "rainbowHeadlights") then local vehicle = getPedOccupiedVehicle(player) if vehicle then if not rainbowHeadlights[player] then rainbowHeadlights[player] = 0 return end local r, g, b = getVehicleHeadLightColor(vehicle) if rainbowHeadlights[player] == 0 then if r < 250 then r = r + 3 if r > 255 then r = 250 end else rainbowHeadlights[player] = 1 end end if rainbowHeadlights[player] == 1 then if g < 250 then g = g + 3 else rainbowHeadlights[player] = 2 end elseif rainbowHeadlights[player] == 2 then if b < 255 then if r > 0 then r = r - 3 else r = 0 end b = b + 3 if b > 255 then b = 255 end else rainbowHeadlights[player] = 3 end elseif rainbowHeadlights[player] == 3 then if g > 0 then if r > 0 then r = r - 3 else r = 0 end g = g - 3 if g < 0 then g = 0 end else rainbowHeadlights[player] = 4 end elseif rainbowHeadlights[player] == 4 then if b > 0 then b = b - 3 if b < 0 then b = 0 end else b = 0 rainbowHeadlights[player] = 0 end end setVehicleHeadLightColor(vehicle, r, g, b) end end end end addEventHandler("onClientPreRender", getRootElement(), rainbowLuzes) -- //#Jump Car function jumCar() local veiculo = getPedOccupiedVehicle(getLocalPlayer()) if not veiculo then return end if (isVehicleOnGround(veiculo) == true) then local v1, v2, v3 = getElementVelocity (veiculo) setElementVelocity(veiculo, v1, v2, v3 + 0.25) end end addEvent("jumCar", true) addEventHandler("jumCar", getRootElement(), jumCar) function jumpStart() bindKey("lshift", "down", jumCar) end addEvent("jumpStart", true) addEventHandler("jumpStart", getRootElement(), jumpStart) function jumpStop() unbindKey("lshift", "down", jumCar) end addEvent("jumpStop", true) addEventHandler("jumpStop", getRootElement(), jumpStop) -- //#Mensages mensages = {} messagetick = 0 function servermessages(message, type) table.insert(mensages, {message, type or "confirm", getTickCount(), dxGetTextWidth(message, fontScale*0.06, Font_1) + screenH*0.01, 0, 0, 0}) messagetick = getTickCount() end addEvent("servermessages", true) addEventHandler("servermessages", getRootElement(), servermessages) function renderMensages() local msgd = mensages if #msgd ~= 0 then local startY = screenW*0.5 local i = 1 repeat mData = msgd[i] local drawThis = true if i~= 1 then startY = startY + screenW*0.0425 end if mData[5] == 0 and mData[6] == 0 then mData[5] = - mData[4] - screenH*0.015 mData[6] = startY mData[7] = startY end local tick = getTickCount() - mData[3] local posX, posY, alpha if tick < 1000 then local progress = math.min(tick/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, 0, 0, 0, progress, "Linear") elseif tick >= 1000 and tick <= 7000 then mData[5] = 0 elseif tick > 7000 then local progress = math.min((tick - 7000)/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, - mData[4] - mData[4] - screenH*0.015, 0, 0, progress, "Linear") if progress >= 1 then table.remove(msgd, i) drawThis = false messagetick = getTickCount() end end local globalTick = getTickCount() - messagetick if drawThis then mData[7] = startY mData[6] = interpolateBetween(mData[6], 0, 0, mData[7], 0, 0, math.min(globalTick/1000,1), "Linear") posX = mData[5] posY = mData[6] alpha = 255 dxDrawRectangle(posX, posY, mData[4], screenW*0.04, tocolor(0, 0, 0, alpha*0.75), true) local r, g, b = 0, 255, 0 if mData[2] == "warning" then r, g, b = 255, 0, 0 end dxDrawRectangle(posX + mData[4], posY, screenH*0.010, screenW*0.04, tocolor(r, g, b, alpha*0.85), true) dxDrawText(mData[1], posX, posY, posX + mData[4], posY + screenW*0.04, tocolor(255, 255, 255, alpha), fontScale*0.05, Font_1, "center", "center", false, false, true, false, false) end i = i + 1 until i > #msgd mensages = msgd end end addEventHandler("onClientRender", getRootElement(), renderMensages)
  11. Client: function winnerMessenger ( text, playerName) win.text = text win.name = playerName removeEventHandler("onClientRender",root,winMsg) addEventHandler("onClientRender",root,winMsg) triggerServerEvent("plusz1", localPlayer, getLocalPlayer) end addEvent("winnerMessage",true) addEventHandler("winnerMessage",getRootElement(),winnerMessenger) Server: function asdasd() if getPlayerRank( source ) ~= 1 then return end local gyozelmek = getElementData(source,"Győzelmek") or 0 setElementData(source, "Győzelmek", gyozelmek + 1 ) givePlayerMoney(source,2) outputChatBox("#FFffFFAmiért megnyerted a kört, kaptál #00FFFF'2' coint!",source,r,g,b,true) end addEvent("plusz1", true) addEventHandler("plusz1", root, asdasd) And when the win msg appear, the setelementdata add 1 win point, and money for everybody.. How to fix this? I want add win point and money only to the winner, not everybody...
  12. É um script que quando o player loga no servidor pela primeira vez, ele ganha a tal quantia de dinheiro! Se pudessem me ajudar ae, agradeço muito dese ja! Com deus ai pessoal.
  13. EU GOSTARIA DE TROCAR A OPÇÃO ''PERDER A CABEÇA''', PELO MODO SUPERMAN ( VOAR COM O PERSONAGEM ) QUERIA UM SUPERMAN SEM SER AQUELES BUGADOS, Q DEPOIS Q DESATIVA O PERSONAGEM FICA BUGADAO SERVER: function showPanel(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP DIAMANTE")) then triggerClientEvent(thePlayer, "abrirVip", getRootElement()) end end function onResStart() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "o", "down", showPanel) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStart) function onPlayerJoin() bindKey(source, "o", "down", showPanel) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin) function cleanAll(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "o", "down", showPanel) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAll) function skinVip1() setElementModel(source, 0) displayServerMessage(source, "Você Pegou Skin VIP", "confirm") end addEvent("skinVip1", true) addEventHandler("skinVip1", getRootElement(), skinVip1) function skinVip2() setElementModel(source, 123) displayServerMessage(source, "Você Pegou Skin VIP 2", "confirm") end addEvent("skinVip2", true) addEventHandler("skinVip2", getRootElement(), skinVip2) function vidacolete() setPedStat(source, 24, 999) setElementHealth(source, 200) setPedArmor(source, 100) displayServerMessage(source, "Vida 200% e Colete completo", "confirm") end addEvent("vidacolete", true) addEventHandler("vidacolete", getRootElement(), vidacolete) function kitarmas1() giveWeapon(source, 1, 2000) giveWeapon(source, 2, 2000) giveWeapon(source, 10, 2000) giveWeapon(source, 23, 2000) giveWeapon(source, 26, 2000) giveWeapon(source, 28, 2000) giveWeapon(source, 31, 2000) giveWeapon(source, 34, 2000) giveWeapon(source, 37, 2000) giveWeapon(source, 39, 2000) giveWeapon(source, 43, 2000) giveWeapon(source, 46, 2000) displayServerMessage(source, "Você Pegou Kit Armas 1", "confirm") end addEvent("kitarmas1", true) addEventHandler("kitarmas1", getRootElement(), kitarmas1) function kitarmas2() giveWeapon(source, 1, 2000) giveWeapon(source, 6, 2000) giveWeapon(source, 10, 2000) giveWeapon(source, 22, 2000) giveWeapon(source, 25, 2000) giveWeapon(source, 29, 2000) giveWeapon(source, 31, 2000) giveWeapon(source, 34, 2000) giveWeapon(source, 37, 2000) giveWeapon(source, 39, 2000) giveWeapon(source, 43, 2000) giveWeapon(source, 46, 2000) displayServerMessage(source, "Você Pegou Kit Armas 2", "confirm") end addEvent("kitarmas2", true) addEventHandler("kitarmas2", getRootElement(), kitarmas2) function habilidades() setPedStat(source, 69, 1000) setPedStat(source, 70, 1000) setPedStat(source, 71, 1000) setPedStat(source, 72, 1000) setPedStat(source, 73, 1000) setPedStat(source, 74, 1000) setPedStat(source, 75, 1000) setPedStat(source, 76, 1000) setPedStat(source, 77, 1000) setPedStat(source, 78, 1000) setPedStat(source, 79, 1000) displayServerMessage(source, "Você Pegou Todas Habilidades", "confirm") end addEvent("habilidades", true) addEventHandler("habilidades", getRootElement(), habilidades) function jetpack1() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia do Veiculo Primeiro", "warning") return end givePedJetPack(source) displayServerMessage(source, "Jetpack Ativado", "confirm") end addEvent("jetpack1", true) addEventHandler("jetpack1", getRootElement(), jetpack1) function jetpack2() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia do Veiculo Primeiro", "warning") return end removePedJetPack(source) displayServerMessage(source, "Jetpack Desativado", "warning") end addEvent("jetpack2", true) addEventHandler("jetpack2", getRootElement(), jetpack2) function invisivel1() if getElementAlpha(source) == 255 then setElementAlpha(source, 0) setPlayerNametagShowing(source, false) displayServerMessage(source, "Skin Invisivel Ativado", "confirm") end end addEvent("invisivel1", true) addEventHandler("invisivel1", getRootElement(), invisivel1) function invisivel2() if getElementAlpha(source) == 0 then setElementAlpha(source, 255) setPlayerNametagShowing(source, true) displayServerMessage(source, "Skin Invisivel Desativado", "warning") end end addEvent("invisivel2", true) addEventHandler("invisivel2", getRootElement(), invisivel2) function velocidade1() displayServerMessage(source, "Sua Velocidade Esta Lenta", "confirm") end addEvent("velocidade1", true) addEventHandler("velocidade1", getRootElement(), velocidade1) function velocidade2() displayServerMessage(source, "Sua Velocidade Esta Rapida", "confirm") end addEvent("velocidade2", true) addEventHandler("velocidade2", getRootElement(), velocidade2) function velocidade3() displayServerMessage(source, "Sua Velocidade Esta Normal", "confirm") end addEvent("velocidade3", true) addEventHandler("velocidade3", getRootElement(), velocidade3) function proVeiculo1() if isPedInVehicle(source) then if isVehicleDamageProof(getPedOccupiedVehicle(source)) == false then setVehicleDamageProof(getPedOccupiedVehicle(source), true) displayServerMessage(source, "Proteção Veiculo Ativado", "confirm") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("proVeiculo1", true) addEventHandler("proVeiculo1", getRootElement(), proVeiculo1) function proVeiculo2() if isPedInVehicle(source) then if isVehicleDamageProof(getPedOccupiedVehicle(source)) == true then setVehicleDamageProof(getPedOccupiedVehicle(source), false) displayServerMessage(source, "Proteção Veiculo Desativado", "warning") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("proVeiculo2", true) addEventHandler("proVeiculo2", getRootElement(), proVeiculo2) function veiculoInvisivel1() if isPedInVehicle(source) then if getElementAlpha(getPedOccupiedVehicle(source)) == 255 then setElementAlpha(getPedOccupiedVehicle(source), 0) displayServerMessage(source, "Veiculo Invisivel Ativado", "confirm") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("veiculoInvisivel1", true) addEventHandler("veiculoInvisivel1", getRootElement(), veiculoInvisivel1) function veiculoInvisivel2() if isPedInVehicle(source) then if getElementAlpha(getPedOccupiedVehicle(source)) == 0 then setElementAlpha(getPedOccupiedVehicle(source), 255) displayServerMessage(source, "Veiculo Invisivel Desativado", "warning") end else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("veiculoInvisivel2", true) addEventHandler("veiculoInvisivel2", getRootElement(), veiculoInvisivel2) function agua1() if isPedInVehicle(source) then triggerClientEvent(source, "aguaTrue", getRootElement()) displayServerMessage(source, "Dirigir Sobre Água Ativado", "confirm") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("agua1", true) addEventHandler("agua1", getRootElement(), agua1) function agua2() if isPedInVehicle(source) then triggerClientEvent(source, "aguaFalse", getRootElement()) displayServerMessage(source, "Dirigir Sobre Água Desativado", "warning") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("agua2", true) addEventHandler("agua2", getRootElement(), agua2) function fly1() if isPedInVehicle(source) then triggerClientEvent(source, "flyTrue", getRootElement()) displayServerMessage(source, "Voar Com o Carro Ativado", "confirm") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("fly1", true) addEventHandler("fly1", getRootElement(), fly1) function fly2() if isPedInVehicle(source) then triggerClientEvent(source, "flyFalse", getRootElement()) displayServerMessage(source, "Voar Com o Carro Desativado", "warning") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("fly2", true) addEventHandler("fly2", getRootElement(), fly2) function cabeca1() setPedHeadless(source, true) displayServerMessage(source, "Você Tirou Sua Cabeça", "confirm") end addEvent("cabeca1", true) addEventHandler("cabeca1", getRootElement(), cabeca1) function cabeca2() setPedHeadless(source, false) displayServerMessage(source, "Você Colocou Sua Cabeça", "warning") end addEvent("cabeca2", true) addEventHandler("cabeca2", getRootElement(), cabeca2) function andar1() setPedWalkingStyle(source, 126) displayServerMessage(source, "Estilo Andar 1 Ativado", "confirm") end addEvent("andar1", true) addEventHandler("andar1", getRootElement(), andar1) function andar2() setPedWalkingStyle(source, 122) displayServerMessage(source, "Estilo Andar 2 Ativado", "confirm") end addEvent("andar2", true) addEventHandler("andar2", getRootElement(), andar2) function andar3() setPedWalkingStyle(source, 0) displayServerMessage(source, "Estilo Andar Desativado", "warning") end addEvent("andar3", true) addEventHandler("andar3", getRootElement(), andar3) function jump1() if isPedInVehicle(source) then triggerClientEvent(source, "jumpStart", getRootElement()) displayServerMessage(source, "Pular Com o Veiculo Ativado", "confirm") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("jump1", true) addEventHandler("jump1", getRootElement(), jump1) function jump2() if isPedInVehicle(source) then triggerClientEvent(source, "jumpStop", getRootElement()) displayServerMessage(source, "Pular Com o Veiculo Desativado", "warning") else displayServerMessage(source, "Você Deve Estar Em Um Veiculo Para Definir Isto", "warning") end end addEvent("jump2", true) addEventHandler("jump2", getRootElement(), jump2) veiculo = {} function carro() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia Do Veiculo Primeiro", "warning") return end if veiculo[source] and isElement(veiculo[source]) then destroyElement(veiculo[source]) end local x, y, z = getElementPosition(source) veiculo[source] = createVehicle(411, x, y, z) warpPedIntoVehicle(source, veiculo[source]) displayServerMessage(source, "Você Pegou Carro VIP", "confirm") end addEvent("carro", true) addEventHandler("carro", getRootElement(), carro) veiculo = {} function moto() if getPedOccupiedVehicle(source) then displayServerMessage(source, "Saia Do Veiculo Primeiro", "warning") return end if veiculo[source] and isElement(veiculo[source]) then destroyElement(veiculo[source]) end local x, y, z = getElementPosition(source) veiculo[source] = createVehicle(522, x, y, z) warpPedIntoVehicle(source, veiculo[source]) displayServerMessage(source, "Você Pegou Moto Vip", "confirm") end addEvent("moto", true) addEventHandler("moto", getRootElement(), moto) -- //#Mensages function displayServerMessage(source, message, type) triggerClientEvent(source, "servermessages", getRootElement(), message, type) end -- //#Status addEvent("callServerAccountName", true) addEventHandler("callServerAccountName", root, function (thePlayer) if thePlayer then local account = getPlayerAccount(thePlayer) if account then if isGuestAccount(account) then setElementData(thePlayer,"account-name", "Não logado") else local accountName = getAccountName(account) setElementData(thePlayer, "account-name", accountName) end end end end ) addEventHandler("onPlayerLogin", root, function() local accountName = getAccountName(getPlayerAccount(source)) setElementData(source, "account-name", accountName) end ) addEventHandler("onPlayerLogout", root, function() setElementData(source, "account-name", "Não logado") end ) function Events() if eventName == "onResourceStart" then for k,v in ipairs(getElementsByType("player")) do setElementData(v, "IP", getPlayerIP(v)) end elseif eventName == "onPlayerJoin" then setElementData(source, "IP", getPlayerIP(source)) end end addEventHandler("onResourceStart", resourceRoot, Events) addEventHandler("onPlayerJoin", root, Events) addEvent("online", true) addEventHandler("online", getRootElement(), function() setElementData(source,"maxPlayers",getMaxPlayers(source)) setElementData(source,"numPlayers",getPlayerCount(source)) end) CLIENT: local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) local Font_1 = dxCreateFont("font/font.ttf", 14) local Font_2 = dxCreateFont("font/font.ttf", 9) local Font_3 = dxCreateFont("font/font.ttf", 13) local Font_4 = dxCreateFont("font/font.ttf", 14) local Font_5 = dxCreateFont("font/font.ttf", 11) local movertexto = 0 cor = {} vip1 = false function dxPainelVip1() dxDrawRectangle(x*423, y*184, x*520, y*500, tocolor(0, 0, 0, 111), false) dxDrawRectangle(x*425, y*186, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("VIP DIAMANTE", x*425, y*186, x*941, y*221, tocolor(255, 255, 255, 255), x*1.00, Font_1, "center", "center", false, false, false, false, false) local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 10 dxDrawImage(x*486, y*186, x*192, y*138, "img/jogador.png", angle, 0, -40, tocolor(255, 255, 255, 255), false) dxDrawImage(x*685, y*186, x*192, y*138, "img/veiculo.png", angle, 0, -40, tocolor(255, 255, 255, 255), false) cor[1] = tocolor(0, 0, 0, 111) cor[2] = tocolor(0, 0, 0, 111) if cursorPosition(x*820, y*247, x*104, y*25) then cor[1] = tocolor(0, 111, 255, 255) end if cursorPosition(x*443, y*247, x*104, y*25) then cor[2] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*820, y*247, x*104, y*25, cor[1], false) dxDrawRectangle(x*443, y*247, x*104, y*25, cor[2], false) dxDrawText("Veiculo", x*820, y*247, x*924, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawText("Jogador", x*443, y*247, x*547, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawLine(x*427, y*223, x*936, y*223, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*289, x*937, y*289, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*644, x*937, y*644, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*681, y*298, x*681, y*634, tocolor(255, 255, 255, 255), x*1, false) movertexto = movertexto + 0.999*3 local movertexto1, movertexto2 = interpolateBetween (x*430, y*653, 0, x*630, y*653, 0, movertexto, "SineCurve") dxDrawRectangle(x*425, y*647, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("Brasil Vida de Playboy", movertexto1, movertexto2, x, y, tocolor(255, 255, 255, 255), x*1.00, Font_3, "left", "top", false, false, false, false, false) cor[3] = tocolor(0, 0, 0, 111) cor[4] = tocolor(0, 0, 0, 111) cor[5] = tocolor(0, 0, 0, 111) cor[6] = tocolor(0, 0, 0, 111) cor[7] = tocolor(0, 0, 0, 111) cor[8] = tocolor(0, 0, 0, 111) cor[9] = tocolor(0, 0, 0, 111) cor[10] = tocolor(0, 0, 0, 111) cor[11] = tocolor(0, 0, 0, 111) cor[12] = tocolor(0, 0, 0, 111) cor[13] = tocolor(0, 0, 0, 111) cor[14] = tocolor(0, 0, 0, 111) cor[15] = tocolor(0, 0, 0, 111) cor[16] = tocolor(0, 0, 0, 111) cor[17] = tocolor(0, 0, 0, 111) cor[18] = tocolor(0, 0, 0, 111) cor[19] = tocolor(0, 0, 0, 111) cor[20] = tocolor(0, 0, 0, 111) if cursorPosition(x*465, y*328, x*180, y*26) then cor[3] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*358, x*180, y*26) then cor[4] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*421, x*180, y*26) then cor[5] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*451, x*180, y*26) then cor[6] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*482, x*180, y*26) then cor[7] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*328, x*180, y*26) then cor[8] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*388, x*84, y*26) then cor[9] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*388, x*84, y*26) then cor[10] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*544, x*180, y*26) then cor[11] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*574, x*180, y*26) then cor[12] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*604, x*180, y*26) then cor[13] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*451, x*84, y*26) then cor[14] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*451, x*84, y*26) then cor[15] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*513, x*84, y*26) then cor[16] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*513, x*84, y*26) then cor[17] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*574, x*84, y*26) then cor[18] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*574, x*84, y*26) then cor[19] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*604, x*180, y*26) then cor[20] = tocolor(0, 111, 255, 255) end dxDrawText("Skins", x*465, y*303, x*645, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*328, x*180, y*26, cor[3], false) dxDrawRectangle(x*465, y*358, x*180, y*26, cor[4], false) dxDrawText("Skin VIP 1", x*465, y*328, x*645, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Skin VIP 2", x*465, y*358, x*645, y*384, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Armas", x*465, y*394, x*645, y*417, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*421, x*180, y*26, cor[5], false) dxDrawRectangle(x*465, y*451, x*180, y*26, cor[6], false) dxDrawRectangle(x*465, y*482, x*180, y*26, cor[7], false) dxDrawText("Kit 1", x*465, y*421, x*645, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Kit 2", x*465, y*451, x*645, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Habilidade", x*465, y*482, x*645, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Vida Colete", x*720, y*303, x*900, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*328, x*180, y*26, cor[8], false) dxDrawText("Vida Colete", x*720, y*328, x*900, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Jet Pack", x*720, y*364, x*900, y*385, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*388, x*84, y*26, cor[9], false) dxDrawRectangle(x*816, y*388, x*84, y*26, cor[10], false) dxDrawText("Pegar", x*720, y*388, x*804, y*414, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Tirar", x*816, y*388, x*900, y*414, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Velocidade do Jogo", x*465, y*518, x*645, y*539, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*544, x*180, y*26, cor[11], false) dxDrawRectangle(x*465, y*574, x*180, y*26, cor[12], false) dxDrawRectangle(x*465, y*604, x*180, y*26, cor[13], false) dxDrawText("Lento", x*465, y*544, x*645, y*570, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Rapido 3x", x*465, y*574, x*645, y*600, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Normal", x*465, y*604, x*645, y*630, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Invisibilidade", x*720, y*426, x*900, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*451, x*84, y*26, cor[14], false) dxDrawRectangle(x*816, y*451, x*84, y*26, cor[15], false) dxDrawText("Ativar", x*720, y*451, x*804, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*816, y*451, x*900, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Perder Cabeça", x*720, y*487, x*900, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*513, x*84, y*26, cor[16], false) dxDrawRectangle(x*816, y*513, x*84, y*26, cor[17], false) dxDrawText("Tirar", x*720, y*513, x*804, y*539, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Colocar", x*816, y*513, x*900, y*539, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Estilo De Andar", x*720, y*549, x*900, y*570, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*574, x*84, y*26, cor[18], false) dxDrawRectangle(x*816, y*574, x*84, y*26, cor[19], false) dxDrawRectangle(x*720, y*604, x*180, y*26, cor[20], false) dxDrawText("Stylo 1", x*720, y*574, x*804, y*600, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Stylo 2", x*816, y*574, x*900, y*600, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Andar Normal", x*720, y*604, x*900, y*630, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) cor[19] = tocolor(0, 0, 0, 111) if cursorPosition(x*630, y*247, x*104, y*25) then cor[19] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*630, y*247, x*104, y*25, cor[19], false) dxDrawText("Status", x*630, y*247, x*734, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) end vip2 = false function dxPainelVip2() dxDrawRectangle(x*423, y*184, x*520, y*500, tocolor(0, 0, 0, 111), false) dxDrawRectangle(x*425, y*186, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("VIP DIAMANTE", x*425, y*186, x*941, y*221, tocolor(255, 255, 255, 255), x*1.00, Font_1, "center", "center", false, false, false, false, false) local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 10 dxDrawImage(x*486, y*186, x*192, y*138, "img/jogador.png", angle, 0, -30 , tocolor(255, 255, 255, 255), false) dxDrawImage(x*685, y*186, x*192, y*138, "img/veiculo.png", angle, 0, -30 , tocolor(255, 255, 255, 255), false) cor[1] = tocolor(0, 0, 0, 111) cor[2] = tocolor(0, 0, 0, 111) if cursorPosition(x*820, y*247, x*104, y*25) then cor[1] = tocolor(0, 111, 255, 255) end if cursorPosition(x*443, y*247, x*104, y*25) then cor[2] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*820, y*247, x*104, y*25, cor[1], false) dxDrawRectangle(x*443, y*247, x*104, y*25, cor[2], false) dxDrawText("Veiculo", x*820, y*247, x*924, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawText("Jogador", x*443, y*247, x*547, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) dxDrawLine(x*427, y*223, x*936, y*223, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*289, x*937, y*289, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*644, x*937, y*644, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*681, y*298, x*681, y*634, tocolor(255, 255, 255, 255), x*1, false) movertexto = movertexto + 0.999*3 local movertexto1, movertexto2 = interpolateBetween (x*430, y*653, 0, x*630, y*653, 0, movertexto, "SineCurve") dxDrawRectangle(x*425, y*647, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("Brasil Vida de Playboy", movertexto1, movertexto2, x, y, tocolor(255, 255, 255, 255), x*1.00, Font_3, "left", "top", false, false, false, false, false) cor[3] = tocolor(0, 0, 0, 111) cor[4] = tocolor(0, 0, 0, 111) cor[5] = tocolor(0, 0, 0, 111) cor[6] = tocolor(0, 0, 0, 111) cor[7] = tocolor(0, 0, 0, 111) cor[8] = tocolor(0, 0, 0, 111) cor[9] = tocolor(0, 0, 0, 111) cor[10] = tocolor(0, 0, 0, 111) cor[11] = tocolor(0, 0, 0, 111) cor[12] = tocolor(0, 0, 0, 111) cor[13] = tocolor(0, 0, 0, 111) cor[14] = tocolor(0, 0, 0, 111) cor[15] = tocolor(0, 0, 0, 111) cor[16] = tocolor(0, 0, 0, 111) cor[17] = tocolor(0, 0, 0, 111) cor[18] = tocolor(0, 0, 0, 111) if cursorPosition(x*465, y*328, x*180, y*26) then cor[3] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*358, x*180, y*26) then cor[4] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*421, x*180, y*26) then cor[5] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*451, x*180, y*26) then cor[6] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*328, x*180, y*26) then cor[7] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*358, x*180, y*26) then cor[8] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*512, x*180, y*26) then cor[9] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*542, x*180, y*26) then cor[10] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*421, x*180, y*26) then cor[11] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*451, x*180, y*26) then cor[12] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*512, x*180, y*26) then cor[13] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*542, x*180, y*26) then cor[14] = tocolor(0, 111, 255, 255) end if cursorPosition(x*465, y*602, x*84, y*26) then cor[15] = tocolor(0, 111, 255, 255) end if cursorPosition(x*561, y*602, x*84, y*26) then cor[16] = tocolor(0, 111, 255, 255) end if cursorPosition(x*720, y*602, x*84, y*26) then cor[17] = tocolor(0, 111, 255, 255) end if cursorPosition(x*816, y*602, x*84, y*26) then cor[18] = tocolor(0, 111, 255, 255) end dxDrawText("Veiculos", x*465, y*303, x*645, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*328, x*180, y*26, cor[3], false) dxDrawRectangle(x*465, y*358, x*180, y*26, cor[4], false) dxDrawText("Moto", x*465, y*328, x*645, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Carro", x*465, y*358, x*645, y*384, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Indestrutivel", x*465, y*394, x*645, y*417, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*421, x*180, y*26, cor[5], false) dxDrawRectangle(x*465, y*451, x*180, y*26, cor[6], false) dxDrawText("Ativar", x*465, y*421, x*645, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*465, y*451, x*645, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Colorido 'Rainbow'", x*720, y*303, x*900, y*324, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*328, x*180, y*26, cor[7], false) dxDrawRectangle(x*720, y*358, x*180, y*26, cor[8], false) dxDrawText("Ativar", x*720, y*328, x*900, y*354, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*720, y*358, x*900, y*384, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Invisivel", x*465, y*487, x*645, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*512, x*180, y*26, cor[9], false) dxDrawRectangle(x*465, y*542, x*180, y*26, cor[10], false) dxDrawText("Ativar", x*465, y*512, x*645, y*538, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*465, y*542, x*645, y*568, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Farol Colorido 'Rainbow'", x*720, y*394, x*900, y*415, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*421, x*180, y*26, cor[11], false) dxDrawRectangle(x*720, y*451, x*180, y*26, cor[12], false) dxDrawText("Ativar", x*720, y*421, x*900, y*447, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*720, y*451, x*900, y*477, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Pular 'Jum Car'", x*720, y*487, x*900, y*508, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*512, x*180, y*26, cor[13], false) dxDrawRectangle(x*720, y*542, x*180, y*26, cor[14], false) dxDrawText("Ativar", x*720, y*513, x*900, y*538, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*720, y*543, x*900, y*568, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Andar Na Agua", x*465, y*578, x*645, y*599, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*465, y*602, x*84, y*26, cor[15], false) dxDrawRectangle(x*561, y*602, x*84, y*26, cor[16], false) dxDrawText("Ativar", x*465, y*602, x*549, y*627, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*561, y*602, x*645, y*627, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Voar", x*720, y*578, x*900, y*599, tocolor(255, 255, 255, 255), x*1.00, Font_4, "center", "center", false, false, false, false, false) dxDrawRectangle(x*720, y*602, x*84, y*26, cor[17], false) dxDrawRectangle(x*816, y*602, x*84, y*26, cor[18], false) dxDrawText("Ativar", x*720, y*602, x*804, y*627, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) dxDrawText("Desativar", x*816, y*603, x*900, y*628, tocolor(255, 255, 255, 255), x*1.00, Font_5, "center", "center", false, false, false, false, false) cor[19] = tocolor(0, 0, 0, 111) if cursorPosition(x*630, y*247, x*104, y*25) then cor[19] = tocolor(0, 111, 255, 255) end dxDrawRectangle(x*630, y*247, x*104, y*25, cor[19], false) dxDrawText("Status", x*630, y*247, x*734, y*272, tocolor(255, 255, 255, 255), x*1.00, Font_2, "center", "center", false, false, false, false, false) end vip3 = false function dxPainelVip3() setTimer(function() triggerServerEvent("online",getLocalPlayer()) end, 100, 1, true) local nome = getPlayerName(getLocalPlayer()) local vida = math.floor(getElementHealth(getLocalPlayer())) local colete = math.floor(getPedArmor(getLocalPlayer())) local oxigenio = math.floor(getPedOxygenLevel(getLocalPlayer())) local ip = getElementData(getLocalPlayer(), "IP") local ping = getPlayerPing (getLocalPlayer()) local skin = getElementModel (getLocalPlayer()) local weaponAmmo = getPedTotalAmmo (getLocalPlayer()) local weaponID = getPedWeapon(getLocalPlayer()) local weaponName = getWeaponNameFromID(weaponID) local time = getRealTime() local hours = time.hour local minutes = time.minute local seconds = time.second if (hours >= 0 and hours < 10) then hours = "0"..time.hour end if (minutes >= 0 and minutes < 10) then minutes = "0"..time.minute end if (seconds >= 0 and seconds < 10) then seconds = "0"..time.second end local meses = {"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"} local dias = {"Domingo", "Segunda-Feira", "Terça-Feira", "Quarta-Feira", "Quinta-Feira", "Sexta-Feira", "Sabado"} local dia = ("%02d"):format(time.monthday) local ano = ("%02d"):format(time.year + 1900) local diaa = dias[time.weekday + 1] local mes = meses[time.month + 1] local num = getElementData (getLocalPlayer(), "numPlayers") local max = getElementData (getLocalPlayer(), "maxPlayers") dxDrawRectangle(x*423, y*32, x*520, y*144, tocolor(0, 0, 0, 111), false) dxDrawRectangle(x*425, y*34, x*516, y*35, tocolor(0, 111, 255, 255), false) dxDrawText("Status", x*425, y*34, x*941, y*69, tocolor(255, 255, 255, 255), x*1.00, Font_1, "center", "center", false, false, false, false, false) dxDrawLine(x*427, y*69, x*937, y*69, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*427, y*169, x*937, y*169, tocolor(255, 255, 255, 255), x*1, false) dxDrawLine(x*681, y*75, x*681, y*165, tocolor(255, 255, 255, 255), x*1, false) dxDrawColorText("Nome: "..nome, x*440, y*79, x*655, y*93, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Conta: #006FFF"..tostring(getElementData(getLocalPlayer(), "account-name")), x*440, y*93, x*655, y*107, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Vida: #006FFF"..vida.."#FFFFFF% | Colete: #006FFF"..colete.."#FFFFFF% | Oxigenio: #006FFF"..oxigenio.."#FFFFFF%", x*440, y*107, x*655, y*121, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Ip: #006FFF"..(ip or "N/A"), x*440, y*121, x*655, y*135, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) if getElementData(getLocalPlayer(),"FPS") then playerFPS = getElementData(getLocalPlayer(),"FPS") else playerFPS = 0 end dxDrawColorText("PING: #006FFF"..ping.." #FFFFFF|#FFFFFF FPS: #006FFF"..playerFPS, x*440, y*135, x*655, y*149, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Skin: #006FFF"..skin, x*440, y*149, x*655, y*163, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Arma: #006FFF"..weaponName.." #FFFFFF(#FFFFFFId: #006FFF"..weaponID.."#FFFFFF) (#FFFFFFMunicao: #006FFF"..weaponAmmo.."#FFFFFF)", x*695, y*79, x*910, y*93, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Hora: #006FFF"..hours.." #FFFFFF: #006FFF"..minutes.." #FFFFFF: #006FFF"..seconds, x*695, y*93, x*910, y*107, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Data: #006FFF"..dia.." #FFFFFF/ #006FFF"..mes.." #FFFFFF/ #006FFF"..ano, x*695, y*107, x*910, y*121, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) dxDrawColorText("Dia Da Semana: #006FFF"..diaa, x*695, y*121, x*910, y*135, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) local veh = getPedOccupiedVehicle(getLocalPlayer()) if veh then local veiculo = getVehicleName(veh, getLocalPlayer()) local vehiclehealth = math.floor(getElementHealth(veh)/10) dxDrawColorText("Veiculo: #006FFF"..veiculo.." #FFFFFF| #FFFFFFDanos: #006FFF"..vehiclehealth.."%", x*695, y*135, x*910, y*149, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) else dxDrawColorText("Veiculo: #006FFFN#FFFFFF/#006FFFA", x*695, y*135, x*910, y*149, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) end dxDrawColorText("Jogadores Online: #006FFF"..tostring(num).." #FFFFFF/ #006FFF"..tostring(max), x*695, y*149, x*910, y*163, tocolor(255, 255, 255, 255), x*1.00, Font_2, "left", "center", false, false, false, false, false) end function clickVip1(button, state) if vip1 == true and vip2 == false and button == "left" and state == "down" then if cursorPosition(x*820, y*247, x*104, y*25) then playSoundFrontEnd(3) vip1 = false vip2 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip2) removeEventHandler("onClientRender", getRootElement(), dxPainelVip1) end end if vip1 == true and vip3 == false and button == "left" and state == "down" then if cursorPosition(x*630, y*247, x*104, y*25) then playSoundFrontEnd(3) vip3 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip3) end end if vip2 == true and vip1 == false and button == "left" and state == "down" then if cursorPosition(x*443, y*247, x*104, y*25) then playSoundFrontEnd(3) vip2 = false vip1 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip1) removeEventHandler("onClientRender", getRootElement(), dxPainelVip2) end end if vip2 == true and vip3 == false and button == "left" and state == "down" then if cursorPosition(x*630, y*247, x*104, y*25) then playSoundFrontEnd(3) vip3 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip3) end end if vip1 and button == "left" and state == "down" then if cursorPosition(x*465, y*328, x*180, y*26) then triggerServerEvent("skinVip1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*358, x*180, y*26) then triggerServerEvent("skinVip2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*328, x*180, y*26) then triggerServerEvent("vidacolete", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*421, x*180, y*26) then triggerServerEvent("kitarmas1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*451, x*180, y*26) then triggerServerEvent("kitarmas2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*481, x*180, y*26) then triggerServerEvent("habilidades", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*388, x*84, y*26) then triggerServerEvent("jetpack1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*388, x*84, y*26) then triggerServerEvent("jetpack2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*451, x*84, y*26) then triggerServerEvent("invisivel1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*574, x*84, y*26) then triggerServerEvent("andar1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*574, x*84, y*26) then triggerServerEvent("andar2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*604, x*180, y*26) then triggerServerEvent("andar3", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*720, y*513, x*84, y*26) then triggerServerEvent("cabeca1", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*513, x*84, y*26) then triggerServerEvent("cabeca2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*816, y*451, x*84, y*26) then triggerServerEvent("invisivel2", getLocalPlayer()) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*544, x*180, y*26) then triggerServerEvent("velocidade1", getLocalPlayer()) setGameSpeed(0.5) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*574, x*180, y*26) then triggerServerEvent("velocidade2", getLocalPlayer()) setGameSpeed(5) playSoundFrontEnd(1) elseif cursorPosition(x*465, y*604, x*180, y*26) then triggerServerEvent("velocidade3", getLocalPlayer()) setGameSpeed(1) playSoundFrontEnd(1) end end if vip2 and button == "left" and state == "down" then if cursorPosition(x*465, y*358, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("carro", getLocalPlayer()) elseif cursorPosition(x*465, y*328, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("moto", getLocalPlayer()) elseif cursorPosition(x*465, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("agua1", getLocalPlayer()) elseif cursorPosition(x*561, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("agua2", getLocalPlayer()) elseif cursorPosition(x*720, y*512, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("jump1", getLocalPlayer()) elseif cursorPosition(x*720, y*542, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("jump2", getLocalPlayer()) elseif cursorPosition(x*720, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("fly1", getLocalPlayer()) elseif cursorPosition(x*816, y*602, x*84, y*26) then playSoundFrontEnd(1) triggerServerEvent("fly2", getLocalPlayer()) elseif cursorPosition(x*465, y*421, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("proVeiculo1", getLocalPlayer()) elseif cursorPosition(x*465, y*451, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("proVeiculo2", getLocalPlayer()) elseif cursorPosition(x*465, y*512, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("veiculoInvisivel1", getLocalPlayer()) elseif cursorPosition(x*465, y*542, x*180, y*26) then playSoundFrontEnd(1) triggerServerEvent("veiculoInvisivel2", getLocalPlayer()) elseif cursorPosition(x*720, y*328, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowEnabled", true) servermessages("Rainbow car ativado", "confirm") elseif cursorPosition(x*720, y*358, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowEnabled", false) servermessages("Rainbow car desativado", "warning") elseif cursorPosition(x*720, y*421, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowHeadlights", true) servermessages("Rainbow luzes ativado", "confirm") elseif cursorPosition(x*720, y*451, x*180, y*26) then playSoundFrontEnd(1) setElementData(getLocalPlayer(), "rainbowHeadlights", false) servermessages("Rainbow luzes desativado", "warning") end end end addEventHandler("onClientClick", getRootElement(), clickVip1) function abrirVip() if vip1 == false then if not fontScale then fontScale = screenW/40 end showCursor(true) vip1 = true addEventHandler("onClientRender", getRootElement(), dxPainelVip1) else showCursor(false) vip1 = false vip2 = false vip3 = false removeEventHandler("onClientRender", getRootElement(), dxPainelVip1) removeEventHandler("onClientRender", getRootElement(), dxPainelVip2) removeEventHandler("onClientRender", getRootElement(), dxPainelVip3) end end addEvent("abrirVip", true) addEventHandler("abrirVip", getRootElement(), abrirVip) function fecharVip() if (vip1 and vip2 == true) then removeEventHandler("onClientRender", getRootElement(), dxPainelVip1) removeEventHandler("onClientRender", getRootElement(), dxPainelVip2) removeEventHandler("onClientRender", getRootElement(), dxPainelVip3) showCursor(false) vip1 = false vip2 = false vip3 = false end end bindKey("O", "down", fecharVip) addEvent("abrirVip", true) addEventHandler("abrirVip", getRootElement(), fecharVip) function cursorPosition(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local fullx, fully = guiGetScreenSize() cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end -- //#FPS local counter = 0 local starttick local currenttick addEventHandler("onClientRender", getRootElement(), function() if not starttick then starttick = getTickCount() end counter = counter + 1 currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(getLocalPlayer(), "FPS", counter) counter = 0 starttick = false end end ) -- //#Texto Cor function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or Font_5 if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local clip = false if dxGetTextWidth(str:gsub("#%x%x%x%x%x%x","")) > bx then clip = true end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 local text = "" local broke = false while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) if clip then local text_ = "" for i = 1,string.len(cap) do if dxGetTextWidth(text,scale,font) < bx then text = text..""..string.sub(cap,i,i) text_ = text_..""..string.sub(cap,i,i) else broke = true break end end cap = text_ end dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str and not broke then cap = str:sub(last) if clip then local text_ = "" for i = 1,string.len(cap) do if dxGetTextWidth(text,scale,font) < bx then text = text..""..string.sub(cap,i,i) text_ = text_..""..string.sub(cap,i,i) else broke = true break end end cap = text_ end dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font) end end -- //#Dirigir Sobre Água function aguaTrue() setWorldSpecialPropertyEnabled("hovercars", true) end addEvent("aguaTrue", true) addEventHandler("aguaTrue", getRootElement(), aguaTrue) function aguaFalse() setWorldSpecialPropertyEnabled("hovercars", false) end addEvent("aguaFalse", true) addEventHandler("aguaFalse", getRootElement(), aguaFalse) -- //#Fly Car function flyTrue() setWorldSpecialPropertyEnabled("aircars", true) end addEvent("flyTrue", true) addEventHandler("flyTrue", getRootElement(), flyTrue) function flyFalse() setWorldSpecialPropertyEnabled("aircars", false) end addEvent("flyFalse", true) addEventHandler("flyFalse", getRootElement(), flyFalse) -- //#Laser [Vip] local dots = {} CMD_LASERCOLOR = "laser" laserWidth = 0.5 dotSize = .05 picklasercolor = 0 colorPickerInitialized = 0 color = {r=255, g=0, b=0, a=255} function onClientStartLaser(res) if res == getThisResource() then setLaserEnabled(getLocalPlayer(), false) setLaserColor(getLocalPlayer(), color.r, color.g, color.b, color.a) if colorPickerInitialized == 0 then initColorPicker() end elseif res == getResourceFromName("colorpicker") then if colorPickerInitialized == 0 then initColorPicker() end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onClientStartLaser) function onClientStopLaser(res) if res == getThisResource() then setLaserEnabled(getLocalPlayer(), false) end end addEventHandler("onClientResourceStop", getRootElement(), onClientStopLaser) function onElementDataChange(dataName, oldValue) if getElementType(source) == "player" and source == getLocalPlayer() and dataName == "laser.on" then local newValue = getElementData(source, dataName) if oldValue == true and newValue == false then unbindKey("aim_weapon", "both", aimKeyPressed) elseif oldValue == false and newValue == true then bindKey("aim_weapon", "both", aimKeyPressed) end end end addEventHandler("onClientElementDataChange", getLocalPlayer(), onElementDataChange) function renderLaser() for _, player in ipairs(getElementsByType("player")) do if getElementData(player, "laser.on") then drawLaser(player) end end end addEventHandler("onClientRender", getRootElement(), renderLaser) function aimKeyPressed(key, state) if state == "down" then setElementData(getLocalPlayer(), "laser.aim", true, true) elseif state == "up" then setElementData(getLocalPlayer(), "laser.aim", false, true) end end function drawLaser(player) if getElementData(player, "laser.on") then local targetself = getPedTarget(player) if targetself and targetself == player then targetself = true else targetself = false end if getElementData(player, "laser.aim") and isPlayerWeaponValidForLaser(player) == true and targetself == false then local x, y, z = getPedWeaponMuzzlePosition(player) if not x then outputDebugString("getPedWeaponMuzzlePosition failed") x, y, z = getPedTargetStart(player) end local x2, y2, z2 = getPedTargetEnd(player) if not x2 then return end local x3, y3, z3 = getPedTargetCollision(player) local r, g, b, a = getLaserColor(player) if x3 then dxDrawLine3D(x, y, z, x3, y3, z3, tocolor(r, g, b, a), laserWidth) drawLaserDot(player, x3, y3, z3) else dxDrawLine3D(x, y, z, x2, y2, z2, tocolor(r, g, b, a), laserWidth) destroyLaserDot(player) end else destroyLaserDot(player) end else destroyLaserDot(player) end end function drawLaserDot(player, x, y, z) if not dots[player] then dots[player] = createMarker(x, y, z, "corona", .02, getLaserColor(player)) else setElementPosition(dots[player], x, y, z) end end function destroyLaserDot(player) if dots[player] and isElement(dots[player]) then destroyElement(dots[player]) dots[player] = nil end end function setLaserColor(player, r, g, b, a) setElementData(player, "laser.red", r) setElementData(player, "laser.green", g) setElementData(player, "laser.blue", b) setElementData(player, "laser.alpha", a) return true end function getLaserColor(player) r = getElementData(player, "laser.red") g = getElementData(player, "laser.green") b = getElementData(player, "laser.blue") a = getElementData(player, "laser.alpha") return r, g, b, a end function isPlayerWeaponValidForLaser(player) local weapon = getPedWeapon(player) if weapon and weapon > 21 and weapon < 39 and weapon ~= 35 and weapon ~= 36 then return true end return false end function setLaserEnabled(player, state) if not player or isElement(player) == false then return false end if getElementType(player) ~= "player" then return false end if state == nil then return false end if state == true then setElementData(player, "laser.on", true, true) setElementData(player, "laser.aim", false, true) return true elseif state == false then setElementData(player, "laser.on", false, true) setElementData(player, "laser.aim", false, true) return true end return false end function isLaserEnabled(player) if getElementData(player, "laser.on") == true then return true else return false end end function toggleLaserEnabled(cmd) if isLaserEnabled(getLocalPlayer()) == false then setLaserEnabled(getLocalPlayer(), true) end end addEvent("toggleLaserEnabled", true) addEventHandler("toggleLaserEnabled", getRootElement(), toggleLaserEnabled) function toggleLaserDisabled(cmd) if isLaserEnabled(getLocalPlayer()) == true then setLaserEnabled(getLocalPlayer(), false) end end addEvent("toggleLaserDisabled", true) addEventHandler("toggleLaserDisabled", getRootElement(), toggleLaserDisabled) function changeLaserColor(cmd, r, g, b, a) local getVip = getElementData(getLocalPlayer(), "vip:expire") if getVip then if colorPickerInitialized == 1 and getResourceFromName("colorpicker") then color.r, color.g, color.b, color.a = getLaserColor(getLocalPlayer()) picklasercolor = 1 if exports.colorpicker:requestPickColor(true, true, "Escolha o Laser Color", color.r, color.g, color.b, color.a) == false then exports.colorpicker:cancelPickColor() return false end return true else if r and g and b and a then r, g, b, a = tonumber(r), tonumber(g), tonumber(b), tonumber(a) if r and g and b and a then if r < 0 or g < 0 or b < 0 or a < 0 or r > 255 or g > 255 or b > 255 or a > 255 then servermessages("sintaxe: /laser r g b a", "confirm") return false else servermessages("Cor do laser: "..r.." "..g.." "..b.." "..a.."", "confirm") setLaserColor(getLocalPlayer(), r, g, b, a) return true end end end end servermessages("sintaxe: /laser r g b a", "confirm") return false else outputChatBox("#030303[#B30A0AComandos#030303] #FFFFFFVocê não tem acesso ao comandos #00AFF0/laser", 255, 255, 255, true) end end addCommandHandler("laser", changeLaserColor) function initColorPicker() if getResourceFromName("colorpicker") == false then return false end addEventHandler("onClientPickedColor", getLocalPlayer(), function(r, g, b, a) if picklasercolor == 1 then setLaserColor(source, r, g, b, a) end end) addEventHandler("onClientCancelColorPick", getLocalPlayer(), function() if picklasercolor == 1 then setLaserColor(source, color.r, color.g, color.b, color.a) picklasercolor = 0 end end) colorPickerInitialized = 1 return true end -- //#Rainbow Car rainbow = {} function rainbowCar() for _, player in pairs(getElementsByType("player")) do if getElementData(player, "rainbowEnabled") then local vehicle = getPedOccupiedVehicle(player) if vehicle then if not rainbow[player] then rainbow[player] = 0 return end local r, g, b = getVehicleColor(vehicle, true) if rainbow[player] == 0 then if r < 250 then r = r + 3 if r > 255 then r = 250 end else rainbow[player] = 1 end end if rainbow[player] == 1 then if g < 250 then g = g + 3 else rainbow[player] = 2 end elseif rainbow[player] == 2 then if b < 255 then if r > 0 then r = r - 3 else r = 0 end b = b + 3 if b > 255 then b = 255 end else rainbow[player] = 3 end elseif rainbow[player] == 3 then if g > 0 then if r > 0 then r = r - 3 else r = 0 end g = g - 3 if g < 0 then g = 0 end else rainbow[player] = 4 end elseif rainbow[player] == 4 then if b > 0 then b = b - 3 if b < 0 then b = 0 end else b = 0 rainbow[player] = 0 end end setVehicleColor(vehicle, r, g, b) end end end end addEventHandler("onClientPreRender", getRootElement(), rainbowCar) -- //#Rainbow Luzes rainbowHeadlights = {} function rainbowLuzes() for _, player in pairs(getElementsByType("player")) do if getElementData(player, "rainbowHeadlights") then local vehicle = getPedOccupiedVehicle(player) if vehicle then if not rainbowHeadlights[player] then rainbowHeadlights[player] = 0 return end local r, g, b = getVehicleHeadLightColor(vehicle) if rainbowHeadlights[player] == 0 then if r < 250 then r = r + 3 if r > 255 then r = 250 end else rainbowHeadlights[player] = 1 end end if rainbowHeadlights[player] == 1 then if g < 250 then g = g + 3 else rainbowHeadlights[player] = 2 end elseif rainbowHeadlights[player] == 2 then if b < 255 then if r > 0 then r = r - 3 else r = 0 end b = b + 3 if b > 255 then b = 255 end else rainbowHeadlights[player] = 3 end elseif rainbowHeadlights[player] == 3 then if g > 0 then if r > 0 then r = r - 3 else r = 0 end g = g - 3 if g < 0 then g = 0 end else rainbowHeadlights[player] = 4 end elseif rainbowHeadlights[player] == 4 then if b > 0 then b = b - 3 if b < 0 then b = 0 end else b = 0 rainbowHeadlights[player] = 0 end end setVehicleHeadLightColor(vehicle, r, g, b) end end end end addEventHandler("onClientPreRender", getRootElement(), rainbowLuzes) -- //#Jump Car function jumCar() local veiculo = getPedOccupiedVehicle(getLocalPlayer()) if not veiculo then return end if (isVehicleOnGround(veiculo) == true) then local v1, v2, v3 = getElementVelocity (veiculo) setElementVelocity(veiculo, v1, v2, v3 + 0.25) end end addEvent("jumCar", true) addEventHandler("jumCar", getRootElement(), jumCar) function jumpStart() bindKey("lshift", "down", jumCar) end addEvent("jumpStart", true) addEventHandler("jumpStart", getRootElement(), jumpStart) function jumpStop() unbindKey("lshift", "down", jumCar) end addEvent("jumpStop", true) addEventHandler("jumpStop", getRootElement(), jumpStop) -- //#Mensages mensages = {} messagetick = 0 function servermessages(message, type) table.insert(mensages, {message, type or "confirm", getTickCount(), dxGetTextWidth(message, fontScale*0.06, Font_1) + screenH*0.01, 0, 0, 0}) messagetick = getTickCount() end addEvent("servermessages", true) addEventHandler("servermessages", getRootElement(), servermessages) function renderMensages() local msgd = mensages if #msgd ~= 0 then local startY = screenW*0.5 local i = 1 repeat mData = msgd[i] local drawThis = true if i~= 1 then startY = startY + screenW*0.0425 end if mData[5] == 0 and mData[6] == 0 then mData[5] = - mData[4] - screenH*0.015 mData[6] = startY mData[7] = startY end local tick = getTickCount() - mData[3] local posX, posY, alpha if tick < 1000 then local progress = math.min(tick/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, 0, 0, 0, progress, "Linear") elseif tick >= 1000 and tick <= 7000 then mData[5] = 0 elseif tick > 7000 then local progress = math.min((tick - 7000)/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, - mData[4] - mData[4] - screenH*0.015, 0, 0, progress, "Linear") if progress >= 1 then table.remove(msgd, i) drawThis = false messagetick = getTickCount() end end local globalTick = getTickCount() - messagetick if drawThis then mData[7] = startY mData[6] = interpolateBetween(mData[6], 0, 0, mData[7], 0, 0, math.min(globalTick/1000,1), "Linear") posX = mData[5] posY = mData[6] alpha = 255 dxDrawRectangle(posX, posY, mData[4], screenW*0.04, tocolor(0, 0, 0, alpha*0.75), true) local r, g, b = 0, 255, 0 if mData[2] == "warning" then r, g, b = 255, 0, 0 end dxDrawRectangle(posX + mData[4], posY, screenH*0.010, screenW*0.04, tocolor(r, g, b, alpha*0.85), true) dxDrawText(mData[1], posX, posY, posX + mData[4], posY + screenW*0.04, tocolor(255, 255, 255, alpha), fontScale*0.05, Font_1, "center", "center", false, false, true, false, false) end i = i + 1 until i > #msgd mensages = msgd end end addEventHandler("onClientRender", getRootElement(), renderMensages) PFV AJUDEM
  14. tabelanimacao = { ifp = {}, animacoes = { "GunMove_BWD", "GunMove_FWD", "GunMove_L", "GunMove_R", "GunCrouchBwd", "GunCrouchFwd", "IDLE_armed", "JOG_maleA", "run_armed", "Run_stop", "run_player", "run_right", "run_left", "run_old", "run_civi", "ARRESTgun", "Crouch_Roll_L", "Crouch_Roll_R", "getup", "SEAT_down", "SEAT_up", "SEAT_idle", "getup_front", "GUN_BUTT", "GUN_BUTT_crouch", "GUN_2_IDLE", "Gun_stand", "HitA_1", "HitA_2", "HitA_3", "HIT_back", "HIT_behind", "HIT_front", "HIT_GUN_BUTT", "HIT_L", "HIT_R", "HIT_walk", "HIT_wall", "IDLE_chat", "IDLE_csaw", "Idle_Gang1", "IDLE_HBHB", "IDLE_ROCKET", "IDLE_stance", "IDLE_taxi", "IDLE_tired", "CLIMB_idle", "CLIMB_jump", "CLIMB_jump2fall", "CLIMB_jump_B", "CLIMB_Pull", "CLIMB_Stand", "Climb_Stand_Finish", "JUMP_glide", "JUMP_land", "JUMP_launch", "JUMP_launch_R", "KD_left", "KD_right", "KO_shot_face", "KO_shot_front", "KO_shot_stom", "KO_skid_back", "KO_skid_front", "KO_spin_L", "KO_spin_R", "phone_in", "phone_out", "phone_talk", "Player_Sneak", "Player_Sneak_walkstart", "WALK_armed", "WALK_civi", "WALK_csaw", "Walk_DoowPartial", "WALK_drunk", "WALK_fat", "WALK_fatold", "WALK_gang1", "WALK_gang2", "WALK_old", "WALK_player", "WALK_rocket", "WALK_shuffle", "WALK_start", "WALK_start_armed", "WALK_start_csaw", "WALK_start_rocket", "Walk_Wuzi", "WEAPON_crouch", "FALL_collapse", "FALL_back", "FALL_fall", "FALL_front", "FALL_glide", "FALL_land", "FALL_skyDive", "gum_eat", "DAM_armL_frmBK", "DAM_armL_frmFT", "DAM_armL_frmLT", "DAM_armR_frmBK", "DAM_armR_frmFT", "DAM_armR_frmRT", "DAM_LegL_frmBK", "DAM_LegL_frmFT", "DAM_LegL_frmLT", "DAM_LegR_frmBK", "DAM_LegR_frmFT", "DAM_LegR_frmLT", "EV_dive", "EV_step", "endchat_01", "endchat_02", "endchat_03" } } addEventHandler("onClientResourceStart", resourceRoot, function() tabelanimacao.ifp["block"] = "ped" tabelanimacao.ifp["ifp"] = engineLoadIFP("ped.ifp", tabelanimacao.ifp["block"]) for _, v in ipairs(tabelanimacao.animacoes) do engineReplaceAnimation(getLocalPlayer(), "ped", v, tabelanimacao.ifp["block"], v) end end ) how i do for is animation appear for all players? That mode appear only for your player!
  15. I want play songs from youtube, but i don't know how to use a converter to this.. Anyone can send me a WORKING link like this: http://www.convertmp3.io/fetch/?video=..ytlink..? Sorry for my bad english...
  16. i looking for a race gamemode, which have a animation while the countdown run, when 3 then set the camera target before the local player car, when 2 then set the camera target another position... where can i download thi gamemode? or how to make this? sorry for my very-very bad english :c
  17. Hello, I need to make a ped driving a plane to turn it, Already tried the "vehicle_right" and "special_control_right" on setPedAnalogControlState and also tried setPedControlState with no success so far, the only thing that works so far is the forward and backward ones. any tips?
  18. Where can i download a good inventory script for rp server?
  19. Hello everyone , Im making Race CnR for my server . It's very simple , one player becomes robber and other players becomes police and race starts. If map duration is over robber wins , that's ok but how can i made cops won ? I mean , when robber dead i want start votemap poll and change map while cops still alive. How can i do that ?
  20. Hi. I reaally need help with interior-system and interior-manager files in United Gaming file resources. I dont know how to scripting but i know the problem. When i enter and exit any building i cant get in any car. But when i restart interior-system script i will get in all the cars. What should i do ? this is interior system.lua server based. addEvent("onPlayerInteriorChange", true) intTable = {} safeTable = {} mysql = exports.mysql -- to check: -- payday -- to test -- /sell --[[ Interior types: TYPE 0: House TYPE 1: Business TYPE 2: Government (Unbuyable) TYPE 3: Rentable --]] -- Small hack function setElementDataEx(source, field, parameter, streamtoall, streamatall) exports['anticheat-system']:changeProtectedElementDataEx( source, field, parameter, streamtoall, streamatall) end -- End small hack function SmallestID( ) -- finds the smallest ID in the SQL instead of auto increment local result = mysql:query_fetch_assoc("SELECT MIN(e1.id+1) AS nextID FROM interiors AS e1 LEFT JOIN interiors AS e2 ON e1.id +1 = e2.id WHERE e2.id IS NULL") if result then local id = tonumber(result["nextID"]) or 1 return id end return false end function findProperty(thePlayer, dimension) local dbid = dimension or (thePlayer and getElementDimension( thePlayer ) or 0) if dbid > 0 then local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local intID = getElementData(interior, "dbid") if intID == dbid then local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") local interiorStatus = getElementData(interior, "status") return dbid, interiorEntrance, interiorExit, interiorStatus[INTERIOR_TYPE], interior end end end return 0 end function cleanupProperty( id, donotdestroy) if id > 0 then if exports.mysql:query_free( "DELETE FROM dancers WHERE dimension = " .. mysql:escape_string(id) ) then local res = getResourceRootElement( getResourceFromName( "dancer-system" ) ) if res then for key, value in pairs( getElementsByType( "ped", res ) ) do if getElementDimension( value ) == id then destroyElement( value ) end end end end if exports.mysql:query_free( "DELETE FROM shops WHERE dimension = " .. mysql:escape_string(id) ) then local res = getResourceRootElement( getResourceFromName( "shop-system" ) ) if res then for key, value in pairs( getElementsByType( "ped", res ) ) do if getElementDimension( value ) == id then local npcID = getElementData( value, "dbid" ) exports.mysql:query_free( "DELETE FROM `shop_products` WHERE `npcID` = " .. mysql:escape_string(npcID) ) destroyElement( value ) end end end end if exports.mysql:query_free( "DELETE FROM atms WHERE dimension = " .. mysql:escape_string(id) ) then local res = getResourceRootElement( getResourceFromName( "bank-system" ) ) if res then for key, value in pairs( getElementsByType( "object", res ) ) do if getElementDimension( value ) == id then destroyElement( value ) end end end end -- if exports.mysql:query_free( "DELETE FROM `elevators` WHERE `dimensionwithin` = '" .. mysql:escape_string(id).."' OR `dimension` = '" .. mysql:escape_string(id).."'" ) then -- local res = getResourceRootElement( getResourceFromName( "elevator-system" ) ) -- if res then -- for key, value in pairs( getElementsByType( "elevator", res ) ) do -- if getElementDimension( value ) == id then -- destroyElement( value ) -- call( getResourceFromName( "elevator-system" ), "reloadOneElevator", value ) -- end -- end -- end -- end local resE = getResourceRootElement( getResourceFromName( "elevator-system" ) ) if resE then call( getResourceFromName( "elevator-system" ), "delElevatorsFromInterior", "MAXIME" , "PROPERTYCLEANUP", id ) end if not donotdestroy then local res1 = getResourceRootElement( getResourceFromName( "object-system" ) ) if res1 then exports['object-system']:removeInteriorObjects( tonumber(id) ) end end if safeTable[id] then local safe = safeTable[id] call( getResourceFromName( "item-system" ), "clearItems", safe ) destroyElement(safe) safeTable[id] = nil end setTimer ( function () call( getResourceFromName( "item-system" ), "deleteAllItemsWithinInt", id, 0, "CLEANUPINT" ) end, 3000, 1) end end function sellProperty(thePlayer, commandName, bla) if bla then outputChatBox("Use /sell to sell this place to another player.", thePlayer, 255, 0, 0) return end local dbid, entrance, exit, interiorType, interiorElement = findProperty( thePlayer ) if dbid > 0 then if interiorType == 2 then outputChatBox("You cannot sell a government property.", thePlayer, 255, 0, 0) elseif interiorType ~= 3 and commandName == "unrent" then outputChatBox("You do not rent this property.", thePlayer, 255, 0, 0) else local interiorStatus = getElementData(interiorElement, "status") if interiorStatus[INTERIOR_OWNER] == getElementData(thePlayer, "dbid") then publicSellProperty(thePlayer, dbid, true, true, false) cleanupProperty(dbid, true) exports.logs:dbLog(thePlayer, 37, { "in"..tostring(dbid) } , "SELLPROPERTY "..dbid) local addLog = mysql:query_free("INSERT INTO `interior_logs` (`intID`, `action`, `actor`) VALUES ('"..tostring(dbid).."', '"..commandName.."', '"..getElementData(thePlayer, "account:id").."')") or false if not addLog then outputDebugString("Failed to add interior logs.") end else outputChatBox("You do not own this property.", thePlayer, 255, 0, 0) end end else outputChatBox("You are not in a property.", thePlayer, 255, 0, 0) end end addCommandHandler("sellproperty", sellProperty, false, false) addCommandHandler("unrent", sellProperty, false, false) function publicSellProperty(thePlayer, dbid, showmessages, givemoney, CLEANUP) local dbid, entrance, exit, interiorType, interiorElement = findProperty( thePlayer, dbid ) local query = mysql:query_free("UPDATE interiors SET owner=-1, locked=1, safepositionX=NULL, safepositionY=NULL, safepositionZ=NULL, safepositionRZ=NULL WHERE id='" .. dbid .. "'") if query then local interiorStatus = getElementData(interiorElement, "status") if getElementDimension(thePlayer) == dbid and not CLEANUP then setElementInterior(thePlayer, entrance[INTERIOR_INT]) setCameraInterior(thePlayer, entrance[INTERIOR_INT]) setElementDimension(thePlayer, entrance[INTERIOR_DIM]) setElementPosition(thePlayer, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "interiormarker", false, false, false) end if safeTable[dbid] then local safe = safeTable[dbid] if safe then exports['item-system']:clearItems(safe) destroyElement(safe) safeTable[dbid] = nil else end end if interiorType == 0 or interiorType == 1 then if interiorStatus[INTERIOR_OWNER] == getElementData(thePlayer, "dbid") then local money = math.ceil(interiorStatus[INTERIOR_COST] * 2/3) if givemoney then exports.global:giveMoney(thePlayer, money) exports.global:takeMoney(getTeamFromName("Government of Los Santos"), money, true) end if showmessages then if CLEANUP == "FORCESELL" then local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) local adminUsername = getElementData(thePlayer, "account:username") if hiddenAdmin == 0 then exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(thePlayer):gsub("_", " ").." ("..adminUsername..") has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") else exports.global:sendMessageToAdmins("[INTERIOR]: A hidden admin has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") end else outputChatBox("You sold your property for " .. exports.global:formatMoney(money) .. "$.", thePlayer, 0, 255, 0) end end -- take all keys call( getResourceFromName( "item-system" ), "deleteAll", 4, dbid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, dbid ) triggerClientEvent(thePlayer, "removeBlipAtXY", thePlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) else if showmessages then if CLEANUP == "FORCESELL" then local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) local adminUsername = getElementData(thePlayer, "account:username") if hiddenAdmin == 0 then exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(thePlayer):gsub("_", " ").." ("..adminUsername..") has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") else exports.global:sendMessageToAdmins("[INTERIOR]: A hidden admin has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") end else outputChatBox("You set this property to unowned.", thePlayer, 0, 255, 0) end end end else if showmessages then if CLEANUP == "FORCESELL" then local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) local adminUsername = getElementData(thePlayer, "account:username") if hiddenAdmin == 0 then exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(thePlayer):gsub("_", " ").." ("..adminUsername..") has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") else exports.global:sendMessageToAdmins("[INTERIOR]: A hidden admin has force-sold interior #"..dbid.." ("..getElementData(interiorElement,"name")..").") end else outputChatBox("You are no longer renting this property.", thePlayer, 0, 255, 0) end end call( getResourceFromName( "item-system" ), "deleteAll", 4, dbid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, dbid ) triggerClientEvent(thePlayer, "removeBlipAtXY", thePlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) end realReloadInterior(dbid) else outputChatBox("Error 504914 - Report on forums.", thePlayer, 255, 0, 0) end end function sellTo(thePlayer, commandName, targetPlayerName) -- only works in dimensions local dbid, entrance, exit, interiorType, interiorElement = findProperty( thePlayer ) if dbid > 0 and not isPedInVehicle( thePlayer ) then local interiorStatus = getElementData(interiorElement, "status") if interiorStatus[INTERIOR_TYPE] == 2 then outputChatBox("You cannot sell a government property.", thePlayer, 255, 0, 0) elseif not targetPlayerName then outputChatBox("SYNTAX: /" .. commandName .. " [partial player name / id]", thePlayer, 255, 194, 14) outputChatBox("Sells the Property you're in to that Player.", thePlayer, 255, 194, 14) outputChatBox("Ask the buyer to use /pay to recieve the money for the Property.", thePlayer, 255, 194, 14) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayerName) if targetPlayer and getElementData(targetPlayer, "dbid") then local px, py, pz = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(targetPlayer) if getDistanceBetweenPoints3D(px, py, pz, tx, ty, tz) < 10 and getElementDimension(targetPlayer) == getElementDimension(thePlayer) then if interiorStatus[INTERIOR_OWNER] == getElementData(thePlayer, "dbid") or exports.global:isPlayerFullAdmin(thePlayer) or exports.donators:hasPlayerPerk(thePlayer, 14) then if getElementData(targetPlayer, "dbid") ~= interiorStatus[INTERIOR_OWNER] then if exports.global:hasSpaceForItem(targetPlayer, 4, dbid) then local query = mysql:query_free("UPDATE interiors SET owner = '" .. getElementData(targetPlayer, "dbid") .. "' WHERE id='" .. dbid .. "'") if query then local keytype = 4 if interiorType == 1 then keytype = 5 end call( getResourceFromName( "item-system" ), "deleteAll", 4, dbid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, dbid ) exports.global:giveItem(targetPlayer, keytype, dbid) triggerClientEvent(thePlayer, "removeBlipAtXY", thePlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) triggerClientEvent(targetPlayer, "createBlipAtXY", targetPlayer, interiorType, entrance[INTERIOR_X], entrance[INTERIOR_Y], entrance[INTERIOR_Z]) if interiorType == 0 or interiorType == 1 then outputChatBox("You've successfully sold your property to " .. targetPlayerName .. ".", thePlayer, 0, 255, 0) outputChatBox((getPlayerName(thePlayer):gsub("_", " ")) .. " sold you this property.", targetPlayer, 0, 255, 0) else outputChatBox(targetPlayerName .. " has taken over your rent contract.", thePlayer, 0, 255, 0) outputChatBox("You did take over " .. getPlayerName(thePlayer):gsub("_", " ") .. "'s renting contract.", targetPlayer, 0, 255, 0) end exports.logs:dbLog(thePlayer, 37, { targetPlayer, "in"..tostring(dbid) } , "SELLPROPERTY "..getPlayerName(thePlayer).." => "..targetPlayerName) local adminID = getElementData(thePlayer, "account:id") local addLog = mysql:query_free("INSERT INTO `interior_logs` (`intID`, `action`, `actor`) VALUES ('"..tostring(dbid).."', '"..commandName.." to "..targetPlayerName.."', '"..adminID.."')") or false if not addLog then outputDebugString("Failed to add interior logs.") end realReloadInterior(dbid) else outputChatBox("Error 09002 - Report on Forums.", thePlayer, 255, 0, 0) end else outputChatBox(targetPlayerName .. " has no space for the property keys.", thePlayer, 255, 0, 0) end else outputChatBox("You can't sell your own property to yourself.", thePlayer, 255, 0, 0) end else outputChatBox("This property is not yours.", thePlayer, 255, 0, 0) end else outputChatBox("You are too far away from " .. targetPlayerName .. ".", thePlayer, 255, 0, 0) end end end end end addCommandHandler("sell", sellTo) function realReloadInterior(interiorID) local dbid, entrance, exit, inttype, interiorElement = exports['interior-system']:findProperty( false, interiorID ) if dbid > 0 then if safeTable[dbid] then destroyElement(safeTable[dbid]) safeTable[dbid] = false end triggerClientEvent("deleteInteriorElement", interiorElement, tonumber(dbid)) destroyElement(interiorElement) reloadOneInterior(tonumber(dbid), false) else --outputChatBox("You suck") --outputDebugString("Tried to reload interior without ID.") end end local stats_numberOfInts = 0 -- CONVERTED function reloadOneInterior(id) --[[if (hasCoroutine==nil) then hasCoroutine = false end]] local row = mysql:query_fetch_assoc("SELECT * FROM `interiors` LEFT JOIN `interior_business` ON `interiors`.`id` = `interior_business`.`intID` WHERE `id` = '" .. id .."' AND `deleted` = '0'") if row then --[[if (hasCoroutine) then coroutine.yield() end]] if row then for k, v in pairs( row ) do if v == null then row[k] = nil else row[k] = tonumber(v) or v end end local interiorElement = createElement("interior", "int"..tostring(row.id)) setElementDataEx(interiorElement, "dbid", row.id, true) setElementDataEx(interiorElement, "entrance", { row.x, row.y, row.z, row.interiorwithin, row.dimensionwithin, row.angle, 0 }, true) setElementDataEx(interiorElement, "exit", {row.interiorx, row.interiory, row.interiorz, row.interior, row.id, row.angleexit, 0 }, true ) setElementDataEx(interiorElement, "status", { row.type, row.disabled == 1, row.locked == 1, row.owner, row.cost, row.supplies}, true ) setElementDataEx(interiorElement, "name", row.name, true ) setElementDataEx(interiorElement, "adminnote", string.sub(tostring(row.adminnote),1,100) , true ) --setElementDataEx(interiorElement, "isLightOn", row.isLightOn == 1, true) if row.safepositionX and row.safepositionY and row.safepositionZ ~= mysql_null() and row.safepositionRZ then setElementDataEx(interiorElement, "safe", {row.safepositionX, row.safepositionY, row.safepositionZ, 0, 0, row.safepositionRZ}, false) local tempobject = createObject(2332, row.safepositionX, row.safepositionY, row.safepositionZ, 0, 0, row.safepositionRZ) setElementInterior(tempobject, row.interior) setElementDimension(tempobject, row.id) safeTable[row.id] = tempobject else setElementDataEx(interiorElement, "safe", false, true) end if row.businessNote then setElementDataEx(interiorElement, "business:note", row.businessNote , true) end outputDebugString( "[INTERIOR] LOADED INT #" .. id.." ("..row.name..")" ) return true else outputDebugString( "[INTERIOR] LOADING FAILED Invalid Int #" .. id ) return false end end end --[[local threads = { } function resume() for key, value in ipairs(threads) do coroutine.resume(value) end end]] function loadAllInteriors() local players = exports.pool:getPoolElementsByType("player") for k, thePlayer in ipairs(players) do exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "interiormarker", false, false, false) end local timerDelay = 100 local result = mysql:query("SELECT `id` FROM `interiors` WHERE `deleted` = '0'") if (result) then while true do local row = mysql:fetch_assoc(result) if not row then break end setTimer(reloadOneInterior, timerDelay, 1, row.id) timerDelay = timerDelay + 100 stats_numberOfInts = stats_numberOfInts + 1 end mysql:free_result(result) setTimer(function () triggerClientEvent("interior:showLoadingProgress" ,getRootElement(), stats_numberOfInts, timerDelay) end, 5000, 1) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), loadAllInteriors) function buyInterior(player, pickup, cost, isHouse, isRentable) if isRentable then local result = mysql:query_fetch_assoc( "SELECT COUNT(*) as 'cntval' FROM `interiors` WHERE `owner` = " .. getElementData(player, "dbid") .. " AND `type` = 3" ) if result then local count = tonumber(result['cntval']) if count ~= 0 then outputChatBox("You are already renting another house.", player, 255, 0, 0) return end end elseif not exports.global:hasSpaceForItem(player, 4, 1) then outputChatBox("You do not have the space for the keys.", player, 255, 0, 0) return end if exports.global:takeMoney(player, cost) then if (isHouse) then outputChatBox("Congratulations! You have just bought this house for $" .. exports.global:formatMoney(cost) .. ".", player, 255, 194, 14) exports.global:giveMoney( getTeamFromName("Government of Los Santos"), cost ) elseif (isRentable) then outputChatBox("Congratulations! You are now renting this property for $" .. exports.global:formatMoney(cost) .. ".", player, 255, 194, 14) else outputChatBox("Congratulations! You have just bought this business for $" .. exports.global:formatMoney(cost) .. ".", player, 255, 194, 14) exports.global:giveMoney( getTeamFromName("Government of Los Santos"), cost ) end local charid = getElementData(player, "dbid") local pickupid = getElementData(pickup, "dbid") mysql:query_free( "UPDATE interiors SET owner='" .. charid .. "', locked=0 WHERE id='" .. pickupid .. "'") local interiorEntrance = getElementData(pickup, "entrance") -- make sure it's an unqiue key call( getResourceFromName( "item-system" ), "deleteAll", 4, pickupid ) call( getResourceFromName( "item-system" ), "deleteAll", 5, pickupid ) if (isHouse) or (isRentable) then exports.global:giveItem(player, 4, pickupid) else exports.global:giveItem(player, 5, pickupid) end exports.logs:dbLog(thePlayer, 37, { "in"..tostring(pickupid) } , "BUYPROPERTY $"..cost) realReloadInterior(tonumber(pickupid)) triggerClientEvent(player, "createBlipAtXY", player, interiorEntrance[INTERIOR_TYPE], interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y]) else outputChatBox("Sorry, you cannot afford to purchase this property.", player, 255, 194, 14) end end --[[ function vehicleStartEnter(thePlayer) local marker = getElementData(thePlayer, "interiormarker") local x, y, z = getElementPosition(thePlayer) if marker then cancelEvent() end end addEventHandler("onVehicleStartEnter", getRootElement(), vehicleStartEnter) addEventHandler("onVehicleStartExit", getRootElement(), vehicleStartEnter)]] -- I guess I'll test this on my local server before we put it in, make sure miniguns dont fall from the sky and everyone turns into a clown. -Bean --[[function vehicleStartEnter(thePlayer) local marker = getElementData(thePlayer, "interiormarker") local x, y, z = getElementPosition(thePlayer) local lastDistance = 1 -- This is the distanceBetweenPoints3D, I'm sure we could make it less, but this should do if they are on the interior marker, right? for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") local posX, posY, posZ = getElementPosition(thePlayer) local dimension = getElementDimension(thePlayer) for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[5] == dimension) then local distance = getDistanceBetweenPoints3D(posX, posY, posZ, point[1], point[2], point[3]) if (distance < lastDistance) then found = interior -- Set it to the interior ID so that it knows there's something there. lastDistance = distance end end end end if marker and found then -- If it's there, then you cancel, not just because the event wants us to. cancelEvent() else exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "interiormarker", nil, nil, nil) -- If it's not found, then let them enter the car, and clear the element data so it's not there anymore. end end addEventHandler("onVehicleStartEnter", getRootElement(), vehicleStartEnter) addEventHandler("onVehicleStartExit", getRootElement(), vehicleStartEnter)]] function enterInterior( ) if source and client then local canEnter, errorCode, errorMsg = canEnterInterior(source) -- Checks for disabled and locked ints. if canEnter then setPlayerInsideInterior( source, client ) elseif isInteriorForSale(source) then local interiorStatus = getElementData(source, "status") local cost = interiorStatus[INTERIOR_COST] local isHouse = interiorStatus[INTERIOR_TYPE] == 0 local isRentable = interiorStatus[INTERIOR_TYPE] == 3 buyInterior(client, source, cost, isHouse, isRentable) else outputChatBox(errorMsg, client, 255, 0, 0) end end end addEvent("interior:enter", true) addEventHandler("interior:enter", getRootElement(), enterInterior) -- NOT CONVERTED function setPlayerInsideInterior(theInterior, thePlayer) local teleportTo = nil -- does the player want to go in? local pedCurrentDimension = getElementDimension( thePlayer ) local interiorEntrance = getElementData(theInterior, "entrance") local interiorExit = getElementData(theInterior, "exit") local interiorStatus = getElementData(theInterior, "status") if (interiorEntrance[INTERIOR_DIM] == pedCurrentDimension) then --[[ We want to go inside, Check for a fee ***REMOVED.*** if getElementData( thePlayer, "adminduty" ) ~= 1 and not exports.global:hasItem( thePlayer, 5, getElementData( theInterior, "dbid" ) ) and not (getElementData(thePlayer,"ESbadge")) and not (getElementData(thePlayer,"PDbadge"))and not (getElementData(thePlayer,"SheriffBadge")) and not (getElementData(thePlayer,"GOVbadge")) and not (getElementData(thePlayer,"SANbadge")) then local fee = interiorEntrance[INTERIOR_FEE] if fee and fee > 0 then if not exports.global:takeMoney( thePlayer, fee ) then outputChatBox( "You don't have enough money with you to enter this interior.", thePlayer, 255, 0, 0 ) return else local ownerid = interiorStatus[INTERIOR_OWNER] local query = mysql:query_free( "UPDATE characters SET bankmoney = bankmoney + " .. fee .. " WHERE id = " .. ownerid ) if query then for k, v in pairs( getElementsByType( "player" ) ) do if isElement( v ) then if getElementData( v, "dbid" ) == ownerid then exports['anticheat-system']:changeProtectedElementDataEx( v, "businessprofit", getElementData( v, "businessprofit" ) + fee, false ) break end end end else outputChatBox( "Error 100.6 - Report on Forums.", thePlayer, 255, 0, 0 ) end end end end]] -- We've passed the feecheck, yet we still want to go inside. teleportTo = interiorExit else -- We'd like to leave this building, kthxhopefullybye. if (getElementData(thePlayer, "snake")==true) then return end teleportTo = interiorEntrance end if teleportTo then triggerClientEvent(thePlayer, "setPlayerInsideInterior", theInterior, teleportTo, theInterior) doorGoThru(theInterior) local dbid = getElementData(theInterior, "dbid") mysql:query_free("UPDATE `interiors` SET `lastused`=NOW() WHERE `id`='" .. mysql:escape_string(dbid) .. "'") end end --[[ SAFES ]] function addSafeAtPosition( thePlayer, x, y, z, rotz ) local dbid = getElementDimension( thePlayer ) local interior = getElementInterior( thePlayer ) if dbid == 0 then return 2 elseif dbid >= 20000 then -- Vehicle Interiors local vid = dbid - 20000 if exports['vehicle-system']:getSafe( vid ) then outputChatBox("There is already a safe in this property. Type /movesafe to move it.", thePlayer, 255, 0, 0) return 1 elseif exports.global:hasItem( thePlayer, 3, vid ) then z = z - 0.5 rotz = rotz + 180 if exports.mysql:query_free( "UPDATE vehicles SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. vid .. "'") then if exports['vehicle-system']:addSafe( vid, x, y, z, rotz, interior ) then return 0 end end return 1 end elseif dbid >= 19000 then -- temp vehicle interiors return 2 elseif ((exports.global:hasItem( thePlayer, 5, dbid ) or exports.global:hasItem( thePlayer, 4, dbid))) then if safeTable[dbid] then outputChatBox("There is already a safe in this property. Type /movesafe to move it.", thePlayer, 255, 0, 0) return 1 else z = z - 0.5 rotz = rotz + 180 mysql:query_free( "UPDATE interiors SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. dbid .. "'") local tempobject = createObject(2332, x, y, z, 0, 0, rotz) setElementInterior(tempobject, interior) setElementDimension(tempobject, dbid) safeTable[dbid] = tempobject call( getResourceFromName( "item-system" ), "clearItems", tempobject ) return 0 end end return 3 end function moveSafe ( thePlayer, commandName ) local x,y,z = getElementPosition( thePlayer ) local rotz = getPedRotation( thePlayer ) local dbid = getElementDimension( thePlayer ) local interior = getElementInterior( thePlayer ) if (dbid < 19000 and (exports.global:hasItem( thePlayer, 5, dbid ) or exports.global:hasItem( thePlayer, 4, dbid))) or (dbid >= 20000 and exports.global:hasItem(thePlayer, 3, dbid - 20000)) then z = z - 0.5 rotz = rotz + 180 if dbid >= 20000 and exports['vehicle-system']:getSafe(dbid-20000) then local safe = exports['vehicle-system']:getSafe(dbid-20000) exports.mysql:query_free("UPDATE vehicles SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. (dbid-20000) .. "'") setElementPosition(safe, x, y, z) setObjectRotation(safe, 0, 0, rotz) elseif dbid > 0 and safeTable[dbid] then local safe = safeTable[dbid] exports.mysql:query_free("UPDATE interiors SET safepositionX='" .. x .. "', safepositionY='" .. y .. "', safepositionZ='" .. z .. "', safepositionRZ='" .. rotz .. "' WHERE id='" .. dbid .. "'") -- Update the name in the sql. setElementPosition(safe, x, y, z) setObjectRotation(safe, 0, 0, rotz) else outputChatBox("You need a safe to move!", thePlayer, 255, 0, 0) end else outputChatBox("You need the keys of this interior to move the Safe.", thePlayer, 255, 0, 0) end end addCommandHandler("movesafe", moveSafe) local function hasKey( source, key ) if exports.global:hasItem(source, 4, key) or exports.global:hasItem(source, 5,key) then return true, false else if getElementData(source, "adminduty") == 1 then return true, true else return false, false end end return false, false end function lockUnlockHouseEvent(player, checkdistance) if (player) then source = player end local itemValue = nil local found = nil local foundpoint = nil local minDistance = 5 local interiorName = "" local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local canEnter, byAdmin = nil local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then local interiorID = getElementData(interior, "dbid") canEnter, byAdmin = hasKey(source, interiorID) if canEnter then -- house found found = interior foundpoint = point itemValue = interiorID minDistance = distance interiorName = getElementData(interior, "name") end end end end end -- For elevators already local possibleElevators = getElementsByType("elevator") for _, elevator in ipairs(possibleElevators) do local elevatorEntrance = getElementData(elevator, "entrance") local elevatorExit = getElementData(elevator, "exit") for _, point in ipairs( { elevatorEntrance, elevatorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) if (distance < minDistance) then if hasKey(source, elevatorEntrance[INTERIOR_DIM]) and elevatorEntrance[INTERIOR_DIM] ~= 0 then found = elevator foundpoint = point itemValue = elevatorEntrance[INTERIOR_DIM] minDistance = distance elseif hasKey(source, elevatorExit[INTERIOR_DIM]) and elevatorExit[INTERIOR_DIM] ~= 0 then found = elevator foundpoint = point itemValue = elevatorExit[INTERIOR_DIM] minDistance = distance end end end end end if (checkdistance) then return found, minDistance end if found and itemValue then local dbid, entrance, exit, interiorType, interiorElement = findProperty( source, itemValue ) local interiorStatus = getElementData(interiorElement, "status") local locked = interiorStatus[INTERIOR_LOCKED] and 1 or 0 locked = 1 - locked -- Invert status local newRealLockedValue = false mysql:query_free("UPDATE interiors SET locked='" .. mysql:escape_string(locked) .. "' WHERE id='" .. mysql:escape_string(itemValue) .. "' LIMIT 1") if locked == 0 then doorUnlockSound(interiorElement) if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has unlocked Interior ID #"..itemValue.." without key.") exports.global:sendLocalText(source, " * The door should be now open *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(itemValue, "unlock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to unlock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(itemValue) }, "UNLOCK INTERIOR") else --:~ doorLockSound(interiorElement) newRealLockedValue = true if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has locked Interior ID #"..itemValue.." without key.") exports.global:sendLocalText(source, " * The door should be now locked *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(itemValue, "lock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to lock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(itemValue) }, "LOCK INTERIOR") end interiorStatus[INTERIOR_LOCKED] = newRealLockedValue exports['anticheat-system']:changeProtectedElementDataEx(interiorElement, "status", interiorStatus, true) else cancelEvent( ) end end addEvent( "lockUnlockHouse",false ) addEventHandler( "lockUnlockHouse", getRootElement(), lockUnlockHouseEvent) function doorUnlockSound(house) if (house) then if (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "doorUnlockSound", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("doorUnlockSound", source, found) end end end function doorLockSound(house) if (house) then if (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "doorLockSound", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("doorLockSound", source, found) end end end function doorGoThru(house) if (house) then if (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "doorGoThru", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("doorGoThru", source, found) end end end addEvent( "lockUnlockHouseID",true ) addEventHandler( "lockUnlockHouseID", getRootElement(), function( id ) local hasKey1, byAdmin = hasKey(source, id) if id and tonumber(id) and hasKey1 then local result = mysql:query_fetch_assoc( "SELECT 1-locked as 'val' FROM interiors WHERE id = " .. id) local locked = 0 if result then locked = tonumber( result["val"] ) end local newRealLockedValue = false mysql:query_free("UPDATE interiors SET locked='" .. locked .. "' WHERE id='" .. id .. "' LIMIT 1") if locked == 0 then if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has unlocked Interior ID #"..id.." without key.") exports.global:sendLocalText(source, " * The door should be now open *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(id, "unlock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to unlock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(id) }, "UNLOCK INTERIOR") else newRealLockedValue = true if byAdmin then if getElementData(source, "hiddenadmin") == 0 then local adminTitle = exports.global:getPlayerAdminTitle(source) local adminUsername = getElementData(source, "account:username") exports.global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(source):gsub("_", " ").. " ("..adminUsername..") has locked Interior ID #"..id.." without key.") exports.global:sendLocalText(source, " * The door should be now closed *", 255, 51, 102, 30, {}, true) exports["interior-manager"]:addInteriorLogs(id, "lock without key", source) end else exports.global:sendLocalMeAction(source, "puts the key in the door to lock it.") end exports.logs:dbLog(source, 31, { "in"..tostring(id) }, "LOCK INTERIOR") end local dbid, entrance, exit, interiorType, interiorElement = findProperty( source, id ) if interiorElement then local interiorStatus = getElementData(interiorElement, "status") interiorStatus[INTERIOR_LOCKED] = newRealLockedValue exports['anticheat-system']:changeProtectedElementDataEx(interiorElement, "status", interiorStatus, true) end else cancelEvent( ) end end ) function findParent( element, dimension ) local dbid, entrance, exit, type, interiorElement = findProperty( element, dimension ) return interiorElement end addEventHandler("onPlayerInteriorChange", getRootElement( ), function( a, b, toDimension, toInterior) if toDimension then setElementDimension(source, toDimension) end if toInterior then setElementInterior(source, toInterior) end local vehicle = getPedOccupiedVehicle( source ) if not vehicle then --setPedGravity(source, 0) end triggerEvent("texture-system:loadCustomTextures", source) end ) function playerKnocking(house) if (house) then if isElement(house) and (getElementType(house) == "interior") then local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") for index, nearbyPlayer in ipairs(getElementsByType("player")) do if isElement(nearbyPlayer) then if ((getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorEntrance[INTERIOR_DIM]) or ((getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], getElementPosition(nearbyPlayer)) < 20) and getElementDimension(nearbyPlayer) == interiorExit[INTERIOR_DIM]) then local logged = getElementData(nearbyPlayer, "loggedin") if logged == 1 then triggerClientEvent(nearbyPlayer, "playerKnock", source) end end end end else -- It would be 0 local found = nil local minDistance = 20 local pPosX, pPosY, pPosZ = getElementPosition(source) local dimension = getElementDimension(source) local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do local interiorEntrance = getElementData(interior, "entrance") local interiorExit = getElementData(interior, "exit") for _, point in ipairs( { interiorEntrance, interiorExit } ) do if (point[INTERIOR_DIM] == dimension) then local distance = getDistanceBetweenPoints3D(pPosX, pPosY, pPosZ, point[INTERIOR_X], point[INTERIOR_Y], point[INTERIOR_Z]) or 20 if (distance < minDistance) then found = interior minDistance = distance end end end end end if found then triggerEvent("onKnocking", source, found) end end end addEvent("onKnocking", true) addEventHandler("onKnocking", getRootElement(), playerKnocking) function client_requestHUDinfo() -- Client = client -- Source = interior element if not isElement(source) or (getElementType(source) ~= "interior" and getElementType(source) ~= "elevator") then return end exports['anticheat-system']:changeProtectedElementDataEx( client, "interiormarker", true, false, false ) local interiorID, interiorName, interiorStatus, interiorEntrance, interiorExit = nil if getElementType(source) == "elevator" then local playerDimension = getElementDimension(client) local elevatorEntranceDimension = getElementData(source, "entrance")[INTERIOR_DIM] local elevatorExitDimension = getElementData(source, "exit")[INTERIOR_DIM] if playerDimension ~= elevatorEntranceDimension and elevatorEntranceDimension ~= 0 then local dbid, entrance, exit, type, interiorElement = findProperty( client, elevatorEntranceDimension ) if dbid and interiorElement then interiorID = getElementData(interiorElement, "dbid") interiorName = getElementData(interiorElement,"name") interiorStatus = getElementData(interiorElement, "status") interiorEntrance = getElementData(interiorElement, "entrance") interiorExit = getElementData(interiorElement, "exit") end elseif elevatorExitDimension ~= 0 then local dbid, entrance, exit, type, interiorElement = findProperty( client, elevatorExitDimension ) if dbid and interiorElement then interiorID = getElementData(interiorElement, "dbid") interiorName = getElementData(interiorElement,"name") interiorStatus = getElementData(interiorElement, "status") interiorEntrance = getElementData(interiorElement, "entrance") interiorExit = getElementData(interiorElement, "exit") end end if not dbid then interiorID = -1 interiorName = "None" interiorStatus = { } interiorEntrance = { } interiorStatus[INTERIOR_TYPE] = 2 interiorStatus[INTERIOR_COST] = 0 interiorStatus[INTERIOR_OWNER] = -1 interiorEntrance[INTERIOR_FEE] = 0 end else interiorName = getElementData(source,"name") interiorStatus = getElementData(source, "status") interiorEntrance = getElementData(source, "entrance") interiorExit = getElementData(source, "exit") end local interiorOwnerName = exports['cache']:getCharacterName(interiorStatus[INTERIOR_OWNER]) or "None" local interiorType = interiorStatus[INTERIOR_TYPE] or 2 local interiorCost = interiorStatus[INTERIOR_COST] or 0 local interiorBizNote = getElementData(source, "business:note") or false triggerClientEvent(client, "displayInteriorName", source, interiorName or "Elevator", interiorOwnerName, interiorType or 2, interiorCost or 0, interiorID or -1, interiorBizNote) end addEvent("interior:requestHUD", true) addEventHandler("interior:requestHUD", getRootElement(), client_requestHUDinfo) addEvent("int:updatemarker", true) addEventHandler("int:updatemarker", getRootElement(), function( newState ) exports['anticheat-system']:changeProtectedElementDataEx(client, "interiormarker", newState, false, true) -- No sync at all: function is only called from client thusfar has the actual state itself end ) --INTERIOR LIGHT BY MAXIME --[[function toggleInteriorLights(thePlayer, commandName) local playerInterior = getElementInterior(thePlayer) if (playerInterior==0) then outputChatBox("There is no light out here.", thePlayer, 255, 0, 0) else local possibleInteriors = getElementsByType("interior") for _, interior in ipairs(possibleInteriors) do if getElementData(interior, "dbid") == playerInterior then if getElementData(interior, "isLightOn") then setElementDataEx(interior, "isLightOn", false, true ) updateLight(false, playerInterior) exports.global:sendLocalText(thePlayer, "*"..getPlayerName(thePlayer):gsub("_", " ").." turns off the lights.", 255, 51, 102, 30, {}, true) local mQuery1 = mysql:query_free("UPDATE `interiors` SET `isLightOn` = '0' WHERE `id` = '"..tostring(playerInterior).."'") if not mQuery1 then outputDebugString("[SQL] Failed to update interior light status") end break else setElementDataEx(interior, "isLightOn", true, true ) updateLight(true, playerInterior) exports.global:sendLocalText(thePlayer, "*"..getPlayerName(thePlayer):gsub("_", " ").." turns on the lights.", 255, 51, 102, 30, {}, true) local mQuery1 = mysql:query_free("UPDATE `interiors` SET `isLightOn` = '1' WHERE `id` = '"..tostring(playerInterior).."'") if not mQuery1 then outputDebugString("[SQL] Failed to update interior light status") end break end end end end end addCommandHandler("toglight", toggleInteriorLights) addCommandHandler("togglelight", toggleInteriorLights) function updateLight(status, playerInterior) local possiblePlayers = getElementsByType("player") for _, player in ipairs(possiblePlayers) do if getElementInterior(player) == playerInterior then triggerClientEvent ( player, "updateLightStatus", player, status ) end end end addEvent("setInteriorLight", true) addEventHandler("setInteriorLight", getRootElement(), updateLight) ]] and this is interior system.lua client based. gInteriorName, gOwnerName, gBuyMessage, gBizMessage = nil timer = nil intNameFont = guiCreateFont( "intNameFont.ttf", 30 ) --AngryBird BizNoteFont = guiCreateFont( "BizNote.ttf", 21 ) -- Message on enter function showIntName(name, ownerName, inttype, cost, ID, bizMsg) bizMessage = bizMsg if (isElement(gInteriorName) and guiGetVisible(gInteriorName)) then if isTimer(timer) then killTimer(timer) timer = nil end destroyElement(gInteriorName) gInteriorName = nil if isElement(gOwnerName) then destroyElement(gOwnerName) gOwnerName = nil end if (gBuyMessage) then destroyElement(gBuyMessage) gBuyMessage = nil end if (gBizMessage) then destroyElement(gBizMessage) gBizMessage = nil end end if name == "None" then return elseif name then if (inttype==3) then -- Interior name and Owner for rented gInteriorName = guiCreateLabel(0.0, 0.84, 1.0, 0.3, tostring(name), true) guiSetFont(gInteriorName,intNameFont) guiLabelSetHorizontalAlign(gInteriorName, "center", true) --guiSetAlpha(gInteriorName, 0.0) if (exports.global:isPlayerAdmin(getLocalPlayer()) and getElementData(getLocalPlayer(), "adminduty") == 1) or exports.global:hasItem(getLocalPlayer(), 4, ID) then gOwnerName = guiCreateLabel(0.0, 0.90, 1.0, 0.3, "Rented by: " .. tostring(ownerName), true) guiSetFont(gOwnerName, "default") guiLabelSetHorizontalAlign(gOwnerName, "center", true) --guiSetAlpha(gOwnerName, 0.0) end else -- Interior name and Owner for the rest --outputDebugString((name or "nil").." - "..(tostring(bizMsg) or "nil")) if bizMessage then gInteriorName = guiCreateLabel(0.0, 0.80, 1.0, 0.3, tostring(name), true) gBizMessage = guiCreateLabel(0.0, 0.864, 1.0, 0.3, tostring(bizMessage), true) guiLabelSetHorizontalAlign(gBizMessage, "center", true) --guiSetAlpha(gBizMessage, 0.0) guiSetFont(gBizMessage, BizNoteFont) else gInteriorName = guiCreateLabel(0.0, 0.84, 1.0, 0.3, tostring(name), true) end guiSetFont(gInteriorName, intNameFont) guiLabelSetHorizontalAlign(gInteriorName, "center", true) --guiSetAlpha(gInteriorName, 0.0) if (exports.global:isPlayerAdmin(getLocalPlayer()) and getElementData(getLocalPlayer(), "adminduty") == 1) or exports.global:hasItem(getLocalPlayer(), 4, ID) or exports.global:hasItem(getLocalPlayer(), 5, ID) then gOwnerName = guiCreateLabel(0.0, 0.90, 1.0, 0.3, "Owner: " .. tostring(ownerName), true) guiSetFont(gOwnerName, "default") guiLabelSetHorizontalAlign(gOwnerName, "center", true) --guiSetAlpha(gOwnerName, 0.0) end end if (ownerName=="None") and (inttype==3) then -- Unowned type 3 (rentable) gBuyMessage = guiCreateLabel(0.0, 0.915, 1.0, 0.3, "Press F to rent for $" .. tostring(exports.global:formatMoney(cost)) .. ".", true) guiSetFont(gBuyMessage, "default") guiLabelSetHorizontalAlign(gBuyMessage, "center", true) --guiSetAlpha(gBuyMessage, 0.0) elseif (ownerName=="None") and (inttype<2) then -- Unowned any other type gBuyMessage = guiCreateLabel(0.0, 0.915, 1.0, 0.3, "Press F to buy for $" .. tostring(exports.global:formatMoney(cost)) .. ".", true) guiSetFont(gBuyMessage, "default") guiLabelSetHorizontalAlign(gBuyMessage, "center", true) --guiSetAlpha(gBuyMessage, 0.0) else local msg = "Press F to enter." --[[if fee and fee > 0 then msg = "Entrance Fee: $" .. exports.global:formatMoney(fee) if exports.global:hasMoney( getLocalPlayer(), fee ) then msg = msg .. "\nPress F to enter." end end]] gBuyMessage = guiCreateLabel(0.0, 0.915, 1.0, 0.3, msg, true) guiSetFont(gBuyMessage, "default") guiLabelSetHorizontalAlign(gBuyMessage, "center", true) --guiSetAlpha(gBuyMessage, 0.0) end setTimer(function() destroyElement(gInteriorName) gInteriorName = nil if isElement(gOwnerName) then destroyElement(gOwnerName) gOwnerName = nil end if (gBuyMessage) then destroyElement(gBuyMessage) gBuyMessage = nil end if (gBizMessage) then destroyElement(gBizMessage) gBizMessage = nil end end, 3000, 1) --timer = setTimer(fadeMessage, 50, 20, true) end end function fadeMessage(fadein) local alpha = guiGetAlpha(gInteriorName) if (fadein) and (alpha) then local newalpha = alpha + 0.05 guiSetAlpha(gInteriorName, newalpha) if isElement(gOwnerName) then guiSetAlpha(gOwnerName, newalpha) end if (gBuyMessage) then guiSetAlpha(gBuyMessage, newalpha) end if gBizMessage then guiSetAlpha(gBizMessage, newalpha) end if(newalpha>=1.0) then timer = setTimer(hideIntName, 5000, 1) end elseif (alpha) then local newalpha = alpha - 0.05 guiSetAlpha(gInteriorName, newalpha) if isElement(gOwnerName) then guiSetAlpha(gOwnerName, newalpha) end if (gBuyMessage) then guiSetAlpha(gBuyMessage, newalpha) end if (gBizMessage) then guiSetAlpha(gBizMessage, newalpha) end if(newalpha<=0.0) then destroyElement(gInteriorName) gInteriorName = nil if isElement(gOwnerName) then destroyElement(gOwnerName) gOwnerName = nil end if (gBuyMessage) then destroyElement(gBuyMessage) gBuyMessage = nil end if (gBizMessage) then destroyElement(gBizMessage) gBizMessage = nil end end end end function hideIntName() setTimer(fadeMessage, 50, 20, false) end addEvent("displayInteriorName", true ) addEventHandler("displayInteriorName", getRootElement(), showIntName) -- Creation of clientside blips function createBlipsFromTable(interiors) -- remove existing house blips for key, value in ipairs(getElementsByType("blip")) do local blipicon = getBlipIcon(value) if (blipicon == 31 or blipicon == 32) then destroyElement(value) end end -- spawn the new ones for key, value in ipairs(interiors) do createBlipAtXY(interiors[key][1], interiors[key][2], interiors[key][3]) end end addEvent("createBlipsFromTable", true) addEventHandler("createBlipsFromTable", getRootElement(), createBlipsFromTable) function createBlipAtXY(inttype, x, y) if inttype == 3 then inttype = 0 end createBlip(x, y, 10, 31+inttype, 2, 255, 0, 0, 255, 0, 300) end addEvent("createBlipAtXY", true) addEventHandler("createBlipAtXY", getRootElement(), createBlipAtXY) function removeBlipAtXY(inttype, x, y) if inttype == 3 or type(inttype) ~= 'number' then inttype = 0 end for key, value in ipairs(getElementsByType("blip")) do local bx, by, bz = getElementPosition(value) local icon = getBlipIcon(value) if (icon==31+inttype and bx==x and by==y) then destroyElement(value) break end end end addEvent("removeBlipAtXY", true) addEventHandler("removeBlipAtXY", getRootElement(), removeBlipAtXY) ------ local wBizNote, wRightClick, ax, ay = nil local house = nil local houseID = nil local sx, sy = guiGetScreenSize( ) function showHouseMenu( ) guiSetInputEnabled(true) showCursor(true) ax = math.max( math.min( sx - 160, ax - 75 ), 10 ) ay = math.max( math.min( sx - 210, ay - 100 ), 10 ) wRightClick = guiCreateWindow(ax, ay, 150, 200, (getElementData(house, "name") or ("Interior ID #"..tostring( houseID ))), false) guiWindowSetSizable(wRightClick, false) bLock = guiCreateButton(0.05, 0.13, 0.9, 0.1, "Lock/Unlock", true, wRightClick) addEventHandler("onClientGUIClick", bLock, lockUnlockHouse, false) bKnock = guiCreateButton(0.05, 0.27, 0.9, 0.1, "Knock on Door", true, wRightClick) addEventHandler("onClientGUIClick", bKnock, knockHouse, false) if hasKey(houseID) then bBizNote = guiCreateButton(0.05, 0.41, 0.9, 0.1, "Edit Greeting Msg", true, wRightClick) addEventHandler("onClientGUIClick", bBizNote, function() local width, height = 506, 103 local sx, sy = guiGetScreenSize() local posX = (sx/2)-(width/2) local posY = (sy/2)-(height/2) wBizNote = guiCreateWindow(posX,posY,width,height,"Edit Business Greeting Message - "..(getElementData(house, "name") or ("Interior ID #"..tostring( houseID ))),false) local eBizNote = guiCreateEdit(9,22,488,40,"",false,wBizNote) local bRemove = guiCreateButton(9,68,163,28,"Remove",false,wBizNote) local bSave = guiCreateButton(172,68,163,28,"Save",false,wBizNote) local bCancel = guiCreateButton(335,68,163,28,"Cancel",false,wBizNote) addEventHandler("onClientGUIClick", bRemove, function() if triggerServerEvent("businessSystem:setBizNote", getLocalPlayer(), getLocalPlayer(), houseID) then hideHouseMenu() end end, false) addEventHandler("onClientGUIClick", bSave, function() if triggerServerEvent("businessSystem:setBizNote", getLocalPlayer(), getLocalPlayer(), houseID, guiGetText(eBizNote)) then hideHouseMenu() end end, false) addEventHandler("onClientGUIClick", bCancel, function() if wBizNote then destroyElement(wBizNote) wBizNote = nil end end, false) end, false) bCloseMenu = guiCreateButton(0.05, 0.55, 0.9, 0.1, "Close Menu", true, wRightClick) else bCloseMenu = guiCreateButton(0.05, 0.41, 0.9, 0.1, "Close Menu", true, wRightClick) end addEventHandler("onClientGUIClick", bCloseMenu, hideHouseMenu, false) end local lastKnocked = 0 function knockHouse() local tick = getTickCount( ) if tick - lastKnocked > 5000 then triggerServerEvent("onKnocking", getLocalPlayer(), house) hideHouseMenu() lastKnocked = tick else outputChatBox("Please wait a bit before knocking again.", 255, 0, 0) end end function lockUnlockHouse( ) local tick = getTickCount( ) if tick - lastKnocked > 2000 then local px, py, pz = getElementPosition(getLocalPlayer()) local interiorEntrance = getElementData(house, "entrance") local interiorExit = getElementData(house, "exit") local x, y, z = getElementPosition(house) if getDistanceBetweenPoints3D(interiorEntrance[INTERIOR_X], interiorEntrance[INTERIOR_Y], interiorEntrance[INTERIOR_Z], px, py, pz) < 5 then triggerServerEvent( "lockUnlockHouseID", getLocalPlayer( ), houseID ) elseif getDistanceBetweenPoints3D(interiorExit[INTERIOR_X], interiorExit[INTERIOR_Y], interiorExit[INTERIOR_Z], px, py, pz) < 5 then triggerServerEvent( "lockUnlockHouseID", getLocalPlayer( ), houseID ) end hideHouseMenu() end end function hideHouseMenu( ) if wRightClick then destroyElement( wRightClick ) wRightClick = nil showCursor( false ) end if wBizNote then destroyElement(wBizNote) wBizNote = nil end house = nil houseID = nil guiSetInputEnabled(false) showCursor(false) end -- local function hasKey( key ) -- return exports.global:hasItem(getLocalPlayer(), 4, key) or exports.global:hasItem(getLocalPlayer(), 5,key) -- end function hasKey( key ) if exports.global:hasItem(getLocalPlayer(), 4, key) or exports.global:hasItem(getLocalPlayer(), 5,key) then return true, false else if getElementData(getLocalPlayer(), "adminduty") == 1 then return true, true else return false, false end end return false, false end function clickHouse(button, state, absX, absY, wx, wy, wz, e) if (button == "right") and (state=="down") and not e then if getElementData(getLocalPlayer(), "exclusiveGUI") then return end local element, id = nil, nil local px, py, pz = getElementPosition(getLocalPlayer()) local x, y, z = nil local interiorres = getResourceRootElement(getResourceFromName("interior-system")) local elevatorres = getResourceRootElement(getResourceFromName("elevator-system")) for key, value in ipairs(getElementsByType("pickup")) do if isElementStreamedIn(value) then x, y, z = getElementPosition(value) local minx, miny, minz, maxx, maxy, maxz local offset = 4 minx = x - offset miny = y - offset minz = z - offset maxx = x + offset maxy = y + offset maxz = z + offset if (wx >= minx and wx <=maxx) and (wy >= miny and wy <=maxy) and (wz >= minz and wz <=maxz) then local dbid = getElementData(getElementParent( value ), "dbid") if getElementType(getElementParent( value )) == "interior" then -- house found element = getElementParent( value ) id = dbid break elseif getElementType(getElementParent( value ) ) == "elevator" then -- it's an elevator if getElementData(value, "dim") and getElementData(value, "dim") ~= 0 then element = getElementParent( value ) id = getElementData(value, "dim") break elseif getElementData( getElementData( value, "other" ), "dim") and getElementData( getElementData( value, "other" ), "dim") ~= 0 then element = value id = getElementData( getElementData( value, "other" ), "dim") break end end end end end if element then if getDistanceBetweenPoints3D(x, y, z, px, py, pz) < 5 then ax, ay = getScreenFromWorldPosition(x, y, z, 0, false) if ax then hideHouseMenu() house = element houseID = id showHouseMenu() end else outputChatBox("You are too far away from this house.", 255, 0, 0) end else hideHouseMenu() end end end addEventHandler("onClientClick", getRootElement(), clickHouse, true) addEvent("playerKnock", true) addEventHandler("playerKnock", root, function() outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("knocking.mp3") end ) addEvent("doorUnlockSound", true) addEventHandler("doorUnlockSound", root, function() --outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("doorUnlockSound.mp3") end ) addEvent("doorLockSound", true) addEventHandler("doorLockSound", root, function() --outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("doorLockSound.mp3") end ) addEvent("doorGoThru", true) addEventHandler("doorGoThru", root, function() --outputChatBox(" * Knocks can be heard coming from the door. * ((" .. getPlayerName(source):gsub("_"," ") .. "))", 255, 51, 102) playSound("doorGoThru.mp3") end ) local cache = { } function findProperty(thePlayer, dimension) local dbid = dimension or getElementDimension( thePlayer ) if dbid > 0 then if cache[ dbid ] then return unpack( cache[ dbid ] ) end -- find the entrance and exit local entrance, exit = nil, nil for key, value in pairs(getElementsByType( "pickup", getResourceRootElement() )) do if getElementData(value, "dbid") == dbid then entrance = value break end end if entrance then cache[ dbid ] = { dbid, entrance } return dbid, entrance end end cache[ dbid ] = { 0 } return 0 end function findParent( element, dimension ) local dbid, entrance = findProperty( element, dimension ) return entrance end -- local inttimer = nil addEvent( "setPlayerInsideInterior", true ) addEventHandler( "setPlayerInsideInterior", getRootElement( ), function( targetLocation, targetInterior) if inttimer then return end if targetLocation[INTERIOR_DIM] ~= 0 then setGravity(0) end setElementFrozen(getLocalPlayer(), true) setElementPosition(getLocalPlayer(), targetLocation[INTERIOR_X], targetLocation[INTERIOR_Y], targetLocation[INTERIOR_Z], true) setElementInterior(getLocalPlayer(), targetLocation[INTERIOR_INT]) setCameraInterior(targetLocation[INTERIOR_INT]) setElementDimension(getLocalPlayer(), targetLocation[INTERIOR_DIM]) if targetLocation[INTERIOR_ANGLE] then setPedRotation(getLocalPlayer(), targetLocation[INTERIOR_ANGLE]) end triggerServerEvent("onPlayerInteriorChange", getLocalPlayer(), 0, 0, targetLocation[INTERIOR_DIM], targetLocation[INTERIOR_INT]) inttimer = setTimer(onPlayerPutInInteriorSecond, 1000, 1, targetLocation[INTERIOR_DIM], targetLocation[INTERIOR_INT]) engineSetAsynchronousLoading ( false, true ) -- if tonumber(targetLocation[INTERIOR_DIM]) == 0 then -- updateLightStatus(1) -- else --:~ -- outputDebugString(tostring(getElementData(targetInterior, "isLightOn"))) -- updateLightStatus(getElementData(targetInterior, "isLightOn")) -- outputChatBox("'/toglight' to switch on/off the lights in this interior") -- end local adminnote = tostring(getElementData(targetInterior, "adminnote")) if string.sub(tostring(adminnote),1,8) ~= "userdata" and adminnote ~= "\n" and getElementData(getLocalPlayer(), "adminduty") == 1 then outputChatBox("[INT MONITOR]: "..adminnote:gsub("\n", " ").."[..]", 255,0,0) outputChatBox("'/checkint "..getElementData(targetInterior, "dbid").." 'for details.",255,255,0) end end ) function onPlayerPutInInteriorSecond(dimension, interior) setCameraInterior(interior) local safeToSpawn = true if(getResourceFromName("object-system"))then safeToSpawn = exports['object-system']:isSafeToSpawn() end if (safeToSpawn) then inttimer = nil if isElement(getLocalPlayer()) then setTimer(onPlayerPutInInteriorThird, 1000, 1) end else setTimer(onPlayerPutInInteriorSecond, 1000, 1, dimension, interior) end end function onPlayerPutInInteriorThird() setGravity(0.008) setElementFrozen(getLocalPlayer(), false) engineSetAsynchronousLoading ( true, false ) end function cPKnock() if (getElementDimension(getLocalPlayer()) > 20000) then triggerServerEvent("onVehicleKnocking", getLocalPlayer()) else triggerServerEvent("onKnocking", getLocalPlayer(), 0) end end addCommandHandler("knock", cPKnock) local starttime = false local function updateIconAlpha( ) local time = getTickCount( ) - starttime -- if time > 20000 then -- removeIcon( ) -- else time = time % 1000 local alpha = 0 if time < 500 then alpha = time / 500 else alpha = 1 - ( time - 500 ) / 500 end guiSetAlpha(help_icon, alpha) guiSetAlpha(icon_label_shadow, alpha) guiSetAlpha(icon_label, alpha) --end end function showLoadingProgress(stats_numberOfInts, delayTime) if help_icon then removeIcon() end local title = stats_numberOfInts.." interiors(ETA: "..string.sub(tostring((tonumber(delayTime)-5000)/(60*1000)), 1, 3).." minutes) are being loaded. Don't panic if your house hasn't appeared yet. " local screenwidth, screenheight = guiGetScreenSize() help_icon = guiCreateStaticImage(screenwidth-25,6,20,20,"icon.png",false) icon_label_shadow = guiCreateLabel(screenwidth-829,11,800,20,title,false) guiSetFont(icon_label_shadow,"default-bold-small") guiLabelSetColor(icon_label_shadow,0,0,0) guiLabelSetHorizontalAlign(icon_label_shadow,"right",true) icon_label = guiCreateLabel(screenwidth-830,10,800,20,title,false) guiSetFont(icon_label,"default-bold-small") guiLabelSetHorizontalAlign(icon_label,"right",true) starttime = getTickCount( ) updateIconAlpha( ) addEventHandler( "onClientRender", getRootElement( ), updateIconAlpha ) setTimer(function () if help_icon then removeIcon() end end, delayTime+10000 , 1) end addEvent("interior:showLoadingProgress",true) addEventHandler("interior:showLoadingProgress",getRootElement(),showLoadingProgress) --addCommandHandler("fu",showLoadingProgress) function removeIcon() removeEventHandler( "onClientRender", getRootElement( ), updateIconAlpha ) destroyElement(icon_label_shadow) destroyElement(icon_label) destroyElement(help_icon) icon_label_shadow, icon_label, help_icon = nil end
  21. Good night, good morning, or good afternoon! I am a beginner on the moon, I would like to know how to use string.find, or some other method, to start a mod that has a particular tag. In my case, I put the tag "[VZR]" in my mods. Thank you.
  22. Hi everyone ! I'm slowly learning MTA SA scripting and more generally programmation. I made some basics commands. One changes my skin. But then I'm lokking to my new face, it looks scary, breacause CJ walking style is still applied on it. I know the function to change it, but I need to associate the 300 skins that GTA contains to their walking style. I can't find the holy web page which associates each skin to its walking style, so I'm requesting your help ! Thanks to all the people who will try to help me, and sorry if my English is not perfect.
  23. function walkstyle(thePlayer) setPedWalkingStyle(localPlayer,128) end function walk ( thePlayer ) elseif isObjectInACLGroup("user."..walk, aclGetGroup("Console")) then walkstyle(thePlayer) end end addCommandHandler("walk", walk) I couldn't fix it. How can i fix this code.
  24. Somehow i can make this possible? When a player connect, then he have to wait the end of download, then he can use the fr gui. I want make fr gui usable when player download the mods. Sorry for my bad english..
  25. I attached a song to my car, but when i'll go far away from car, the music starts from the beginning... s: how to fix this?
×
×
  • Create New...