Jump to content

Need help --


Recommended Posts

Well .. i am a scripter but not an experienced scripter .. so i want to get experience from other players scripts.. i check every script i see and try to use all of them in a script i make ... well i saw this and i dont know what is the meaning of it.. !

function drawSpectators() 
    local textX = x - spectatorSettings.xOffset 
    local textY = spectatorSettings.yOffset  
    dxDrawText("MIRANDO: "..tonumber(#spectators), textX - 0.2, textY - 0.2, x, y, tocolor(0, 0, 0, 255), 0.4, "bankgothic") 
    drawColor("#00FF00MIRANDO: #ffffff"..tonumber(#spectators), textX, textY, x, y, tocolor(83, 134, 139), 0.4, "bankgothic") 
    dxDrawText("FPS: "..tonumber(getElementData(getLocalPlayer(), "fps")), textX - 0.2, textY + 15 - 0.2, x, y, tocolor(0, 0, 0, 255), 0.4, "bankgothic") 
    drawColor("#00FF00FPS: #ffffff"..tonumber(getElementData(getLocalPlayer(), "fps")), textX, textY + 15, x, y, tocolor(15, 192, 252, 255), 0.4, "bankgothic") 
    dxDrawText("$: "..tonumber(getPlayerMoney(getLocalPlayer())), textX - 0.2, textY + 15 + 15 - 0.2, x, y, tocolor(0, 0, 0, 255), 0.4, "bankgothic") 
    drawColor("#00FF00$: #ffffff"..tonumber(getPlayerMoney(getLocalPlayer())), textX, textY + 15 + 15, x, y, tocolor(15, 192, 252, 255), 0.4, "bankgothic") 
    setTimer ( updateText, 1000, 0 ) 
end 

its snoopcat script .. can some one tell me the meaning and the details of this script ??

Link to comment

Yes, this function is most likely attached to onClientRender due to the nature of dxDrawText

This function looks like it would draw (on every frame) the number of players that are spectating (perhaps spectating you?) and the respective shadow for it (so the text looks nicer). It's also drawing the FPS and money of the local player (you) and again the shadows

Perhaps you should check the wiki: https://wiki.multitheftauto.com/

They got a search function over there you can type in "onClientRender", "dxDrawText", "getElementData" and "getPlayerMoney"

Note that everything you posted here is executed CLIENT-SIDE.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...