-
Posts
1,143 -
Joined
-
Last visited
-
Days Won
42
Everything posted by Patrick
-
Very simple codes, but it was stolen and annoyed me #1 original: https://community.multitheftauto.com/index.php?p=resources&s=details&id=15863 #1 stolen: https://community.multitheftauto.com/index.php?p=resources&s=details&id=16030 #2 original: https://community.multitheftauto.com/index.php?p=resources&s=details&id=15525 #2 stolen: https://community.multitheftauto.com/index.php?p=resources&s=details&id=15937
-
You want to show the timestamp before every line on the chat? (or I do not understand...) This is my last tip. This little script show the timestamp before EVERY(!) line on the chat. -- CLIENT SIDE SCRIPT !!! 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("onClientChatMessage", root, function(text, r, g, b) if not text:find("%d%d:%d%d:%d%d") then cancelEvent() outputChatBox(getFirstColorCode(text) .. getTimePrefix() .. text, r, g, b, true) end end)
-
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?
-
I don't really understand what you want to do. Simply put the color code at the beginning of the text.
-
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)
-
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
-
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)
-
Send the full code
- 1 reply
-
- 1
-
-
One of your coordinates (x5 or y4) is not definied. ("at argument 1", so x5 is equal to nil)
-
setTimer (i think)
-
-- 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
-
source is not defined. Paste the full code.
-
outputConsole("[TOPBAR] "..text:gsub("#%x%x%x%x%x%x","")) --this is the one
-
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)
-
https://wiki.multitheftauto.com/wiki/SetVehicleComponentPosition
-
API: http://getipintel.net/free-proxy-vpn-tor-detection-api/ -- SERVER SIDE local server_owner_email = "[email protected]" -- 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
-
https://wiki.multitheftauto.com/wiki/GetVersion
-
https://wiki.multitheftauto.com/wiki/GuiWindowSetMovable
-
You need to use SAMP Editor. (Download link: https://www.moddb.com/downloads/san-andreas-multiplayer-map-editor) With this editor you can find and select this fence. If you selected it, at the right side, you can see the modelID(IDE) and the coordinates (x,y,z). I do it: removeWorldModel(1413, 1, 1658.9141, -2120.2813, 13.6797) removeWorldModel(1412, 1, 1658.8359, -2114.9609, 13.6797) removeWorldModel(1413, 1, 1658.8359, -2109.6875, 13.6797) removeWorldModel(1413, 1, 1658.8359, -2104.4063, 13.6797)
-
bindKey(player,"m","down","music") replace to: bindKey("m","down","music") (And run this script on client side.)
-
https://wiki.multitheftauto.com/wiki/OnPlayerLogin -- SERVER addEventHandler ( "onPlayerLogin", root, function ( thePreviousAccount, theCurrentAccount ) local accName = getAccountName ( theCurrentAccount ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then setElementData( source, "cons", true) else setElementData( source, "cons", false) end end )
-
marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153) function camera(hitElement) if getElementType(hitElement) == "player" then fadeCamera(hitElement, false, 0.5) setTimer(function() setCameraMatrix(hitElement, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) fadeCamera(hitElement, true, 0.5) end, 500, 1) end end addEventHandler("onMarkerHit", marker, camera)