Jump to content

Crosshair

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Crosshair

  1. like this ? function banca() local banca = mysql_query(handler, "SELECT * FROM accounts WHERE username = '"..getPlayerName(source).."';") if (banca) then local bancarow = mysql_fetch_assoc(banca) local bank = bancarow.bank setElementData(source, "cash", bank) end mysql_free_result(banca) end addEventHandler ( "onPlayerJoin", getRootElement(), banca) and when i exit the marker to trrigger an event that runs the function again ?
  2. Do you have any suggestion instead ?
  3. I got a marker and: function biroutranzactii(element) if getElementType(element) == "player" and (element == localPlayer) then build_Banca() guiSetText( sold, "Sold: "..getElementData( localPlayer, "cash") ) showCursor(true) end end addEventHandler("onClientMarkerHit", marker2, biroutranzactii) in server file i got function banca() for _,v in ipairs(getElementsByType("player")) do local banca = mysql_query(handler, "SELECT * FROM accounts WHERE username = 'Crosshair';") if (banca) then local bancarow = mysql_fetch_assoc(banca) local bank = bancarow.bank setElementData( v, "cash", bank) end mysql_free_result(banca) end end setTimer(banca, 1000,0) on mysql_query function i want to change "Crosshair" with getPlayerName(source) but i don`t know how to define source. I get the error Bed argument data. if i put function banca(source) still nothing. How can i define it ?
  4. Hello guys. I`m really stuck with this triggerServerEvent thing. Lets say i got in the client file this: wdw = guiCreateWindow(left, top, windowWidth, windowHeight, "withdraw", false) guiCreateLabel(20, 25, 121, 16, "Balance: ", false, wdw) in server file i add this: function balance() local sql = mysql_query(handler, "SELECT cash FROM accounts WHERE username = '"..getPlayerName(source).."';") end addEvent("balance", true) addEventHandler("balance", getRootElement(), balance) How do i trigger balance event so that in the label after "Balance: " shows the value from cash column ? PS. Another issue i got with setTimer lets say i got this: function time() local h ,m = getTime() if (m == 0) then outputChatBox("text", source, 255, 0, 0) else return end end setTimer ( time, 600, 0 ) So... every 1 min the timmer is triggerd. Works great so far, but "text" appears twice. I read on the wiki page that is something to do with fames per secound and "shouldn't rely on the timer triggering at an exact point in the future". But i want that timer to be triggered at that point. How do i fix it ? Thanks in advance.
  5. Thanks Alpha. Any help is good for me now I appreciate the help. I with try it tomorrow and see if it works.
  6. wow. thank god. is working. What about the other two questions ? 1. how i can make so that the gui runs when i enter the game ? 2. How can i call functions from other lua files ?
  7. Hello. I own a sa:mp server, but recently i got an idea to make a mta server. I run in some problems. I created a gui wih Qt Designer, created the files, but when i try to execute with the command gui i`m getting attempt to call global 'guiGetScreenSize' (a nil value) Another question that i have is how i can make so that the gui runs when i enter the game ? How can i call functions from other lua files ? meta.xml http://pastebin.com/UyMynQEy linkmania.lua - main file http://pastebin.com/nM6pUm2X build.lua - gui itself http://pastebin.com/nbvFHPsv login.lua script for gui http://pastebin.com/5qL2sJRm Thanks in advance
×
×
  • Create New...