Jump to content

Renkon

Members
  • Posts

    876
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Renkon

  1. Read https://wiki.multitheftauto.com/wiki/triggerServerEvent
  2. GuiSetText only returns true or false. To get the text you should use GuiGetText
  3. How much money do you offer to pay?
  4. That version is outdated already.
  5. localPlayer en vez de getRootElement en los tres casos.
  6. When you executed the command, were files downloaded?
  7. having username`=='".. pName .."'" returns an syntax error due to the == if its only a = i says attempt to index a nil value regarding the following line Yea yeah, I dont know why I thought it should have been double ==. Yet, it should work, it's extremely weird. The one I posted BEFORE worked.
  8. Then use this instead mysql = exports.mysql function showmenu ( playerSource )--check user has rights or not. local pName = getPlayerName ( playerSource ) local result = mysql:query ( "SELECT admin FROM `accounts` WHERE `username`=='".. pName .."'" ) if ( result and mysql:fetch_assoc ( result ) [ "result.admin" ] >= 6 ) then -- Check if the level is 6 or higher. triggerClientEvent ( playerSource, "ShowMenuC", playerSource, true )--show user interface. outputChatBox ( 'I did something YAY XD', playerSource );-- test if working or not else triggerClientEvent ( playerSource, "notify", playerSource, true )--tell user. outputChatBox ( 'Sorry No Can Do!!!', playerSource );-- test if working or not end end addCommandHandler ( "dbman", showmenu )
  9. Line 7: replace with local consulta = dbQuery(db,"SELECT admin FROM `accounts` WHERE username == '"..pName.."'")
  10. Well, you can maybe try this
  11. I am used to dbExec. I will quote you an example though. --- DB VARIABLES --- host = "localhost" -- host goes here username = "root" -- db username password = "pa$$word" -- db password dbname = "iLoveTrains" -- db name -------------------- db = dbConnect( "mysql", "dbname="..dbname..";host="..host, username, password) function showmenu ( playerSource ) local pName = getPlayerName ( playerSource ) local consulta = dbQuery(db,"SELECT admin FROM `accounts` WHERE nick = '"..pName.."'") local Result = dbPoll ( consulta, -1 ) if (Result[1] == nil) then return end -- Shit happened :3 if (Result[1].admin >= 6) -- epic WIN triggerClientEvent ( playerSource, "ShowMenuC", playerSource, true )--show user interface. outputChatBox ( 'I did something YAY XD', playerSource );-- test if working or not else triggerClientEvent ( playerSource, "notify", playerSource, true )--tell user. outputChatBox ( 'Sorry No Can Do!!!', playerSource );-- test if working or not end end addCommandHandler ( "dbman", showmenu )
  12. 1º: en ningún momento te traté de idiota. Creo que el que está faltando el respeto sos vos. 2º: es cuestion de editar una línea. En vez de postear eso podrías modificarlo y listo. 3º: encima que me propongo ayudarte, fijate como respondés, un poco de respeto no viene mal eh. Al fin y al cabo yo te estoy haciendo un favor, y como MINIMO tendrias que agradecerme.
  13. Entonces, tu lo que quieres hacer es que onResourceStart un auto sea indestructible si esta vacío, y si alguien entra se rompa?? entonces function SmashedPotatoes() veh = createVehicle(...) setVehicleDamageProof(veh, true) end function fapfapfap() blowVehicle(source) end addEventHandler("onVehicleEnter", getRootElement(), fapfapfap) addEventHandler("onResourceStart", resourceRoot, SmashedPotatoes)
  14. Lo piensas hacer onVehicleEnter, onResourceStart?. porque ahí tienes un source, pero no muestras la función, y muestras un Player que no sabemos de donde viene.
  15. blowVehicle(vehh)
  16. Castillo's reply may be even better than mine. Ignore what I said, he is right.
  17. then suppose we want to use the command /db CompleteNameofAdmin mysql = exports.mysql function showmenu(source, cmd, person)--check user has rights or not. if not person then return end local result = mysql:query("SELECT admin FROM 'accounts' WHERE username == '"..person.."'") if (mysql:num_rows(result)>=6) then triggerClientEvent(source,"ShowMenuC",true)--show user interface. outputChatBox('I did something YAY XD',playerSource);-- test if working or not else triggerClientEvent(source,"notify",true)--tell user. outputChatBox('Sorry No Can Do!!!',playerSource);-- test if working or not end end addCommandHandler("dbman",showmenu) If JohnPepper is level 6 /dbman JohnPepper will show you it. If you write /dbman John it will show you there's no admin. You must add FULL NAME since it's not getPlayerFromPartName but from Name.
  18. local name = getPlayerName(some player element) and then.. local result = mysql:query("SELECT admin FROM 'accounts' WHERE username == '"..name.."'")
  19. You missed the comparative in the query. WHERE username == "something"
  20. Usa stopSound, cuando el auto se desbloquee
  21. function winGame() if isTimer(timer) then destroyElement(timer) end local userdata = source timer = setTimer(function() givePlayerMoney( userdata, 25000) outputChatBox("You have won!") end, 300000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), winGame )
  22. Well, is this serverside? since count will go +1 for everybody joining and also every time there is a timer. And then it would be FUCKED UP. My recommendation? function winGame() setTimer(function() givePlayerMoney( source, 25000) outputChatBox("You have won!") end, 300000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), winGame )
  23. Renkon

    Join

    AR, BR, CL, EU, US. No, ARGENTINA, BRASIL, CHILE.
  24. Renkon

    not work .!

    Then what do you want to do with it?
  25. It wont because you defined count = 0. It will always be resetted. You should write OVER function: local count = 0 and then inside the function, remove the localCount. and then, if count == 300 then, you can also set count = 0
×
×
  • Create New...