stPatrick

Members
  • Content Count

    348
  • Joined

  • Last visited

  • Days Won

    4

stPatrick last won the day on April 7

stPatrick had the most liked content!

Community Reputation

106 Excellent

7 Followers

About stPatrick

  • Rank
    Fool

Details

  • Gang
    SkyTeam

Recent Profile Visitors

1,627 profile views
  1. local function getFirstColorCode(text) local s, e = text:find("#%x%x%x%x%x%x") return (s and e) and text:sub(s, e) or "#FFFFFF" end local function getTimePrefix() local realtime = getRealTime() return "[" .. string.format("%02d:%02d:%02d", realtime.hour, realtime.minute, realtime.second) .. "] " end addEventHandler("onPlayerChat", root, function(text, msgtype) if msgtype == 0 then cancelEvent() local text = getPlayerName(source) .. ": #ebddb2" .. text outputChatBox(getFirstColorCode(text) .. getTimePrefix() .. text, root, 255, 255, 255, true) end end) Do you mean something like that?
  2. I don't really understand what you want to do. Simply put the color code at the beginning of the text.
  3. Try, like this: dbExec(b_data, "INSERT INTO bank (bank_username,bank_pass,bank_ques,bank_answ,bank_money) VALUES (?,?,?,?,?)", b_username, b_pass, b_ques, b_answ, b_money)
  4. You can't hide it. But, I think you want to create a "DX-Editbox". (Because of the previous topic) Maybe, this is useful: https://community.multitheftauto.com/index.php?p=resources&s=details&id=10804
  5. stPatrick

    "Zoom" camera

    Is that what you mean? function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function getElementBackPosition(element) local x, y, z = getElementPosition(element) local _, _, rot = getElementRotation(element) local x, y = getPointFromDistanceRotation(x, y, 0.5, -rot + 180) return x, y, z end (https://wiki.multitheftauto.com/wiki/GetPointFromDistanceRotation)
  6. stPatrick

    help

    One of your coordinates (x5 or y4) is not definied. ("at argument 1", so x5 is equal to nil)
  7. setTimer (i think)
  8. -- SERVER SIDE function saveLog(text, fileName) if text and fileName then local path = "logs/"..fileName..".log" if not fileExists(path) then fileCreate(path) end local file = fileOpen(path) local fileSize = fileGetSize(file) fileSetPos(file, fileSize) fileWrite(file, text.."\n") fileClose(file) return true end return false end Something like that not tested
  9. source is not defined. Paste the full code.
  10. outputConsole("[TOPBAR] "..text:gsub("#%x%x%x%x%x%x","")) --this is the one
  11. Fixed code -- SERVER SIDE function jumpWithVehicle(playerWhoPressedTheButton) if not isPedInVehicle(playerWhoPressedTheButton) then return end -- kill function if player is not in vehicle local vehicleElement = getPedOccupiedVehicle(playerWhoPressedTheButton) -- we know player is in a vehicle, so get the vehicle's element if getVehicleController(vehicleElement) ~= playerWhoPressedTheButton then return end -- check player is who drive this vehicle (if not -> kill function) local playerAccountName = getAccountName(getPlayerAccount(playerWhoPressedTheButton)) -- get the player's account name if isObjectInACLGroup("user."..playerAccountName, aclGetGroup("Admin")) then -- check is player in the 'Admin' ACL group. local vehicleType = getVehicleType(vehicleElement) if vehicleType == "Plane" or vehicleType == "Helicopter" then return end -- kill function if the vehicle is a Plane/Helicopter local velocity_x, velocity_y, velocity_z = getElementVelocity(vehicleElement) setElementVelocity(vehicleElement, velocity_x, velocity_y, velocity_z + 0.33) -- boost vehicle's Z velocity end end addEventHandler("onResourceStart", resourceRoot, function() for _, onlinePlayer in ipairs(getElementsByType("player")) do bindKey(onlinePlayer, "lshift", "down", jumpWithVehicle) end end) addEventHandler("onPlayerJoin", root, function() bindKey(source, "lshift", "down", jumpWithVehicle) end)
  12. https://wiki.multitheftauto.com/wiki/SetVehicleComponentPosition
  13. API: http://getipintel.net/free-proxy-vpn-tor-detection-api/ -- SERVER SIDE local server_owner_email = "owneremailaddres@gmail.com" -- change it addEventHandler("onPlayerJoin", root, function() local IP = getPlayerIP(source) fetchRemote("http://check.getipintel.net/check.php?ip="..IP.."&contact="..server_owner_email, function(data, errno, player) if errno ~= 0 then print("fetchRemote error - "..errno) return false end local result = tonumber(data) if (result >= 0 and result <= 1) and result > 0.85 then outputChatBox(getPlayerName(player).." use VPN!", root) end end, "", false, source) end) not tested