kikos500
Members-
Posts
125 -
Joined
-
Last visited
Details
-
Gang
wiki
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
kikos500's Achievements
Sucka (13/54)
15
Reputation
-
This is a script to help add logs in a more organized way. how it works? when someone says something in chat its saved in Date_chat.txt file when someone executes a command its saved in Date_commands.txt the third file is a debug log so if any error happen in your server in any day you can check it all these features are already in mta default logs but this is different because it makes a different file everyday so logs become more organized Download https://community.multitheftauto.com/index.php?p=resources&s=details&id=14794
-
You can't decompile a script
-
How to add functions to each button help me please
kikos500 replied to gabrielslayer's topic in Scripting
Did u try fixing it urself what did debugscript 3 say? just saying doesn't help and this section is for people willing to learn scripting if u want some one to fix ur script u gotta find someone to help u or pay for a scripter -
local vip = {} local minute = 60000 local hour = minute*60 local db = dbConnect("sqlite", "vip.db") function resourceStart() dbExec(db, "CREATE TABLE IF NOT EXISTS player_vip (account TEXT, vip INT)") for i,v in pairs(getElementsByType("player")) do loadVIP(v) end end addEventHandler("onResourceStart", resourceRoot, resourceStart) function resourceStop() for i,v in pairs(getElementsByType("player")) do saveVIP(v) end end addEventHandler("onResourceStop", resourceRoot, resourceStop) function login() loadVIP(source) end addEventHandler("onPlayerLogin", getRootElement(), login) function quit() saveVIP(source) end addEventHandler("onPlayerQuit", getRootElement(), quit) function loadVIP(p) local account = getAccountName(getPlayerAccount(p)) local result = dbPoll(dbQuery(db, "SELECT vip FROM player_vip WHERE account = ?", account), -1) vip[account] = {} if not result or (type(result) == "table" and #result == 0) then dbExec(db, "INSERT INTO player_vip (account, vip) VALUES(?, ?)", account, 0) vip[account].vip = 0 return end vip[account].vip = result[1].vip vip[account].tick = getTickCount() end function saveVIP(p) local account = getAccountName(getPlayerAccount(p)) dbExec(db, "UPDATE player_vip SET vip = ? WHERE account = ?", vip[account].vip, account) end function vips(p) local account = getAccountName(getPlayerAccount(p)) if vip[account].tick then local now = getTickCount() - vip[account].tick local final = round(now/hour, 1) outputChatBox(final) if now >= hour and vip[account].vip > 0 then vip[account].vip = vip[account].vip - final end end outputChatBox(vip[account].vip) end addCommandHandler("vip", vips) function round(num, numDecimalPlaces) local mult = 10^(numDecimalPlaces or 0) return math.floor(num * mult + 0.5) / mult end did u try something like this? u don't have to use my database part i just made it to make the script work
-
local accounts = {} local DerbyDB = dbConnect("sqlite", "DD.db") function resourceStart() dbExec(DerbyDB, "CREATE TABLE IF NOT EXISTS DerbyMission (DDname, DDserial, DDscore INT , DDban )") for i,v in pairs(getElementsByType("player")) do loadAccount(v) end end addEventHandler("onResourceStart", resourceRoot, resourceStart) function resourceStop() for i,v in pairs(getElementsByType("player")) do saveAccount(v) end end addEventHandler("onResourceStop", resourceRoot, resourceStop) function join() loadAccount(source) end addEventHandler("onPlayerJoin", getRootElement(), join) function leave() saveAccount(source) end addEventHandler("onPlayerQuit", getRootElement(), leave) function saveAccount(player) if not accounts[getPlayerSerial(player)] then return end dbExec(DerbyDB, "UPDATE `DerbyMission` SET DDscore = ?, DDban = ? WHERE DDname = ? AND DDserial = ? ", accounts[getPlayerSerial(player)].DDscore, accounts[getPlayerSerial(player)].DDban, getPlayerName(player), getPlayerSerial(player)) end function loadAccount(player) local check = dbQuery( DerbyDB, ' SELECT * FROM `DerbyMission` WHERE DDname = ? AND DDserial = ? ', getPlayerName( player ) , getPlayerSerial( player ) ) local results = dbPoll( check, -1 ) accounts[getPlayerSerial(player)] = {} accounts[getPlayerSerial(player)].serial = getPlayerSerial(player) accounts[getPlayerSerial(player)].name = getPlayerName(player) if ( type( results ) == 'table' and #results == 0 or not results ) then exports ["guimessages"] : outputServer (element, "* [ Derby ]: This is the first join" , 204, 51, 255) dbExec( DerbyDB, "INSERT INTO DerbyMission VALUES (?,?,?,?)", getPlayerName(player) , getPlayerSerial(player), 0 , 0 ) accounts[getPlayerSerial(player)].DDscore = 0 accounts[getPlayerSerial(player)].DDban = 0 return end accounts[getPlayerSerial(player)].DDscore = results[1].DDscore accounts[getPlayerSerial(player)].DDban = results[1].DDban end function getScore(p) return accounts[getPlayerSerial(p)].DDscore end function setScore(p, amount) accounts[getPlayerSerial(p)].DDscore = tonumber(amount) end function getBan(p) return accounts[getPlayerSerial(p)].DDban end function setBan(p, amount) accounts[getPlayerSerial(p)].DDban = tonumber(amount) end tested and works Functions: setScore(player, amount) to edit the score to a certain amount getScore(player) to get the score setBan(player, amount) to edit the ban to a certain amount getBan(player) to get the ban
-
local DerbyDB = dbConnect("sqlite", "DD.db") local accounts = {} function resourceStart() dbExec(DerbyDB, "CREATE TABLE IF NOT EXISTS DerbyMission (DDname, DDserial, DDscore INT , DDban )") for i,v in pairs(getElementsByType("player")) loadAccount(v) end end addEventHandler("onResourceStart", resourceRoot, resourceStart) function resourceStop() for i,v in pairs(getElementsByType("player")) saveAccount(v) end end addEventHandler("onResourceStop", resourceRoot, resourceStop) function join() loadAccount(source) end addEventHandler("onPlayerJoin", getRootElement(), resourceStop) function leave() saveAccount(source) end addEventHandler("onPlayerQuit", getRootElement(), resourceStop) function saveAccount(player) if not accounts[player] then return end dbExec("UPDATE `DerbyMission` SET DDscore = ?, DDban = ? WHERE DDname = ? AND DDserial = ? ", accounts[player].DDscore, accounts[player].DDban, getPlayerName(player), getPlayerSerial(player)) end function loadAccount(player) local check = dbQuery( DerbyDB, ' SELECT * FROM `DerbyMission` WHERE DDname = ? AND DDserial = ? ', getPlayerName( player ) , getPlayerSerial( player ) ) local results = dbPoll( check, -1 ) accounts[getPlayerSerial(player)] = {} accounts[getPlayerSerial(player)].serial = getPlayerSerial(player) accounts[getPlayerSerial(player)].name = getPlayerName(player) if ( type( results ) == 'table' and #results == 0 or not results ) then exports ["guimessages"] : outputServer (element, "* [ Derby ]: This is the first join" , 204, 51, 255) dbExec( DerbyDB, "INSERT INTO DerbyMission VALUES (?,?,?,?)", getPlayerName(player) , getPlayerSerial(player), 0 , 0 ) accounts[getPlayerSerial(player)].DDscore = 0 accounts[getPlayerSerial(player)].DDban = 0 else accounts[getPlayerSerial(player)].DDscore = results[1].DDscore accounts[getPlayerSerial(player)].DDban = results[1].DDban end end function setScore(p, DDscore, DDban) if accounts[getPlayerSerial(p)] and type(accounts[getPlayerSerial(p)]) == "table" then if DDscore then accounts[getPlayerSerial(p)].DDscore = DDscore end if DDban then accounts[getPlayerSerial(p)].DDban = DDban end end end should work not tested
-
@Ridden DGS = exports.dgs matable = {} matable.window = DGS:dgsDxCreateWindow (0.10, 0.28, 0.78, 0.29, "VIP panel", true) matable.button = DGS:dgsDxCreateButton(0.34, 0.77, 0.31, 0.18, "set", true, window) matable.label = DGS:dgsCreateLabel(0.42, 0.31, 0.36, 0.43, "TrollSkin", true, window) function outputEditBox () if source == matable.button then setElementModel(getLocalPlayer(), 10) print("skin of"..getPlayerName(getLocalPlayer()).."has been changed to VIP Troll Skin", 10, 186, 31) else print("don't work") end end function guiToggleVisible() if (DGS:dgsDxGUIGetVisible(matable.window) == true) then DGS:dgsDxGUISetVisible (matable.window, false) showCursor(false) print("works2") else DGS:dgsDxGUISetVisible(matable.window, true) showCursor(true) end end bindKey ("F2", "down", guiToggleVisible) addEvent("onClientDgsDxMouseClick", true) addEventHandler("onClientDgsDxMouseClick", matable.button, outputEditBox ) didn't really test but it should work
-
as nexus said scripting section is for people willing to learn if you want someone to make/edit a script for you, you should post at "Looking for staff" section
-
local markers = { {1187,-1313,-13.5,"cylinder", 2, 0, 255, 255, 0}, --Hospital {2035,-1429,16.9,"cylinder", 2, 0, 255, 255, 0}, -- Hospital {-2192,-2291,30.6,"cylinder", 2, 0, 255, 255, 0}, --Hospital {-2654,632,14.4,"cylinder", 2, 0, 255, 255, 0}, --Hospital {-1505,2533,55.68,"cylinder", 2, 0, 255, 255, 0}, --Hospital {-326,1063,19.7,"cylinder", 2, 0, 255, 255, 0}, --Hospital {1608,1838,10.8,"cylinder", 2, 0, 255, 255, 0} --Hospital } function create() -- create a function to createMarkers on resource start for _, marker in pairs(markers) do -- looping through the table of markers createMarker(unpack(marker)) --[[ if this doesn't work then try this createMarker(marker[1], marker[2], marker[3], marker[4], marker[5], marker[6], marker[7], marker[8], marker[9]) ]] end end addEventHandler("onClientResourceStart", resourceRoot, create) -- attaching the event your code will never work i advise you to use debugscript 3 to debug your scripts anyway i don't fully understand what you want to do but i fixed the creating markers part
-
Passing table from server side to client failed?
kikos500 replied to Protagonist95's topic in Scripting
--Serverside function selectMembersList ( playerSource ) local connection = dbConnect( "sqlite", "data.db" ) local qh = dbQuery( connection, "SELECT member_login FROM gang_members WHERE gang_id = ?",selectGangIDBySerial(getPlayerSerial(playerSource))) local result = dbPoll ( qh, -1 ) local group_members = {} for _, row in ipairs ( result ) do local player = getPlayerFromSerial(row["member_login"]) table.insert(group_members,getPlayerSerial(player)) end triggerClientEvent("resendValues", source, group_members) return group_members --table is ok at this point end addEvent( "selectMembersListEvent", true ) addEventHandler( "selectMembersListEvent", resourceRoot, selectMembersList ) --Clientside function addGroupMembers() group_members = triggerServerEvent("selectMembersListEvent",resourceRoot,getLocalPlayer()) end addEventHandler( "onClientResourceStart",resourceRoot,addGroupMembers) function recieveValue(group_members) for _,value in ipairs(group_members) do -- table expected,got boolean outputChatBox(value) end end addEvent("resendValues", true) addEventHandler("resendValues", resourceRoot, recieveValue) this should work the way u want it but why don't u do something like this ----- --Serverside function selectMembersList() local connection = dbConnect("sqlite", "data.db" ) local qh = dbQuery(connection, "SELECT member_login FROM gang_members WHERE gang_id = ?", selectGangIDBySerial(getPlayerSerial(source))) local result = dbPoll(qh, -1 ) local group_members = {} for _, row in ipairs (result) do local player = getPlayerFromSerial(row["member_login"]) table.insert(group_members, getPlayerSerial(player)) end triggerClientEvent("resendValues", source, group_members) end addEvent("selectMembersListEvent", true) addEventHandler("selectMembersListEvent", resourceRoot, selectMembersList) --Clientside function addGroupMembers() triggerServerEvent("selectMembersListEvent", getLocalPlayer()) end addEventHandler("onClientResourceStart", resourceRoot, addGroupMembers) function recieveValue(group_members) for _,value in ipairs(group_members) do -- table expected,got boolean outputChatBox(value) end end addEvent("resendValues", true) addEventHandler("resendValues", resourceRoot, recieveValue) -
local num = 0 local tick = getTickCount() addEventHandler("onClientRender", getRootElement(), function () if tick+5000 <= getTickCount() then if num >= 10 then num = 0 end tick = getTickCount() num = num + 1 outputDebugString(num) end end) local num = 0 local negative = false local tick = getTickCount() addEventHandler("onClientRender", getRootElement(), function () if tick+5000 <= getTickCount() then if num >= 10 then negative = true elseif num <= 1 then negative = false end tick = getTickCount() if not negative then num = num + 1 else num = num - 1 end outputDebugString(num) end end)
-
showCursor(true) local screenW, screenH = guiGetScreenSize() local start = getTickCount() local positions = { {0, (screenH - 268) / 2, animation = "Linear", duration = 800, tick = getTickCount()}, -- Main Menu 1 {-200, 240, animation = "Linear", duration = 800, tick = getTickCount()}, -- Dev Label 2 {50, 284, animation = "Linear", duration = 800, tick = getTickCount()}, -- Username Label 3 {135, 356, animation = "Linear", duration = 800, tick = getTickCount()}, -- Password Label 4 {78, 306, animation = "Linear", duration = 800, tick = getTickCount()}, -- Username Editbox 5 {160, 378, animation = "Linear", duration = 800, tick = getTickCount()}, -- Password Editbox 6 {86, 312, animation = "Linear", duration = 800, tick = getTickCount()}, -- Username Text 7 {170, 384, animation = "Linear", duration = 800, tick = getTickCount()}, -- Password Text 8 {8, 423, animation = "Linear", duration = 800, tick = getTickCount()}, -- Remember Details Label 9 {215, 423, animation = "Linear", duration = 800, tick = getTickCount()}, -- Remember Details Checkbox 10 {240, 470, animation = "Linear", duration = 800, tick = getTickCount()}, -- Automated Login Label 11 {35, 448, animation = "Linear", duration = 800, tick = getTickCount()}, -- Automated Login Checkbox 12 {220, 436, animation = "Linear", duration = 800, tick = getTickCount()}, -- Login Text 13 {10, 435, animation = "Linear", duration = 800, tick = getTickCount()}, -- Login Button 14 {225, 478, animation = "Linear", duration = 800, tick = getTickCount()}, -- Register an account label 15 } local dummyTicks = {} function draw() for i,pos in pairs(positions) do positions[i].moving = animate(pos[1], pos[2], pos.animation, pos.duration, function () end, pos.tick) end dxDrawRectangle((screenW - 386) / 2, positions[1].moving, 386, 268, tocolor(13, 23, 26, 178), false) dxDrawText("Welcome to the server!", 447, positions[2].moving, 833, 253, tocolor(255, 255, 255, 255), 0.90, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Username :", 468, positions[3].moving, 531, 302, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) dxDrawText("Password :", 468, positions[4].moving, 527, 372, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) dxDrawRectangle(468, positions[5].moving, 345, 28, tocolor(93, 93, 93, 174), false) -- Username Editbox dxDrawRectangle(467, positions[6].moving, 345, 28, tocolor(93, 93, 93, 174), false) -- Password Editbox dxDrawText("Username", 474, positions[7].moving, 807, 325, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("*************", 474, positions[8].moving, 807, 397, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Automated Login", 492, positions[11].moving, 600, 438, tocolor(255, 255, 255, 255), 1.00, "arial", "left", "center", false, false, false, false, false) dxDrawRectangle(467, positions[12].moving, 15, 15, tocolor(94, 94, 94, 225), false) dxDrawText("Remember Details", 492, positions[9].moving, 600, 438, tocolor(255, 255, 255, 255), 1.00, "arial", "left", "center", false, false, false, false, false) dxDrawRectangle(467, positions[10].moving, 15, 15, tocolor(94, 94, 94, 225), false) dxDrawRectangle(715, positions[13].moving, 97, 28, tocolor(94, 94, 94, 225), false) dxDrawText("LOGIN", 714, positions[14].moving, 812, 464, tocolor(255, 255, 255, 255), 1.20, "arial", "center", "center", false, false, false, false, false) dxDrawText("Don't have an account? Register at - www.vigour-gaming.com", 446, positions[15].moving, 833, 494, tocolor(255, 255, 255, 255), 0.80, "arial", "center", "top", false, false, false, false, false) if isMouseInPosition(440, positions[5].moving, 390, 37) then if not dummyTicks[1] then dummyTicks[1] = getTickCount() resetOtherTicks(1) end local movingX = animate(0, 345, "Linear", 300, function() end, dummyTicks[1]) dxDrawRectangle(468, 334, movingX, 1, tocolor(208, 166, 38, 174), false) -- Username Editbox Active elseif isMouseInPosition(467, positions[6].moving, 345, 28) then if not dummyTicks[2] then dummyTicks[2] = getTickCount() resetOtherTicks(2) end local movingX = animate(0, 345, "Linear", 300, function() end, dummyTicks[2]) dxDrawRectangle(467, 406, movingX, 1, tocolor(208, 166, 38, 174), false) -- Password Editbox Active elseif isMouseInPosition(467, positions[10].moving, 15, 15) then if not dummyTicks[3] then dummyTicks[3] = getTickCount() resetOtherTicks(3) end local movingX = animate(0, 15, "OutQuad", 300, function() end, dummyTicks[3]) dxDrawRectangle(467, 423, movingX, movingX, tocolor(208, 166, 38, 174), false) -- Checkbox 1 is active? elseif isMouseInPosition(467, positions[12].moving, 15, 15) then if not dummyTicks[4] then dummyTicks[4] = getTickCount() resetOtherTicks(4) end local movingX = animate(0, 15, "OutQuad", 300, function() end, dummyTicks[4]) dxDrawRectangle(467, 448, movingX, movingX, tocolor(208, 166, 38, 174), false) -- Checkbox 2 is active? elseif isMouseInPosition(714, positions[13].moving, 97, 28) then if not dummyTicks[5] then dummyTicks[5] = getTickCount() resetOtherTicks(5) end local movingX = animate(0, 97, "OutQuad", 300, function() end, dummyTicks[5]) local movingY = animate(0, 28, "OutQuad", 300, function() end, dummyTicks[5]) dxDrawRectangle(714, 436, movingX, movingY, tocolor(208, 166, 38, 174), false) -- login button is active? else resetAllTicks() end end addEventHandler( "onClientRender", getRootElement(), draw) function resetOtherTicks(currentTick) for i,v in pairs(dummyTicks) do if (currentTick and i ~= currentTick) then dummyTicks[i] = nil end end end function resetAllTicks() for i,v in pairs(dummyTicks) do dummyTicks[i] = nil end end function animate(from, to, easing, duration, endfunction, tick) local now = getTickCount() local change = interpolateBetween(from, 0, 0, to, 0, 0, (now - tick) / duration, easing) if endfunction and now >= tick+duration then endfunction() end return change end function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end im not sure if its the best way but it works
-
showCursor(true) local screenW, screenH = guiGetScreenSize() outputChatBox(((screenH - 268) / 2)) local positions = { {50, (screenH - 268) / 2, animation = "Linear", duration = 800}, -- Main Menu 1 {-200, 240, animation = "Linear", duration = 800}, -- Dev Label 2 } local start = getTickCount() function draw() for i,pos in pairs(positions) do positions[i].moving = animate(pos[1], pos[2], pos.animation, pos.duration, function () end) end dxDrawRectangle((screenW - 386) / 2, positions[1].moving, 386, 268, tocolor(13, 23, 26, 178), false) dxDrawText("Welcome to the server!", 447, (positions[2].moving), 833, 253, tocolor(0,0,0, 255), 0.90, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Username :", 468, (positions[1].moving+18), 531, 302, tocolor(0,0,0, 255), 1.00, "default", "left", "top", false, false, false, false, false) end addEventHandler( "onClientRender", getRootElement(), draw) function animate(from, to, easing, duration, endfunction) local now = getTickCount() local change = interpolateBetween(from, 0, 0, to, 0, 0, (now - start) / duration, easing) if endfunction and now >= start+duration then endfunction() end return change end function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end this is just an example but u could do this to prevent things from out-of sync the point in this code is instead of animating every item (button, label, edit) you animate the window then adding to the Y of the animated Window the position of y i gave an example in code
-
i just edited the animate function to work with onClientRender and the positions are an error in the code i think
-
showCursor(true) local screenW, screenH = guiGetScreenSize() local positions = { {0, (screenH - 268) / 2, animation = "Linear", duration = 800}, -- Main Menu 1 {-200, 240, animation = "Linear", duration = 800}, -- Dev Label 2 {50, 284, animation = "Linear", duration = 800}, -- Username Label 3 {135, 356, animation = "Linear", duration = 800}, -- Password Label 4 {78, 306, animation = "Linear", duration = 800}, -- Username Editbox 5 {160, 378, animation = "Linear", duration = 800}, -- Password Editbox 6 {86, 312, animation = "Linear", duration = 800}, -- Username Text 7 {170, 384, animation = "Linear", duration = 800}, -- Password Text 8 {8, 423, animation = "Linear", duration = 800}, -- Remember Details Label 9 {215, 423, animation = "Linear", duration = 800}, -- Remember Details Checkbox 10 {240, 448, animation = "Linear", duration = 800}, -- Automated Login Label 11 {35, 448, animation = "Linear", duration = 800}, -- Automated Login Checkbox 12 {220, 436, animation = "Linear", duration = 800}, -- Login Text 13 {10, 435, animation = "Linear", duration = 800}, -- Login Button 14 {225, 478, animation = "Linear", duration = 800} -- Register an account label 15 } local start = getTickCount() function draw() for i,pos in pairs(positions) do positions[i].moving = animate(pos[1], pos[2], pos.animation, pos.duration, function () end) end dxDrawRectangle((screenW - 386) / 2, positions[1].moving, 386, 268, tocolor(13, 23, 26, 178), false) dxDrawText("Welcome to the server!", 447, positions[2].moving, 833, 253, tocolor(255, 255, 255, 255), 0.90, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Username :", 468, positions[3].moving, 531, 302, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) dxDrawText("Password :", 468, positions[4].moving, 527, 372, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) dxDrawRectangle(468, positions[5].moving, 345, 28, tocolor(93, 93, 93, 174), false) -- Username Editbox dxDrawRectangle(467, positions[6].moving, 345, 28, tocolor(93, 93, 93, 174), false) -- Password Editbox dxDrawText("Username", 474, positions[7].moving, 807, 325, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("*************", 474, positions[8].moving, 807, 397, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Automated Login", 492, positions[9].moving, 600, 438, tocolor(255, 255, 255, 255), 1.00, "arial", "left", "center", false, false, false, false, false) dxDrawRectangle(467, positions[10].moving, 15, 15, tocolor(94, 94, 94, 225), false) dxDrawText("Remember Details", 492, positions[11].moving, 600, 438, tocolor(255, 255, 255, 255), 1.00, "arial", "left", "center", false, false, false, false, false) dxDrawRectangle(467, positions[12].moving, 15, 15, tocolor(94, 94, 94, 225), false) dxDrawRectangle(715, positions[13].moving, 97, 28, tocolor(94, 94, 94, 225), false) dxDrawText("LOGIN", 714, positions[14].moving, 812, 464, tocolor(255, 255, 255, 255), 1.20, "arial", "center", "center", false, false, false, false, false) dxDrawText("Don't have an account? Register at - www.vigour-gaming.com", 446, positions[15].moving, 833, 494, tocolor(255, 255, 255, 255), 0.80, "arial", "center", "top", false, false, false, false, false) if isMouseInPosition(440, 295, 390, 37) then local movingX = animate(0, 345, "Linear", 300, function() end) dxDrawRectangle(468, 334, movingX, 1, tocolor(208, 166, 38, 174), false) -- Username Editbox Active end if isMouseInPosition(467, 378, 345, 28) then local movingX = animate(0, 345, "Linear", 300, function() end) dxDrawRectangle(467, 406, movingX, 1, tocolor(208, 166, 38, 174), false) -- Password Editbox Active end if isMouseInPosition(467, 423, 15, 15) then local movingX = animate(0, 15, "OutQuad", 300, function() end) dxDrawRectangle(467, 423, movingX, movingX, tocolor(208, 166, 38, 174), false) -- Checkbox 1 is active? end if isMouseInPosition(467, 448, 15, 15) then local movingX = animate(0, 15, "OutQuad", 300, function() end) dxDrawRectangle(467, 448, movingX, movingX, tocolor(208, 166, 38, 174), false) -- Checkbox 2 is active? end if isMouseInPosition(714, 436, 97, 28) then local movingX = animate(0, 97, "OutQuad", 300, function() end) local movingY = animate(0, 28, "OutQuad", 300, function() end) dxDrawRectangle(714, 436, movingX, movingY, tocolor(208, 166, 38, 174), false) -- login button is active? end end addEventHandler( "onClientRender", getRootElement(), draw) function animate(from, to, easing, duration, endfunction) local now = getTickCount() local change = interpolateBetween(from, 0, 0, to, 0, 0, (now - start) / duration, easing) if endfunction and now >= start+duration then endfunction() end return change end function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end full tested and working