Jump to content

Uisaqin

Members
  • Posts

    12
  • Joined

  • Last visited

Uisaqin's Achievements

Square

Square (6/54)

0

Reputation

  1. function showTextDisplay ( ) https://wiki.multitheftauto.com/wiki/OnPlayerJoin
  2. Uisaqin

    Redirect line?

    addEventHandler("onPlayerLogin", root, function() redirectPlayer(source, "174.34.131.139", getServerPort(), getServerPassword()) end) obviously if its a different port or password youll need to change them
  3. if its at screenWidth - 700 pixels on your screen, thats 1440 - 700 = 740 pixels from the left. or relative: 740 / 1440 = 0.51388888888888888888888888888889 so this should make it look the same on any resolution local x1 = screenWidth*0.5139
  4. display the image on your screen using the width and height of the image file, if it displays too big then yeah keep making the image smaller until it looks good
  5. find the width and height in pixels the image looks good at on your resolution eg. 200 x 250 then do 200 / 1440 = 0.139 and 250 / 900 = 0.278 then just update the floats local ImageWidth = 0.139 local ImageHeight = 0.278
  6. u can make the image display on any resolution if u use floats between 0 and 1 (relative positioning) -- image settings local ImageX = 0.45 local ImageY = 0.8 local ImageWidth = 0.5 local ImageHeight = 0.5 -- calculate pixel positions local ScreenWidth, ScreenHeight = guiGetScreenSize() ImageX = ScreenWidth * ImageX ImageY = ScreenHeight * ImageY ImageWidth = ScreenWidth * ImageWidth ImageHeight = ScreenHeight * ImageHeight
  7. Uisaqin

    Healthlul's

    first plan the colors u want for different health ranges hp = rgb 100 = 0 255 0 (green) 50 = 255 255 0 (yellow) 0 = 255 0 0 (red) then u can try something like function getHealthColour(Health) if Health >= 50 then return math.ceil((((Health / 50) - 1) * 255)), 255, 0 else return 255, math.ceil((Health / 50) * 255), 0 end end
  8. Uisaqin

    Mysql

    local query = mysql_query(handler, "SELECT * FROM players WHERE username = '"..username.."'") also escape username and password variables with mysql_escape_string() before putting them into the query string so you are protected against sql injection
  9. try if string.find(g_MapInfo.name, "[DM]", 1, true) then -- disable pattern matching on [ ] g_MapInfo.name = string.gsub(g_MapInfo.name, '%[DM%]', '#ff0000[DM]#236B8E') -- escape [ ] with %[ %] end
  10. Uisaqin

    censorship help!

    epic fail. ok. No one mentioned anything about separate resources or exports, just separate scripts. Dunno what your saying about using return, i was demonstrating how to stop an event's execution from another, as im guessing cancelEvent() will not stop the next event functions being called. Not that it should, of course.
  11. Uisaqin

    censorship help!

    function onPlayerChatCensor(Text, Type) ChatCensored = false if Text == 'fuk' then ChatCensored = true end end addEventHandler('onPlayerChat', root, onPlayerChatCensor) function onPlayerChatCustom(Text, Type) cancelEvent() if ChatCensored then return end outputChatBox(Text) end addEventHandler('onPlayerChat', root, onPlayerChatCustom) onPlayerChatCensor must be called before onPlayerChatCustom, so load censor script first, or if both are in same script call onPlayerChatCensor's addEventHandler first
  12. what about using 2 of these functions https://wiki.multitheftauto.com/wiki/Useful_Functions something like function getLineHitAngle(Point1X, Point1Y, Point1Z, Point2X, Point2Y, Point2Z) local Hit, HitX, HitY, HitZ = processLineOfSight(Point1X, Point1Y, Point1Z, Point2X, Point2Y, Point2Z) if Hit then local LineAngle = findRotation(Point1X, Point1Y, Point2X, Point2Y) local LineDistance = 2 local Point3X, Point3Y = getPointFromDistanceRotation(Point1X, Point1Y, LineDistance, LineAngle - 90) local Point4X, Point4Y = getPointFromDistanceRotation(Point2X, Point2Y, LineDistance, LineAngle - 90) local Hit2, Hit2X, Hit2Y, Hit2Z = processLineOfSight(Point3X, Point3Y, Point1Z, Point4X, Point4Y, Point2Z) if Hit2 then return findRotation(HitX, HitY, Hit2X, Hit2Y) - LineAngle end end return false end
×
×
  • Create New...