-
Posts
80 -
Joined
-
Last visited
Everything posted by #DaMiAnO
-
Can you make for me, when player write bad login or pass, GUI will not hide? BUG: My account is in DB, but when i loging, i see message "Bad login or pass". How to fix?
-
mysql = dbConnect("mysql", "dbname=mta;host=192.166.219.226", "damiano", "Censored", "share=1") if(mysql) then outputServerLog("\n[MySQL] Pomyslnie polaczono z MySQL!") outputDebugString("Pomyslnie polaczono z MySQL!", 3, 0, 224, 0) else outputServerLog("\n[MySQL] Wystapil blad podczas laczenia z MySQL! Polaczenie zostalo zerwane...") outputDebugString("Wystapil blad podczas laczenia z MySQL! Polaczenie zostalo zerwane...", 3, 255, 0, 0) destroyElement(mysql) end
-
Hi! My resource, not working. When I click "Zaloguj", the GUI will close. 0 error messages (outputChatBox). Errors in Console: [2012-04-14 10:15:35] WARNING: GameMode\LoginRegister_s.lua:7: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil] [2012-04-14 10:15:35] ERROR: GameMode\LoginRegister_s.lua:8: attempt to call global 'dbPool' (a nil value) Client-side: function createLoginBox() LoginGUI = guiCreateWindow(527,159,380,407,"Truck - Logowanie",false) guiSetAlpha(LoginGUI,0.69999998807907) guiWindowSetSizable(LoginGUI,false) IntroLabel = guiCreateLabel(47,62,290,32," Witamy na Truck!\nWpisz poniżej Login oraz Hasło, aby się zalogować!",false,LoginGUI) guiSetFont(IntroLabel,"default-bold-small") LoginLabel = guiCreateLabel(76,181,38,16,"Login:",false,LoginGUI) guiSetFont(LoginLabel,"default-bold-small") PassLabel = guiCreateLabel(72,218,40,16,"Hasło:",false,LoginGUI) guiSetFont(PassLabel,"default-bold-small") LoginBox = guiCreateEdit(128,179,137,19,"",false,LoginGUI) PassBox = guiCreateEdit(129,216,137,19,"",false,LoginGUI) guiEditSetMasked(PassBox,true) LoginButton = guiCreateButton(35,259,306,52,"Zaloguj!",false,LoginGUI) RegisterButton = guiCreateButton(35,330,306,52,"Zarejesrtuj!",false,LoginGUI) guiSetVisible(LoginGUI, false) addEventHandler("onClientGUIClick", LoginButton, submitLogin, false) addEventHandler("onClientGUIClick", RegisterButton, registerPlayer, false) end function startLoginRegisterModule() createLoginBox() if (LoginGUI ~= nil) then guiSetVisible(LoginGUI, true) else outputDebugString("Nie moge utworzyc GUI odpowiedzialnego od Logowania/Rejestracji!", 3, 255, 0, 0) end showCursor(true) guiSetInputEnabled(true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startLoginRegisterModule) function submitLogin(button, state) if button == "left" and state == "up" then local login = guiGetText(LoginBox) local pass = guiGetText(PassBox) if login and pass then triggerServerEvent("submitLoginServer", getRootElement(), login, pass) guiSetInputEnabled(false) guiSetVisible(LoginGUI, false) showCursor(false) else outputChatBox("#EE5555* #C0C0C0Proszę wpisać #EE5555Login #C0C0C0i #EE5555Hasło#C0C0C0!") end end end Server-side: function loginHandler(login, pass) local getAccount = dbQuery(connection, "SELECT * FROM `accounts` WHERE `account` = `%s` AND `password` = `%s`", login, pass) local result = dbPool(getAccount, 0) if result then if client then spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) setCameraTarget(client, client) end else outputChatBox("#EE5555* #C0C0C0Podano zły #EE5555Login #C0C0C0lub #EE5555Hasło#C0C0C0!") end end addEvent("submitLoginServer", true) addEventHandler("submitLoginServer", root, loginHandler)
-
Przecież to jest gówno, nie projekt.
-
What is right? You can give me what I have to write the ACL?
-
MySQL: function connectToMySQL() mysql = dbConnect("mysql", "dbname=test", "host=localhost", "root", "") outputServerLog("[MySQL] Connected!\n") if(mysql ~= nil) then outputServerLog("[MySQL] Disconnected...\n") destroyElement(mysql) end end This not working. outputServerLog isnt showing. Restart: function restartServer() local hour, mins = getTime() local allResources = getResources() if(hour == 12) and (mins == 00) then for index, res in ipairs(allResources) do if getResourceState(res) == "running" then restartResource(res) outputDebugString("GameMode restarted!", 3, 0, 224, 0) end end end end setTimer(restartServer, 3600000, 1, source) This not working. Resources arent restatred.
-
viewtopic.php?f=91&t=41481
-
Hi! What can I create 'auto-kicker', if player have color code, or '#' in Name? I don't have any idea for this.
-
Big ty! Can be closed (topic).
-
My bad, working - thanks. Last question, how is the name of function, when player entering to the vehicle?
-
Hi! I have this: That's working, but when anyone dies, it not spawn him, and i see error in debugscript. local randomSpawnTable = { { -2818.3391, 1134.4768, 26.1129, 179.2400 }, { 2021.3114, 1344.1099, 10.8203, 269.5800 }, { 2221.3726, 1838.4792, 10.8203, 90.3700 } } function randomSpawn(thePlayer, randomSpawnTable) local random = math.random(1, #randomSpawnTable) spawnPlayer(thePlayer, randomSpawnTable[random][1], randomSpawnTable[random][2], randomSpawnTable[random][3], randomSpawnTable[random][4]) end function onPlayerJoin() fadeCamera(source, true) setCameraTarget(source, source) randomSpawn(source, randomSpawnTable) end addEventHandler("onPlayerJoin", g_root, onPlayerJoin) function onPlayerDeath() fadeCamera (source, false, 1.0, 255, 0, 0) setTimer(randomSpawn, 3000, 1, source) setTimer(fadeCamera, 2500, 1, source, true, 0.5) end addEventHandler("onPlayerWasted", g_root, onPlayerDeath)
-
Maybe this? "PED","IDLE_CHAT"
-
local screenWidth, screenHeight = guiGetScreenSize() local timer, state function repairVehicle() local theVehicle = getPedOccupiedVehicle( localPlayer ) if theVehicle then dxDrawText("Pojazd zostal naprawiony! (Koszt: $2500)", screenWidth*0.5, screenHeight*0.1, screenWidth*0.5, screenHeight*0.5, tocolor(255,0,0,210), 1.0, "bankgothic", "center", "center", false, false, false) else dxDrawText("Musisz znajdowac sie w pojezdzie!", screenWidth*0.5, screenHeight*0.1, screenWidth*0.5, screenHeight*0.5, tocolor(255,0,0,210), 1.0, "bankgothic", "center", "center", false, false, false) end end bindKey( '2','down', function() if not state then if getPlayerMoney() >= 2500 then takePlayerMoney(2500) else dxDrawText("Nie posiadasz $2500 na naprawe!", screenWidth*0.5, screenHeight*0.1, screenWidth*0.5, screenHeight*0.5, tocolor(255,0,0,210), 1.0, "bankgothic", "center", "center", false, false, false) end if isTimer(timer) then return end local theVehicle = getPedOccupiedVehicle( localPlayer ) if theVehicle then fixVehicle( theVehicle ) end addEventHandler( 'onClientRender',root,repairVehicle ) state = true timer = setTimer( function() dxDrawText("Odczekaj 5 sekund!", screenWidth*0.5, screenHeight*0.1, screenWidth*0.5, screenHeight*0.5, tocolor(255,0,0,210), 1.0, "bankgothic", "center", "center", false, false, false) removeEventHandler( 'onClientRender',root,repairVehicle ) state = false end, 5000,1 ) end end end end )
-
Ye i know, but when i add my msg's, script have a errors.
-
You can add simple Outputmsg, where i can replace to my msg's (if not have 2500 and wait 5 secounds).
-
Last request. Can you make it, than player can use this bind every 5 sec?
-
Can you make, if player have 2500 or more, then he can use repair (takeplayermoney + repair), else player dont have 2500, then vehicle cant be repair.
