Jump to content

hxv

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by hxv

  1. hxv

    Login.

    local acc = mysql_query(connect, "SELECT * FROM `accounts` WHERE `login` = '" .. login .. "' AND `password` = '" .. pass .. "'")
  2. I don't know from where you have got it. If you don't know what is this I can say that you stole this script.
  3. Im not sure that xml is a bad way. You can use my xmldb. Thank's xmldb you can make your databases in xml file. https://community.multitheftauto.com/index.php?p= ... ls&id=2250
  4. hxv

    Mute mapmusic.

    You can make variable local turnedOn = false function toggleRadioGUI() if turnedOn == false then turnedOn = true -- here radio is running else turnedOn = false -- here radio is turned off end end then just put condition : if turnedOn == false then .... and something like that
  5. hxv

    timer

    It's all on wiki, just read it all https://wiki.multitheftauto.com/wiki/getTickCount This function returns amount of time that your system has been running in milliseconds. By comparing two values of getTickCount, you can determine how much time has passed (in milliseconds) between two events. This could be used to determine how efficient your code is, or to time how long a player takes to complete a task.
  6. Why? xml is very popular in these times, there are few ways to store your data: - MySQL - xml - or your own unknown way ( I have created one time file with .data format and scripted it to little database )
  7. hxv

    Login.

    server side: addEventHandler("onPlayerLogin", localPlayer, function() -- here your code to hide dx and gui end ) The dx or GUI will not hide when you will write bad login or pass without any conditions.
  8. hxv

    Login.

    client, I have changed false) to ,false) addEventHandler("onClientResourceStart",root, function() loginButton = guiCreateButton(634, 323, 117, 37, "Zaloguj!", false) loginPassLabel = guiCreateLabel(481, 244, 48, 56, "Login:\n\n\nHaslo:", false) guiSetFont(loginPassLabel,"default-bold-small") registerLabel = guiCreateLabel(363, 424, 397, 86, "Jesli nie posiadasz konta, udaj sie na nasze forum i zarejestruj konto.\nKolejnym krokiem bedzie zalozenie postaci.\n\n\n[url=http://www.LostHeaven.pl]http://www.LostHeaven.pl[/url]", false) guiSetFont(registerLabel,"default-bold-small") loginBox = guiCreateEdit(525, 241, 145, 23, "", false) guiEditSetMaxLength(loginBox, 25) passBox = guiCreateEdit(525, 281, 145, 23, "", false) guiEditSetMasked(passBox, true) guiEditSetMaxLength(passBox, 30) keyImage = guiCreateStaticImage(358, 237, 111, 94, "images/Key.png", false) outputChatBox("Dupa1") addEventHandler("onClientGUIClick", loginButton, function clientSubmitLogin(button, state) if button == "left" and state == "up" then local login = guiGetText(loginBox) local pass = guiGetText(passBox) if login and pass then triggerServerEvent("submitLogin", localPlayer, login, pass) local elements = {loginButton, loginPassLabel, registerLabel, loginBox, passBox, keyImage} destroyElement(elements) guiSetInputEnabled(false) showCursor(false) removeEventHandler("onClientRender",root,createDxOnLogin) else outputChatBox("#EE5555* #C0C0C0Prosze wpisac #EE5555Login #C0C0C0oraz #EE5555Haslo#C0C0C0, aby sie zalogowac!", 255, 255, 255, true) end end end, ,false) showCursor(true) guiSetInputEnabled(true) outputChatBox("Dupa2") addEventHandler("onClientRender", root, createDxOnLogin) end )
  9. That function which you have showed is invalid. There are not any events etc. This one is valid: function omg_tour() tour = createObject(13607, 238, -1836.2998046875, 13.60000038147, 0, 0, 3.25) createBlipAttachedTo ( tour, 0, 2, 100, 0, 0, 255, 0, 99999.0, getRootElement()) end addEventHandler("onResourceStart",root,omg_tour) and I don't understand what is this: omgMovetour(1) if you want make moving object then just use moveObject function. I don't know too if this is client or server side script. If this is client side then you don't need to add getRootElement() at the end of createBlipAttachedTo function. and you have to change then onResourceStart to onClientResourceStart.
  10. hxv

    Mute mapmusic.

    Create own event then and get this chunk from the function that uses bind 'm', and create new function that will stop when the music from the GUI radio is turned on
  11. hxv

    How to Add Items

    Use map editor browser for that. https://wiki.multitheftauto.com/wiki/Resource-Editor.htm
  12. hxv

    [HELP]Top Times

    You mean sliding Top Times from specified side to specified position? I'm sorry but I don't understand your problem completely. But if you want to make sliding Top Times you can make frames. this example slides label "text" from center to right side local label = guiCreateLabel ( 0.5, 0.5, 1, 1, "text", true ) function executeSlide() -- frame one setTimer( function() guiSetPosition(label,0.5,0.5,true) end ,100,1) -- frame two setTimer( function() guiSetPosition(label,0.6,0.5,true) end ,200,1) -- frame three setTimer( function() guiSetPosition(label,0.7,0.5,true) end ,300,1) -- frame four setTimer( function() guiSetPosition(label,0.8,0.5,true) end ,400,1) -- frame five setTimer( function() guiSetPosition(label,0.9,0.5,true) end ,500,1) -- frame six setTimer( function() guiSetPosition(label,1.0,0.5,true) end ,600,1) end function execute() executeSlide() end addCommandHandler("slide",execute)
  13. hxv

    Mute mapmusic.

    onClientPlayerRadioSwitch getRadioChannel
  14. hxv

    Next Map

    There are two ways to fix this problem: - check if any maps are uploaded - reupload 'race' resource
  15. Thank's onPlayerClick event very helped me.
  16. How to get ground position by mouse click, my scripts: Client-side: addEvent("getGroundPosition", true) function getGround(player) local x,y,z = getElementPosition(source) local worldposition = getGroundPosition(x,y,z) outputChatBox("Ground position: " .. x .. " , " .. y .. " , " .. z .. " ") end addEventHandler("getGroundPosition", getRootElement(), getGround) Server-side: addEvent("getGroundPosition", true) function worldClicked( button, state, player ) if button == "left" and state == "down" then if isPedOnGround ( player ) then triggerClientEvent ("getGroundPosition", player) end end end addEventHandler( "onElementClicked", getRootElement(), worldClicked ) It doesn't work ;x what is the problem?
×
×
  • Create New...