Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. What you can do is just don't let them change the skin when they use the command, but you'll need to edit the freeroam script.
  2. Castillo

    Lua

    No existe tal cosa, lo unico que yo conozco es: la pagina de la wiki ( wiki.multitheftauto.com ) y lua.org.
  3. Have you downloaded the maps? Because it works fine for me. Here are the maps: https://community.multitheftauto.com/ind ... ils&id=886 https://community.multitheftauto.com/ind ... ils&id=887 https://community.multitheftauto.com/ind ... ils&id=888 https://community.multitheftauto.com/ind ... ls&id=1920 https://community.multitheftauto.com/ind ... ls&id=1971
  4. That's because is not v [ index ], it's v [ "CharacterID" ], v [ "Skin" ] and so on.
  5. That doesn't make any sense, the timer will only change it once.
  6. addEventHandler ( "onElementModelChange", root, function ( old, new ) if ( getElementType ( source ) == "player" ) then if ( new == 287 ) then if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) ) then setTimer ( setElementModel, 100, 1, source, old ) end end end end ) I had to set a timer because it was not working for some weird reason, now it does.
  7. You removed the 'end' before: triggerClientEvent(thePlayer, "onSuccessLogin", getRootElement(), peds)
  8. peds[i][CharacterID] = data[1] peds[i][AccountID] = data[2] peds[i][Name] = data[3] peds[i][Gender] = data[4] peds[i][Age] = data[5] peds[i][Skin] = data[6] peds[i][PosX] = data[7] peds[i][PosY] = data[8] peds[i][PosZ] = data[9] peds[i][Dimension] = data[10] peds[i][Interior] = data[11] peds[i][Health] = data[12] peds[i][Armour] = data[13] That's the problem, I think you wanted to do this: peds[i]["CharacterID"] = data[1] peds[i]["AccountID"] = data[2] peds[i]["Name"] = data[3] peds[i]["Gender"] = data[4] peds[i]["Age"] = data[5] peds[i]["Skin"] = data[6] peds[i]["PosX"] = data[7] peds[i]["PosY"] = data[8] peds[i]["PosZ"] = data[9] peds[i]["Dimension"] = data[10] peds[i]["Interior"] = data[11] peds[i]["Health"] = data[12] peds[i]["Armour"] = data[13]
  9. Post your whole script. P.S: Is a server side script.
  10. Are you sure it is the same error as before?
  11. That's good, it has to do that. But if that works fine, then why does it say the error you said it does?
  12. The script I posted will prevent them from having skin 287, because when they do "/ss 287" it'll change it back to the skin he had when used the command. About giving skin, you must use: onPlayerLogin isObjectInACLGroup aclGetGroup setElementModel
  13. addEventHandler ( "onElementModelChange", root, function ( old, new ) if ( getElementType ( source ) == "player" ) then if ( new == 287 ) then if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) ) then setElementModel ( source, old ) end end end end ) That should set to your old skin if you are not in "Admin" group.
  14. That's what it should do, have you tested it?
  15. Me parecia ami, pero bueh. addCommandHandler ( "play", function ( playerSource, commandName, cancion, nombre ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( playerSource ) ), aclGetGroup ( "Admin" ) ) then triggerClientEvent ( root, "triggear", root, cancion, nombre ) end end )
  16. GUIEditor = { button = {}, } state = false GUIEditor.button[1] = guiCreateButton(234, 242, 94, 50, "Infernus Mod", false) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF29D59A") GUIEditor.button[2] = guiCreateButton(472, 242, 94, 50, "wheels", false) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF29D59A") bindKey ( "U", "down", function ( ) state = ( not state ) removeEventHandler ( "onClientRender", root, draw ) guiSetVisible ( GUIEditor.button[1], state ) guiSetVisible ( GUIEditor.button[2], state ) if ( state ) then addEventHandler ( "onClientRender", root, draw ) end end ) function draw ( ) dxDrawImage(433, 110, 172, 122, ":guieditor/images/weel.png", 0, 0, 0, tocolor(206, 148, 47, 255), true) dxDrawImage(191, 110, 180, 122, ":guieditor/images/infernus.png", 0, 0, 0, tocolor(82, 171, 80, 255), true) end
  17. Vos pusiste para que solo los admines pudieran escucharla.
  18. Try this and see what it outputs to chat: mysql = exports.database function createAccount(username, email, password) local query = mysql:query("SELECT * FROM `Accounts` WHERE `Username` = '" .. mysql:escapeString(username) .. "'") if (username) and (username~="") then if (mysql:numRows(query) == 0) or (getAccount(username)) then if (password) and (password~="") then local query = mysql:query("INSERT INTO `Accounts` (Username, Email, Password) VALUES ('" .. mysql:escapeString(username) .. "', '" .. mysql:escapeString(email) .. "', '" .. mysql:escapeString(password) .. "')") addAccount(username, password) exports.box:showBoxS ("info","Sikeresen regisztráltál, most kérlek jelentkezz be.") else exports.box:showBoxS ("error","Nem adtál meg jelszót.") end else exports.box:showBoxS ("error","A megadott felhasználónév foglalt.") end else exports.box:showBoxS ("error","Nem adtál meg felhasználónevet.") end mysql:freeResult(query) end addEvent("createAccount", true) addEventHandler("createAccount", getRootElement(), createAccount) function onClientLoginRequest(thePlayer, nickname, password) if (nickname) and (nickname~="") then if (password) and (password~="") then local query = mysql:query("SELECT * FROM `Accounts` WHERE `Username` = '" .. mysql:escapeString(nickname) .. "' AND `Password` = '" .. mysql:escapeString(password) .. "'") if (mysql:numRows(query) == 1) then local sourceAccount = getPlayerAccount(thePlayer) if not isGuestAccount(sourceAccount) then exports.box:showBoxS(thePlayer,"error","Már be vagy jelentkezve.") else local account = getAccount(nickname, password) if (account ~= false) then local data = mysql:fetchRow(query) local query = mysql:query("SELECT * FROM `Characters` WHERE `AccountID` = '" .. data[1] .. "'") if (mysql:numRows(query) > 0) then local peds = {} local rows = mysql:numRows(query) for i = 0, rows do peds[i] = {} outputChatBox ( "Index: ".. i ..": ".. tostring ( peds[i] ) ) peds[i][CharacterID] = data[1] peds[i][AccountID] = data[2] peds[i][Name] = data[3] peds[i][Gender] = data[4] peds[i][Age] = data[5] peds[i][Skin] = data[6] peds[i][PosX] = data[7] peds[i][PosY] = data[8] peds[i][PosZ] = data[9] peds[i][Dimension] = data[10] peds[i][Interior] = data[11] peds[i][Health] = data[12] peds[i][Armour] = data[13] end triggerClientEvent(thePlayer, "onSuccessLogin", getRootElement(), peds) logIn(thePlayer, account, password) exports.box:showBoxS(thePlayer,"info","Sikeresen bejelentkeztél.") else exports.box:showBoxS(thePlayer,"error","Nincs egyetlen karakter sem hozzárendelve ehhez az accounthoz. A játék megkezdése elott mindenképpen szükséged van legalább 1 karakterre, melyet weboldalunkon tudsz elkészíteni. ([url=http://www.sa-stories.net]www.sa-stories.net[/url])") end else exports.box:showBoxS(thePlayer,"error","A MySQL adatbázisban és a szerver belso adatbázisában található jelszavak nem egyeznek!\nJavaslat: A probléma megoldásához kérlek vedd fel a kapcsolatot egy adminisztrátorral.") end end else exports.box:showBoxS(thePlayer,"error","Helytelen bejelentkezési adatokat adtál meg.") end else exports.box:showBoxS(thePlayer,"error","Nem adtál meg jelszót.") end else exports.box:showBoxS(thePlayer,"error","Nem adtál meg felhasználónevet.") end mysql:freeResult(query) end addEvent("onClientLoginRequest", true) addEventHandler("onClientLoginRequest", getRootElement(), onClientLoginRequest)
  19. The error is still the same and in this line? peds[i] = {}
×
×
  • Create New...