Jump to content

BumbiS*

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by BumbiS*

  1. GUI is triggering it from client side. function clientSubmitLogin(button,state) if button == "left" and state == "up" then local parole = guiGetText(edtUser) if parole then triggerServerEvent("submitLogin", getRootElement(), parole) guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) else outputChatBox("Lūdzu ievadiet paroli.") end end end amm.. i thought that source is always the element who triggers the function. FIXED!!!! I just add a trigger argument to the event and used it as player variable. Now it works well. Thanks for responses.
  2. Hey, users. I have a problem here, its about login with mysql. It shows a error and i cant fix it, thats why i'm asking for help. So here's the code function loginHandler(parole) if parole then if (client) then local res = mysql_query(sqlConnection,"SELECT * FROM users WHERE Name='"..getPlayerName(source).."' AND Pass='"..parole.."'") if res then if(mysql_num_rows(res)>0) then while true do local row = mysql_fetch_assoc(res) if(not row) then break end spawn(client) setPlayerMoney(client,row["Money"]) setElementModel(client,row["Skin"]) end mysql_free_result(res) else outputChatBox("Nepareiza parole!",source) triggerClientEvent("ShowLoginGUI",client) end end end else outputChatBox("Ievadiet paroli.",client) triggerClientEvent("ShowLoginGUI",client) end end And the error Error: server.lua:71: attempt to concatenate a boolean value this is the error line local res = mysql_query(sqlConnection,"SELECT * FROM users WHERE Name='"..getPlayerName(source).."' AND Pass='"..parole.."'")
  3. repeat until spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288) ) Change the X,Y,Z coordinates. -711+math.random(1,5), 957+math.random(5,9), 12.4
  4. BumbiS*

    Question..

    I already have that, and i have a database too. But i want to know that thing what i said before.
  5. BumbiS*

    Question..

    No, thats not what i want.. Ah.. You don't understand me. I know, about control structures.. I want to know about mysql in MTA scripting... In sa-mp pawno it will be like this, without mysql. But i want to know how can server get info from sql database. if(PlayerData[playerid][pFaction] == 1) { SendClientMessage(playerid, ORANGE, "Hello, officer! Have a good day, Sir!"); return 1; } else { SendClientMessage(playerid, RED, "You are not a Police officer!"); return 1; } Above code in MTA... Not from .xml files account base, but from mySQL database.
  6. BumbiS*

    Question..

    I am asking a question, there is no need of code, cuz i dont have it... You give me a link, but maybe you can help me too?
  7. BumbiS*

    Question..

    So, i want to know how can i check if player is bla bla bla, from mySQL.. In sa-mp that is something like this if(PlayerInfo[playerid][pFraction] == 1) { blablabla } else { Shows that you cant use that command, or what. } -------------------- And I want to know how can i make this in MTA?
  8. BumbiS*

    MySQL thing.

    So, i am learning that scripting thing and that all stuff, and i want some account system with MySQL database. And i want some tutorial, how to create that thing with mysql database, i have already created user files in that database, only thing i need is that lua script. Maybe someone can give me an example for that. I will really appreciate that. Thanks
  9. BumbiS*

    Problem...

    No, it doesn't work. That showChat function disables/enables all chat, i can't type anything when ir disabled... And all chat box dissapears, maybe there is some other function to disable it?
  10. BumbiS*

    Problem...

    Thanks for helping, and i have a question. How to disable the original chat? I made a another chat with radius and when i type something it shows two lines, the one with radius and the other one without it( Original )
  11. BumbiS*

    Problem...

    And how can i log in as admin?
  12. BumbiS*

    Problem...

    and where can i make commands? In resources or Gamemode? I just created a command in fr_server, restart resource and command didn't worked. Or maybe i need it to make it in fr_client? Command must work, i take it from wiki function showLocalHealth() -- get the player's health and output it local playerHealth = getElementHealth ( getLocalPlayer() ) outputChatBox ( "Your health: " .. playerHealth ) -- get the player's vehicle: if he is in one, output its health as well local playerVehicle = getPedOccupiedVehicle ( getLocalPlayer() ) if playerVehicle then local vehicleHealth = getElementHealth ( playerVehicle ) outputChatBox ( "Your vehicle's health: " .. vehicleHealth ) end end addCommandHandler ( "showhealth", showLocalHealth )
  13. BumbiS*

    Problem...

    Ok, now it works and i have another question. If the server is online and resource is running, i can edit resource while its running, and save it after edit? or i need to turn off my server or stop resource?
  14. BumbiS*

    Problem...

    Yes i'am editi in resource-cache... But in resource map there are all are .zip and to edit i need to unzip, edit then zip it again?
  15. BumbiS*

    Problem...

    Hah, i just start to script MTA, learning from wiki n' stuff, but when i edit a script, save it and start the server that edited script edits back to normal, like i translate ir from english to my language. Server starts, my translated line translates back to normal.. I edited original freeroam resource. Used Lua for windows. Can someone can tell me how to do it right? My english is not too good
×
×
  • Create New...