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. 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
  2. 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.
  3. É 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
  4. 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)
  5. 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...
  6. É 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.
  7. 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
  8. 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!
  9. 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...
  10. 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
  11. 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?
  12. Where can i download a good inventory script for rp server?
  13. 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 ?
  14. 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
  15. 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.
  16. 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.
  17. TPF is bringing opportunities for those players who don't know scripting but wants to learn. We ( TPF staff ) offers free courses in various languages, as well as designing, for totally free. Languages we can teach you? We can teach you Lua, HTML, CSS ,PHP and MYSQL What can we teach you in designing ? Creating logos, creating banners ,posters , web design and MORE !!!(Using Photoshop cs6) Our contact: Contact DiGiTal#2028 or join our discord server : https://discord.gg/BxkW65z For more information and tutorials visit our website : https://tutoplayfun.ml/
  18. 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.
  19. 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..
  20. 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?
  21. client: function rtwjhrt() if isElement(ss) then stopSound(ss) return end local car = getPedOccupiedVehicle ( localPlayer ) local gettext = guiGetText ( GUIEditor.edit[1] ) local x, y, z = getElementPosition( car ) local ss = playSound3D( 'asd.mp3', x, y, z ) setSoundMaxDistance( ss, 85 ) attachElements(ss,car) end addEvent("asd123asd456",true) addEventHandler("asd123asd456",root,rtwjhrt) server: function trig() triggerClientEvent(root,"asd123asd456",root) end addEvent( "asjdlaj", true ) addEventHandler( "asjdlaj", root, trig ) Why not hear the sound another players?
  22. If i play a music from youtube with fetchRemote, the .mp3 downloaded it somewhere?
  23. hey guys i've made CJ Custom Clothes and it's working but there's a problem when a player reconnect or resource restart it back to original clothes i want save it any help ? screenshot : https://imgur.com/a/iBAzGog
  24. I want create a dxdraw rectangle and text on the map. But how to make this possible?
  25. i added this line to my script: takeWeapon( source, 38, 99999 ) buuut, does not working.. how to fix this?
×
×
  • Create New...