Jump to content

BonSay~^

Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by BonSay~^

  1. Sim stanley achei um curso basico de lua na net por 104 reais e to pensando em fazer mas queria um curso que eu fizesse que eu virei vamos dizer assim "fodao" kkkk esse codecademy e pago ou gratis?
  2. Olá Rafael. este script aqui ele tem um botão para fechar o painel, que será aberto baixe ele e dê uma estudada nele; são poucas linhas, e acho que será mais fácil para você que é iniciante. ( lendo os códigos e vendo o funcionamento dele, será mais fácil aprender. assim como eu fiz ) http://multitheftautovc.blogspot.com.br ... aviso.html Hm acabei de ver aqui estava tentando axar um painel com botao em dx mas todos estao compilado e esse nao esta eu vi que na verdade nao e um botao do guieditor e botao que nao aparece ...
  3. Alguem por favor me ajuda como eu crio botao em dx?
  4. sim esta completo como eu disse eu sou iniciante
  5. Ola queria ajuda eu tentei criar um script de rainbow ( mudar cor do carro sozinho ) e esta dando esse erro ERROR: rainbow\rainbow.lua:2: bad argument #1 to 'random' (interval is empty) Eu sou iniciante em script entao se o codigo estiver errado nao me julguem eu usei setTimer,math.random,setVehicleColor function rainbow ( Veh ) local r, g, b = math.random( 139 ), math.random( 0 ), math.random( 139 ) local r, g, b = math.random( 0 ), math.random( 0 ), math.random( 255 ) local r, g, b = math.random( 128 ), math.random( 0 ), math.random( 0 ) local r, g, b = math.random( 34 ), math.random( 139 ), math.random( 34 ) local r, g, b = math.random( 218 ), math.random( 165 ), math.random( 32 ) local r, g, b = math.random( 0 ), math.random( 0 ), math.random( 0 ) setVehicleColor ( veh, math.random ) setTimer ( math.random, 5000 ) end addCommandHandler ( "colorido", rainbow )
  6. Estou com uma duvida existe algum tutourial de como criar uma hud para o mta ?
  7. Mano eu consegui tira o numero no final mas depois de um tempo a proteçao para de funciona e demora muito pra ser teletransportado da base privada
  8. Vlw mano consegui oque eu queria
  9. Use um script que spawne ele²: x, y, z = 0, 0, 5 addEventHandler ( "onPlayerJoin", root, function ( ) spawnPlayer ( source, x, y, z ) setCameraTarget ( source, source ) fadeCamera ( source, true ) end ) Da para colocar mas de 1 lugar?
  10. Sim quando o jogador esta em download ele nao spawna como normalmente para jogar ele fica bugado no cel e so consegui sair dando /register mas o mta normalmente nao e assim quando eu tirei a tela de login isso nao aconteceu mas...
  11. Aparece um erro quando aperta F2 aparece alguma coisa com Cursor Lua 20 eu axo depois eu edito aqui e mando e img
  12. Aqui nos dois so aparece o cursor mas o painel nao
  13. Nao funcionol nem trocando as linhas
  14. Eae galera eu criei um simples painel em Dx so pra mostrar os beneficios vip mas eu nao sei colocar a funçao para abrir e fechar queria que abrisse com uma tecla do teclado aqui esta o codigo addEventHandler("onClientRender", root, function() dxDrawText(" Beneficios V.I.P\nFunçoes Player\n#1 : JetPack\n#2 : Invisivel\n#3 : Velocidade 3x\n#4 : Kit Armas V.I.P\n#5 : Sniper One Hit Kill\n#6 : Vida | Colete\n#7 : Skin V.I.P\n#8 : Todas as Habilidades\nFunçoes Carro\n#1 : Indestrutivel\n#2 : Invisivel", 420, 308, 817, 512, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawLine(410 - 1, 296 - 1, 410 - 1, 512, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(598, 296 - 1, 410 - 1, 296 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(410 - 1, 512, 598, 512, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(598, 512, 598, 296 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(410, 296, 188, 216, tocolor(116, 101, 18, 70), false) end )
  15. Ola estou com um problema com minha tela de login ela funciona perfeitamente mas quem esta em download nao pode jogar tem que dar /register pra consegui mas eu nao ter que precisar fazer isso alguem me ajuda ae os codigos ServerSide function PlayerLogin(username,password,checksave) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn(source, account, password) triggerClientEvent (source,"hideLoginWindow",getRootElement()) if checksave == true then triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) else triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Nome de usuário inccorreto /ou senha errada") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Por favor insira sua senha!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Digite seu nome de usuário!") end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin) function registerPlayer(username,password,passwordConfirm) if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then outputChatBox ("" .. username .. " #00FF00| Password: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) outputChatBox ("",source,255,255,255,true ) else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","tente novamente com o novo nome de usuário ou senha!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Este nome de usuário já esta registrado!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","As senhas não combinam!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Por favor, confirme sua senha!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Por favor, digite a sua senha!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Digite seu nome de usuário!") end end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) ClientSide font1 = guiCreateFont ("font.ttf",12) font2 = guiCreateFont ("font.ttf",30) wdwLogin_Pannel = {} tabPannel_Main = {} tab_Login = {} tab_Register = {} function open_log_reg_pannel() if not(isElement(wdwLogin_Pannel)) then showChat(false) x,y = guiGetScreenSize() local sWidth,sHeight = guiGetScreenSize() local Width,Height = 550,500 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) guiSetEnabled (Image, false) Login_img = guiCreateStaticImage( X, Y + 120, 612, 316, "login_window.png", false ) guiSetEnabled (Login_img, false) --!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! shLoginLogo = guiCreateLabel( X + 0, Y + 80, 550, 60, "", false ) guiLabelSetColor(shLoginLogo,0,0,0) guiSetFont (shLoginLogo, font2) shLogin = guiCreateStaticImage( X + 450, Y + 249, 105, 35, "login.png", false ) addEventHandler("onClientGUIClick",shLogin,onClickBtnLogin) addEventHandler( "onClientMouseEnter",shLogin,LoginSH) addEventHandler("onClientMouseLeave",shLogin,SErem) edit_Login = guiCreateEdit(X + 45,Y + 202,363,44,"",false) guiSetFont (edit_Login, font1) edit_password = guiCreateEdit(X + 45,Y + 307,363,45,"",false) guiSetFont (edit_password, font1) guiEditSetMaxLength ( edit_Login,25) guiEditSetMaxLength ( edit_password,25) guiEditSetMasked ( edit_password, true ) lbl_about_legth = guiCreateLabel(142,70,184,18,"",false) guiLabelSetColor(lbl_about_legth,255,255,255) guiLabelSetVerticalAlign(lbl_about_legth,"center") guiLabelSetHorizontalAlign(lbl_about_legth,"center",false) checkbox_save = guiCreateCheckBox(X + 386,Y + 365,150,20,"",false,false) guiSetFont(checkbox_save,font1) login_tab_error_msg = guiCreateLabel(X,Y + 400,450,31,"Error_login_tab",false) guiLabelSetColor(login_tab_error_msg,255,255,255) guiLabelSetVerticalAlign(login_tab_error_msg,"center") guiLabelSetHorizontalAlign(login_tab_error_msg,"center",false) guiSetFont(login_tab_error_msg,font1) --!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! shGuest = guiCreateStaticImage( X + 450, Y + 311, 105, 35, "guest.png", false ) -- A gomb addEventHandler("onClientGUIClick",shGuest,onClickGuest) addEventHandler( "onClientMouseEnter",shGuest,GuestSH) addEventHandler("onClientMouseLeave",shGuest,SErem) lbl_reg_top_info = guiCreateLabel(X - 80,Y + 290,45,0,"",false) guiLabelSetColor(lbl_reg_top_info,255,255,255) guiLabelSetVerticalAlign(lbl_reg_top_info,"center") guiLabelSetHorizontalAlign(lbl_reg_top_info,"center",false) guiSetVisible(lbl_reg_top_info,false) edit_account_name = guiCreateEdit(X + 38,Y + 184,363,46,"",false) guiEditSetMaxLength ( edit_account_name,25) guiSetVisible(edit_account_name,false) guiSetFont (edit_account_name, font1) edit__reg_tab_password = guiCreateEdit(X + 38,Y + 275,363,46,"",false) guiEditSetMaxLength ( edit__reg_tab_password,25) guiEditSetMasked ( edit__reg_tab_password, true ) guiSetVisible(edit__reg_tab_password,false) guiSetFont (edit__reg_tab_password, font1) edit__reg_tab_Repassword = guiCreateEdit(X + 38,Y + 361,363,46,"",false) guiSetFont (edit__reg_tab_Repassword, font1) guiEditSetMaxLength ( edit__reg_tab_Repassword,25) guiEditSetMasked ( edit__reg_tab_Repassword, true ) guiSetVisible(edit__reg_tab_Repassword,false) guiSetEnabled (edit__reg_tab_Repassword, true) --!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! shRegister = guiCreateStaticImage( X + 450, Y + 280, 105, 35, "register.png", false ) addEventHandler("onClientGUIClick",shRegister,OnBtnRegister) addEventHandler( "onClientMouseEnter",shRegister,RegisterSH) addEventHandler("onClientMouseLeave",shRegister,SErem) --!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! shRegister2 = guiCreateStaticImage( X + 450, Y + 350, 105, 35, "register2.png", false ) addEventHandler("onClientGUIClick",shRegister2,onClickBtnRegister) addEventHandler( "onClientMouseEnter",shRegister2,Register2SH) addEventHandler("onClientMouseLeave",shRegister2,SErem) guiSetVisible(shRegister2,false) reg_tab_error_msg = guiCreateLabel(X,Y + 400,450,31,"Error_reg_ttab",false) guiLabelSetColor(reg_tab_error_msg,0,0,0) guiLabelSetVerticalAlign(reg_tab_error_msg,"center") guiLabelSetHorizontalAlign(reg_tab_error_msg,"center",false) guiSetFont(reg_tab_error_msg,font1) showCursor(true) guiSetText(reg_tab_error_msg, "") guiSetText(login_tab_error_msg, "") local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) else guiCheckBoxSetSelected ( checkbox_save, false ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) end end end function LoginSH () guiStaticImageLoadImage(shLogin, "sh.png" ) end function RegisterSH () guiStaticImageLoadImage(shRegister, "shr.png" ) end function Register2SH () guiStaticImageLoadImage(shRegister2, "shr2.png" ) end function GuestSH () guiStaticImageLoadImage(shGuest, "shg.png" ) end function SErem () guiStaticImageLoadImage(shLogin, "login.png" ) guiStaticImageLoadImage(shRegister, "register.png" ) guiStaticImageLoadImage(shGuest, "guest.png" ) guiStaticImageLoadImage(shRegister2, "register2.png" ) end function start_cl_resource() open_log_reg_pannel() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),start_cl_resource) function loadLoginFromXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File ) end function saveLoginToXML(username, password) local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("resetSaveXML", true) addEventHandler("resetSaveXML", getRootElement(), resetSaveXML) function onClickBtnLogin(button,state) showChat(true) showCursor(false) guiSetVisible(Image,false) guiSetVisible(shGuest, false) guiSetVisible(Image, false) guiSetVisible(shLogin, false)
  16. Copie o código novamente. Mas 1 bug quando acaba os segundos compra a vida normal mas dae compra vida devolta e n tem time pode comprar um monte de vida sem ter q esperar os 20 segundos
  17. Esta com bug sim quando acaba os segundos para comprar a vida e colete aparece -1 -2 e n da pra comprar mas
  18. Cara eu começei agoro na lua e tentei colocar time no comprar vida e colete aqui esta o codigo commando = { } tempo = 20000 function buyhealth (thePlayerSource) local money = getPlayerSourceMoney ( thePlayerSource ) if money >= 250 then if (commando[thePlayerSource]) then return outputChatBox ( "Aguarde 20 segundo para comprar Vida Novamente !!", source, 225, 0, 0 ) end outputChatBox ('#ffffff[#00FF00 Vida #ffffff] ' .. getPlayerName(thePlayerSource) .. '#ffffff Comprou Uma [#00FF00 /vida #ffffff] Por #00FF00R$: 2500', root, 255, 255, 255, true) local thePlayerhealth = getElementHealth ( thePlayerSource ) setElementHealth ( thePlayerSource, 569 ) takePlayerSourceMoney ( thePlayerSource, 2500 ) else outputChatBox("A Vida Custa 2500$!",thePlayerSource, 255, 0, 0) commando[thePlayerSource] = true setTimer( function(buyhealth) commando[thePlayerSource] = false end, tempo, 1) end addCommandHandler ( "vida", buyhealth ) commando = { } tempo = 20000 function buyarmor (thePlayerSource) local money = getPlayerMoney ( thePlayerSource ) if money >= 500 then if (commando[thePlayerSource]) then return outputChatBox ( "Aguarde 20 segundo para comprar Colete Novamente !!", source, 225, 0, 0 ) end outputChatBox ('#ffffff[#00FF00 Colete #ffffff] ' .. getPlayerName(thePlayerSource) .. '#ffffff Comprou Um [#00FF00 /colete #ffffff] Por #00FF00R$: 3500', root, 255, 255, 255, true) local thePlayerarmor = getPedArmor(thePlayerSource) setPedArmor ( thePlayerSource, 100 ) takePlayerSourceMoneyMoney ( thePlayerSource, 3500 ) else outputChatBox("O Colete Custa 3500$!",thePlayerSource, 255, 0, 0) commando[thePlayerSource] = true setTimer( function(buyarmor) commando[thePlayerSource] = false end, tempo, 1) end addCommandHandler ( "colete", buyarmor )
  19. Eu digito o /anuncio ea msg mas n aparece na tela nd
  20. Não ta folgando @_@ pra mim isso é coisa simples não demoro 5 minutos pra fazer, e eu gosto n funcionou aki mano
  21. Alguem me ajuda quando algum player no meu server esta em download ele fica bugado ele n pode jogar em quanto esta em download ele fica no ceu bugado ei sei que tem que dar /register login senha e /login login senha mas queria que n precisasse fazer isso
×
×
  • Create New...