Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- put this code in your gamemode folder and don`t forget add 'cursor.lua' in your '__resource.lua'
- -- MOUSE CURSOR SCRIPT BY M.V.
- --------[ GLOBALS ] -----
- mousedrw = 0 -- mousedrw- is mouse drawing
- mouseloaded = 0 -- mouseloaded - is mouse TXD loaded
- mousex, mousey = 0.0,0.0 -- default position (the left-top corner of the screen)
- scalex, scaley = 0.1000, 0.2500 -- change this scale x and y from types from below
- -- 0.1000, 0.2500 - huge cursor
- -- 0.1000, 0.1200 - norm cursor
- -- 0.0500, 0.0700 - mini cursor
- -------------------------
- function LoadCursor()
- if mousedrw == 0 then
- cursortxd = LoadTxd('computer')
- curstexture = GetTexture(cursortxd, 'mousepointer')
- mousedrw = 1
- end
- end
- function UnLoadCursor()
- if mousedrw == 1 then
- ReleaseTexture(curstexture)
- RemoveTxd(cursortxd)
- mousedrw = 0
- end
- end
- function CursorInZone(zonex, zoney, zonex1, zoney1)
- if mousedrw == 1 and mousex > zonex and mousex < zonex1 and mousey > zoney and mousey < zoney1 then
- return true
- else
- return false
- end
- end
- CreateThread(function() --key pressing and texture drawing
- while true do
- Wait(0)
- if mousedrw == 1 then
- if mousex > 0.999 then
- mousex = 0.999
- end
- if mousey > 0.999 then
- mousey = 0.999
- end
- mousex, mousey = GetMousePosition(_f,_f)
- DrawSprite( curstexture, mousex, mousey, scalex, scaley, 0.0, 255, 255, 255, 255)
- end
- if IsGameKeyboardKeyJustPressed(76) then -- SCANCODE_KEYPAD5
- if mouseloaded == 0 then
- LoadCursor()
- mouseloaded = 1
- elseif mouseloaded == 1 then
- UnLoadCursor()
- mouseloaded = 0
- end
- end
- end
- end)
- -- End Of File - :D Just like scilled programmers write
- -- script v1.2
- -- 1.1: bug with bottom and left side of the screen is fixed))
- -- 1.2: added CursorInZone(x,y,x1,y1)
- -- 2.0: fixed completely all bugs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement