Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. xXMADEXx

    Help resource

    how I can modify it as well?, I did well, but I have bad button... (the button is called "invitado") Screen 1: http://imageshack.us/a/img692/6351/pti2.png Screen 2: http://imageshack.us/a/img692/6351/pti2.png Client... local enableGuest = true; local sx, sy = guiGetScreenSize ( ) local pX, pY = ( sx / 2 - 485 / 2 ), ( sy / 2 - 231 / 2 ) local username = guiCreateEdit(pX+156, pY+61, 288, 33, "", false) guiSetVisible ( username, false ) local password = guiCreateEdit(pX+156, pY+121, 288, 33, "", false) guiSetVisible ( password, false ) guiEditSetMasked(password, true) local window = guiCreateWindow( ( sx / 2 - 266 / 2 ), ( sy / 2 - 208 / 2 ), 266, 208, "Error", false) guiWindowSetMovable(window, false) guiWindowSetSizable(window, false) guiSetVisible ( window, false ) guiSetAlpha ( window, 1 ) local exitBtn = guiCreateButton(155, 162, 101, 36, "Salir", false, window) local infoLbl = guiCreateLabel(18, 26, 228, 130, "Mensaje", false, window) local isOpen = false; local isLoggedin = false; local data = { login = { hovering = false, alphaMode = false, loginTextAlpha = 235, colors = { 255, 255, 255 } }, reg = { hovering = false, alphaMode = false, loginTextAlpha = 235, colors = { 255, 255, 255 } }, guest = { hovering = false, alphaMode = false, loginTextAlpha = 235, colors = { 255, 255, 255 } } } function dxDrawLoginPanel( ) -- default: 350, 266 if ( isOpen ) then dxDrawRectangle(pX, pY, 485, 231, tocolor(0, 0, 0, 180), false) dxDrawRectangle(pX, pY+231, 100, 19, tocolor(0, 0, 0, 180), false) dxDrawText("Login", pX-220, pY, 870, 314, tocolor(0, 128, 255, 255), 1.50, "bankgothic", "center", "top", false, false, false, false, false) dxDrawLine(pX, pY+48, pX+485, pY+48, tocolor(255, 128, 0, 255), 1, false) dxDrawText("Usuario:", pX+10, pY+69, 506, 368, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Password:", pX+10, pY+129, 506, 428, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawLine(pX+281, pY+168, pX+281, pY+168+34, tocolor(255, 128, 0, 255), 1, false) local r, g, b = unpack ( data.login.colors ) dxDrawText("Login", pX+156, pY+167, 600, 468, tocolor( r, g, b, data.login.loginTextAlpha), 1.00, "bankgothic", "left", "top", false, false, false, false, false) local r, g, b = unpack ( data.reg.colors ) dxDrawText("Register", pX+300, pY+167, 794, 468, tocolor(r, g, b, data.reg.loginTextAlpha), 1.00, "bankgothic", "left", "top", false, false, false, false, false) if ( enableGuest ) then local r, g, b = unpack ( data.guest.colors ) dxDrawText("Invitado", pX+105, pY+230, 150, 10, tocolor( r, g, b, data.guest.loginTextAlpha), 0.5, "bankgothic", "center", "top", false, false, false, false, false) end -- give fade effect if ( data.login.hovering ) then data.login.colors = { 0, 128, 255 } local alpha = data.login.loginTextAlpha if ( not data.login.alphaMode ) then data.login.loginTextAlpha = alpha - 5 if ( data.login.loginTextAlpha <= 50 ) then data.login.alphaMode = true end else data.login.loginTextAlpha = alpha + 5 if ( data.login.loginTextAlpha >= 235 ) then data.login.alphaMode = false end end elseif ( data.reg.hovering ) then data.reg.colors = { 0, 128, 255 } local alpha = data.reg.loginTextAlpha if ( not data.reg.alphaMode ) then data.reg.loginTextAlpha = alpha - 5 if ( data.reg.loginTextAlpha <= 50 ) then data.reg.alphaMode = true end else data.reg.loginTextAlpha = alpha + 5 if ( data.reg.loginTextAlpha >= 235 ) then data.reg.alphaMode = false end end elseif ( data.guest.hovering ) then data.guest.colors = { 0, 128, 255 } local alpha = data.guest.loginTextAlpha if ( not data.guest.alphaMode ) then data.guest.loginTextAlpha = alpha - 5 if ( data.guest.loginTextAlpha <= 50 ) then data.guest.alphaMode = true end else data.guest.loginTextAlpha = alpha + 5 if ( data.guest.loginTextAlpha >= 235 ) then data.guest.alphaMode = false end end else data.login.loginTextAlpha = 235 data.guest.loginTextAlpha = 235 data.reg.loginTextAlpha = 235 data.login.colors = { 255, 255, 255 } data.guest.colors = { 255, 255, 255 } data.reg.colors = { 255, 255, 255 } end end end function cursorMove ( _, _, x, y ) if ( isCursorShowing ( ) and not guiGetVisible ( window ) and isOpen) then if ( y >= pY+170 and y <= pY+200 ) then if ( x >= pX+161 and x <= pX+251 ) then data.login.hovering = true return elseif ( x >= pX+305 and x <= pX+445 ) then data.reg.hovering = true return elseif ( y <= pY+15 and y >= pY+91 ) then elseif ( x >= pX+10 and x <= pX+91 ) then data.guest.hovering = true return end end end data.login.hovering = false data.reg.hovering = false data.guest.hovering = false end function openLogin ( ) addEventHandler ( "onClientPreRender", root, dxDrawLoginPanel ) addEventHandler ( 'onClientCursorMove', root, cursorMove ) addEventHandler ( "onClientClick", root, clientClicking ) guiSetInputMode ( "no_binds_when_editing" ) guiSetVisible ( password, true ) guiSetVisible ( username, true ) showCursor ( true ) addEventHandler ( 'onClientGUIClick', root, clientClosingErrorWindowEvent ) isOpen = true showChat(false) showPlayerHudComponent ( 'all', false ) end addEvent ( "onClientPlayerLogout", true ) addEventHandler ( 'onClientPlayerLogout', root, openLogin ) function closeLogin ( ) removeEventHandler ( "onClientPreRender", root, dxDrawLoginPanel ) removeEventHandler ( 'onClientCursorMove', root, cursorMove ) removeEventHandler ( "onClientClick", root, clientClicking ) guiSetVisible ( password, false ) guiSetVisible ( username, false ) showCursor ( false ) removeEventHandler ( 'onClientGUIClick', root, clientClosingErrorWindowEvent ) guiSetVisible ( window, false ) isOpen = false isLoggedin = true showChat(true) showPlayerHudComponent ( 'all', true ) end addEvent ( "onClientPlayerLogin", true ) addEventHandler ( "onClientPlayerLogin", root, closeLogin ) function sendError ( msg ) if ( not guiGetVisible ( window ) ) then guiSetVisible ( window, true ) guiSetText ( infoLbl, msg ) guiBringToFront ( window ) end end addEvent ( "onPlayerLoginPanelError", true ) addEventHandler ( "onPlayerLoginPanelError", root, sendError ) function clientClicking ( btn, state, x, y ) if ( btn == 'left' and not guiGetVisible ( window ) and state == 'down' and isOpen ) then if ( y >= pY+170 and y <= pY+200 ) then local user, pass = guiGetText ( username ), guiGetText ( password ) -- Login Button -- if ( x >= pX+156 and x <= pX+246 ) then if ( string.gsub ( user, ' ', '' ) ~= '' and string.gsub ( pass, ' ', '' ) ~= '' ) then if ( string.find ( user, '%s' ) ) then return sendError ( "Los espacios (' ') no estan permitido \npara colocarlo en el usuario." ) end if ( string.find ( pass, '%s' ) ) then return sendError ( "Los espacios (' ') no estan permitido \npara colocarlo en la password." ) end triggerServerEvent ( "Login:onClientAttemptLogin", localPlayer, user, pass ) else sendError ( "Un usuario y contraseña es requerido \npara ingresar al server..." ) end -- register button elseif ( x >= pX+300 and x <= pX+440 ) then if ( string.gsub ( user, ' ', '' ) ~= '' and string.gsub ( pass, ' ', '' ) ~= '' ) then if ( string.find ( user, '%s' ) ) then return sendError ( "No se permiten espacios \nen el usuario." ) end if ( string.find ( pass, '%s' ) ) then return sendError ( "No se permiten espacios \nen la contraseña." ) end if ( string.len ( user ) < 5 ) then return sendError ( "El usuario debe tener \ncomo minimo 5 caracteres de largo." ) end if ( string.len ( pass ) < 6 ) then return sendError ( "La contraseña debe tener \ncomo mínimo 6 caracteres de largo." ) end triggerServerEvent ( "Login:onClientAttemptRegistration", localPlayer, user, pass ) else sendError ( "Un usuario y contraseña es requerido \npara ingresar al server..." ) end -- play as guest elseif ( x >= pX+10 and x <= pX+91 ) then closeLogin ( ) triggerServerEvent ( "Login:doClientGuestLogin", localPlayer ) end end end end function clientClosingErrorWindowEvent( ) if ( source == exitBtn ) then guiSetVisible ( window, false ) end end function isClientLoggedin ( ) return isLoggedin end setTimer ( function ( ) openLogin ( ) end, 700, 1 ) What do you mean..?
  2. um... No, im trying to help you learn. You'll never learn anything if people do it for you.
  3. Hello, xXMADEXx here. So, some of you may know about my website that I share with a few other scripts, Revolution of Scripts. Well, recently Paypal has disabled my account for not being 18 years of age. Well, when they locked my account, they made it so that I cannot send money as well as they locked my card from Paypal. So, I went in and created a new account so that I have an account that isn't locked. When doing this I lost all my funds that were on my old account because of this we have no money to pay for the RoS hosting. We are asking for a couple of donators who would be that would pay $3/month (you can quit whenever you want) who would pay for our hosting so that we can continue making free & usefull scripts for the community . Feel free to PM me any questions. Donation Link: Here Thank you.
  4. Your syntax is all messed up. You should read this: http://w3schools.com/sql/default.asp
  5. "setElementVisibleTo" is a server function and localPlayer is a client variable. Here is a code that I have (client-side): function fixBlipRanges ( ) for index, blip in ipairs ( getElementsByType ( 'blip' ) ) do local id = getBlipIcon ( blip ) if ( id > 1 and id ~= 41 ) then setBlipVisibleDistance ( blip, 300 ) end end end
  6. admin panel -> resources -> Manager ACL -> Double Click the "Admin" group -> Add Object -> Text: resource.login then restart the login resource.
  7. Use the findRotation function. i dont know If you don't know, there is no need to reply.
  8. xXMADEXx

    Help resource

    It'd be nice if you kept my credits on the script... No need to continue this topic. Im making guest mode for the login panel now. Edit: I added the guest button. https://community.multitheftauto.com/index.php?p= ... ls&id=7970
  9. Here are examples that might help you. Example 1 - triggerServerEvent -- Client local v = math.random ( 0, 9999 ) triggerServerEvent ( "theServerEvent", localPlayer, v ) -- Server addEvent ( "theServerEvent", true ) addEventHandler ( "theServerEvent", root, function ( v ) outputChatBox ( "You have generated "..tostring ( v ) ) end ) Example 2 - triggerClientEvent -- Server local v = math.random ( 0, 255 ) local p = getRandomPlayer ( ) triggerClientEvent ( p, 'theclienteventname', p, v ) -- Client addEvent ( "theclienteventname", true ) addEventHandler ( "theclienteventname", root, function ( v ) outputChatBox ( "You have been picked!! Heres a random number: "..tostring ( v ) ) end )
  10. xXMADEXx

    F11

    The way i'd probably do it is by disabling F11 and then when a player press F11 use dxDrawImage
  11. Not a request page. Browse the community. https://community.multitheftauto.com/
  12. Um, did you just try to get the account of a vehicle? lol
  13. xXMADEXx

    Site

    Humm.... Mentioning the UCP thing it does sound like VG scripts...
  14. This page isn't for requesting...
  15. Make sure that the guieditor resource is running, and make sure to put the .ttf file in the meta.xml
  16. xXMADEXx

    toJSON

    Hello. I have this problem, for some reason toJSON won't load my entire table. Here is the code: local candidates = { { 'Khalil', 0 }, { 'Omega', 0 }, { 'Redbull', 0 }, { 'Pillow', 0 }, { 'xXMADEXx', 0 }, { 'Zach', 0 } , { 'Jericho', 0 }, { 'CyberDax', 0 }, { 'Pie', 0 }, { 'Mr.Shariq', 0 }, { 'Turbo-X', 0 }, { 'Snoop', 0 }, { 'Shadow', 0 }, { 'Sky', 0 }, { 'Mr.Tom', 0 }, { 'Mody', 0 }, { 'Misho', 0 }, } local hasVoted = { } -- More stuff though here, but you don't need it. addEventHandler ( "onResourceStop", resourceRoot, function ( ) local vals = { candidates, hasVoted } local json = toJSON ( vals ) setAccountData ( getAccount ( "Console" ), "ElectionData", json ) end ) And, here is what it does: (http://img27.imageshack.us/img27/496/qlhb.png)
  17. you need to put messages in a string. Otherwise, the server will be looking for an invalid variable.
  18. xXMADEXx

    Farmer

    createTeam ( "farmer", 0, 255, 0 ) local Marker = createMarker ( 670.69952392578, 906.75018310547, -40.3984375, "cylinder", 1, 255, 255, 255, 0 ) local Elem = createObject ( 3409, 670.69952392578, 906.75018310547, -40.3984375, 90, 0, 0 ) function onmarkethit ( p ) if ( weapon == 23 ) then if ( isElement ( Elem ) ) then destroyElement ( Elem ) end if ( isElement ( Marker ) ) then destroyElement ( Marker ) end givePlayerMoney ( p, 5000 ) end end addEventHandler ( "onMarkerHit", Marker onmarkerhit )
  19. I agree.. Compiling should be optional.
  20. you need to set friendly fire, after the team is created. Otherwise, teamtaxi/teampolice are nil and not defined yet.
  21. If you guys don't like it, its not that hard to make a new tutorial.
  22. Help me please i want that when digit /adm appears written on the character Administrator I know uses dxDrawText help me Thanks I don't understand, please fix your English (Not trying to be rude...)
×
×
  • Create New...