Jump to content

kamani

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by kamani

  1. Hey all I have this script, but don't run perfectly.. Please help with this script.. whats wrong ? CLIENT: function GoToJob(source) outputChatBox("Hey, have a job!", source) givePlayerMoney(source,-500) triggerServerEvent("StartJobCheckPoint",getLocalPlayer()) end SERVER: function JobCP() local Job1 = createMarker( -1979.3596191406, 483.17581176758, 34.100391387939, 'cylinder',0.8, 0, 255, 0, getRootElement()) end addEvent("StartJobCheckPoint", true) addEvent("StartJobCheckPoint", getRootElement(), JobCP() end) Don't show job1 checkpoint.
  2. Hey all whats wrong in this script function test(source) local string1 = 0 local string2 = 0 if (guiCheckBoxGetSelected ( check1_1 ) == true) then string1++ end if (guiCheckBoxGetSelected ( check1_2 ) == true) then string1++ end if (guiCheckBoxGetSelected ( check1_3 ) == true) then string2++ else string1++ end if (guiCheckBoxGetSelected ( check1_4 ) == true) then string1++ end outputChatBox("Hey, number of string1 "..string1.." ! :)", source) end
  3. very thank u, work fine
  4. mysql_connect("localhost", "root", "", "mta",port=3306,unix_socket=nil, client_flags="") and don't work, when connect just black.
  5. On win32 this script work fine, but when LINUX, don't work and have this error ;(
  6. hey, i have error ERROR: mode/script.lua:11: bad argument #1 to 'mysql_query' (LuaBook.mysqlHandler expected, got nil) this is my code: sqllogin = mysql_connect("localhost", "root", "", "mta") function joinHandler() g_Red, g_Green, g_Blue = math.random (50, 255), math.random (50, 255), math.random (50, 255) showPlayerHudComponent ( source, "radar", false ) fadeCamera(source, true, 5) setCameraMatrix(source, -2727.537109375, 1259.0477294922, 21.859544754028, -2710.1669921875, 1447.4552001953, 62.596080780029) givePlayerMoney ( source, 500 ) local username = getPlayerName(source) local query = mysql_query(sqllogin, "SELECT * FROM users WHERE nick='" .. username .."'") --- this is ERROR LINE if (mysql_num_rows(query) == 0) then outputChatBox("please register!", source) else outputChatBox("please login!", source) end mysql_free_result(query) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler)
  7. Hi all my job save script is wrong, in server console (when quit of game) i get: attempt to concatenate global 'job' (a boolean value) This is code: (Server) function savejob() local nick = getPlayerName( source ) local job = getPlayerTeam( source ) local savequery = "UPDATE users SET jobname='" .. job .. "' WHERE username='" .. nick .."'" end addEventHandler ( "onPlayerQuit", getRootElement(), savejob)
  8. hi, New problem with markers + gui , but don't show menu when i go in marker, mh, i watch examples but can't be worked fine. Server: local myMarker = createMarker( -1985.6575927734, 476.59652709961, 34.021896362305, 'cylinder', 1.5, 0, 255, 0, getRootElement()) addEvent ("RodytiLanga", true) function MarkerHit(hitElement, matchingDimension) if getElementType(hitElement) == "player" then triggerServerEvent ( "RodytiLanga",getRootElement(),"Hello World!") end end addEventHandler( "onMarkerHit", myMarker , MarkerHit ) Client: function ijungtilangus() PradinisLangas = guiCreateWindow(386,330,519,363,"UNIVERSITETO SISTEMA",false) TabLaukas = guiCreateTabPanel(37,58,442,213,false,PradinisLangas) Tabas1 = guiCreateTab("Informacija",TabLaukas) TaboTekstas1 = guiCreateLabel(0,3,442,179,"TEKSTAS APIE INFORMACIJA",false,Tabas1) guiLabelSetColor(TaboTekstas1,255,255,255) guiLabelSetVerticalAlign(TaboTekstas1,"top") guiLabelSetHorizontalAlign(TaboTekstas1,"left",false) Tabas2 = guiCreateTab("Darbuotojai",TabLaukas) TaboTekstas2 = guiCreateLabel(1,4,440,175,"TEKSTAS APIE DARBUOTOJUS",false,Tabas2) guiLabelSetColor(TaboTekstas2,255,255,255) guiLabelSetVerticalAlign(TaboTekstas2,"top") guiLabelSetHorizontalAlign(TaboTekstas2,"left",false) Tabas3 = guiCreateTab("Taisykles",TabLaukas) TaboTekstas3 = guiCreateLabel(0,7,442,175,"TEKSTAS APIE TAISYKLES",false,Tabas3) guiLabelSetColor(TaboTekstas3,255,255,255) guiLabelSetVerticalAlign(TaboTekstas3,"top") guiLabelSetHorizontalAlign(TaboTekstas3,"left",false) ApatinisTekstas = guiCreateLabel(39,274,310,33,"Jai viska jau perskaitete ir norite istoti, pasirinkite Istoti",false,PradinisLangas) guiLabelSetColor(ApatinisTekstas,255,255,255) guiLabelSetVerticalAlign(ApatinisTekstas,"top") guiLabelSetHorizontalAlign(ApatinisTekstas,"left",false) MygtIstoti = guiCreateButton(44,318,121,29,"Istoti",false,PradinisLangas) MygtUzdaryti = guiCreateButton(196,319,121,27,"Uzdaryti Langa",false,PradinisLangas) MygtNutraukti = guiCreateButton(354,319,121,29,"Nutraukti Mokyma",false,PradinisLangas) end addEventHandler( "onClientGUIClick", MygtUzdaryti, uzdaryti) function rodyti() ijungtilangus() guiSetVisible (PradinisLangas, true) showCursor (true) end addEvent ("RodytiLanga", true) addEventHandler( "RodytiLanga", getRootElement(), rodyti ) function uzdaryti() guiSetVisible( PradinisLangas, false ) showCursor( false ) end
  9. Thanks, but issue was in CreateMarker size (1.0 = don't work, i changed in 1.5 = worked fine.. )
  10. I changed this, but don't show text when i go to in created marker.
  11. Hello forum. I set this marker code: local JobMarker = createMarker( -1985.6575927734, 476.59652709961, 34.021896362305, 'cylinder', 1.0, 0, 255, 0, 150 ) function MarkerHit( source, matchingDimension ) outputChatBox("Text on marker", source) end addEventHandler( "InMarker", JobMarker, MarkerHit ) But when i go in marker (Inside) , don't show this outputchatbox text.. JobMarker in game set, but don't show text when inside in this marker..
  12. Thanks (paswd>passwd), I saw himself.
  13. sorry for 2 meaningless topics, but i don't know how correct this login script. In game this command " /login [password] " worked bad, type /login password and anything wrong password.
  14. Hi all i created a login script ( using mysql module ) , But its wrong, i don't know what is wrong, but not working... Help please Code: function LoginSystem(source, commandName,pw) local paswd = mysql_escape_string(sqllogin,pw) local nick = mysql_escape_string(sqllogin, getPlayerName(source)) local query = mysql_query(sqllogin, "SELECT * FROM users WHERE username='" .. nick .."' AND password='" .. passwd .. "'") if (not query) then outputDebugString("mysql_query failed: (" .. mysql_errno(sqllogin) .. ") " .. mysql_error(sqllogin)) else if (mysql_num_rows(query) == 0) then end outputChatBox("Wrong password", source) else outputChatBox("Loged in", source) end mysql_free_result(query) end end addCommandHandler("login", LoginSystem)
  15. kamani

    [Mysql] HELP

    I use mysql module, but i can't create login system, becouse don't see example... I have this script, but don't work.... function RodytiPw(source, commandName, PasiringtasNikas) prisijungimas = mysql_connect("88.77.21.55", "axujel", "nornor12", "mta") if ( not prisijungimas ) then outputDebugString("Neimanoma prisijungti prie mysql") else mysql_close(prisijungimas) end local isvestaskint = mysql_escape_string(prisijungimas, PasiringtasNikas) local uzklausa = mysql_query(prisijungimas, "SELECT password FROM nariai WHERE username='" .. isvestaskint .. "'") if (not uzklausa) then outputDebugString("mysql_query failed: (" .. mysql_errno(prisijungimas) .. ") " .. mysql_error(prisijungimas)) else if (mysql_num_rows(uzklausa) == 0) then outputChatBox("Tokio zaidejo nera", source) else outputChatBox("Zaidejo Slaptazodis: " .. mysql_result(uzklausa, 1, 1) .. "", source) end mysql_free_result(uzklausa) end end addCommandHandler("ziureti", RodytiPw)
  16. nice.. so thats cool resource for RP.
  17. kamani

    [Mysql] HELP

    Hi, faced with problems and I need help with mysql ... I have a registration system, but not MySQL. And I need to redo it on MySQL, please help me! :> This is server login: function clientAttemptLogin(username,password) local userAccount = getAccount(username) local tryToLog if (client) then tryToLog = logIn(client,userAccount,password) if (tryToLog) then spawnPlayer(client,pozicijaX,pozicijaY,pozicijaZ) fadeCamera(client,true) outputChatBox(welcomeMessageReturningUser,client) triggerClientEvent(client,"clientLoginSuccess",getRootElement()) else triggerClientEvent(source,"clientDisplayArea",getRootElement(),"Bad password, please try again!") triggerClientEvent(source,"clientWrongPassword",getRootElement()) end end end addEvent("SubmitLogin",true) addEventHandler("SubmitLogin",getRootElement(),clientAttemptLogin) Or just send me mysql login simple example, sorry i bad for english. Thanks for all.
×
×
  • Create New...