Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. Sasu

    ban player

    Its says N/A instead name of the player who was banned.
  2. Sasu

    ban player

    When I use banPlayer(thePlayer, false, false, true, adminBanner, "Razon: "..editText.." [ "..timeBan.." Min ] ", theTimeBan) on the admin panel in column 'nick' ( first column ) returns me N/A, so return false. Why? All arguments are defined.
  3. function dejar() if source == tirar then local row, col = guiGridListGetSelectedItem ( itemGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local item = guiGridListGetItemText ( itemGrid, row, 1 ) local ammo = guiGridListGetItemText ( itemGrid, row, 2 ) local itemName = getWeaponIDFromName(item) local x, y ,z = getElementPosition(localPlayer) local pickup = createPickup(x + 5, y, z, 2, itemName, 3000, tonumber(ammo)) triggerServerEvent("onPlayerPullItem", localPlayer, itemName, ammo) end end end addEventHandler("onClientGUIClick", root, dejar)
  4. Sasu

    table

    It was happening that the triggerClientEvent was wrong. Arguments in client function function obtenerIPSerialPing ( serial, ip, account, groups ) Arguments passed that I had triggerClientEvent(source, "getData", source, name, serial, IP, account, groups) So I deleted 'name' and now works . Stupid error . Thank you very much solid.
  5. Y si le agregas a lo primero de todo esto? addEventHandler("onClientResourceStart", root, function () end )
  6. Sasu

    get All Bans

    Server: function getAllBans() local banlist = getBans() for _, bans in ipairs ( banlist ) do local nicks = getBanNick(bans) triggerClientEvent(source, "refreshBanList", source, nicks) end end addEvent("onRefreshBanList", true) addEventHandler("onRefreshBanList", root, getAllBans) Client: function listabans() if source == refreshButton then listRefresh() end end addEventHandler("onClientGUIClick", root, listabans) function bans(nombres, seriales, banners, razones, fechas) local namerow = guiGridListAddRow(banList) guiGridListSetItemText ( banList, namerow, 0, nombres, false, false ) end addEvent("refreshBanList", true) addEventHandler("refreshBanList", root, bans) function listRefresh () triggerServerEvent("onRefreshBanList", root) end Error on debug: WARNING: adminPanel\panel.lua:495: Bad argument @ 'guiGridListSetItemText' [Expected strig at argument 4, got boolean] Can anybody help me? Thanks in advance!
  7. Sasu

    table

    ERROR: adminPanel\panel.lua:313: bad argument #1 to 'concat' (table expected, got string)
  8. Sasu

    table

    It set "None" when I am admin. Why?
  9. +1 and set more transparency, if you want obviously. But... Good script!
  10. Sasu

    table

    The same problem. Client: aclLabel = guiCreateLabel(17, 87, 274, 15, "Derechos en ACL: N/A", false, tabPanelInfo1) addEventHandler("onClientGUIClick", root, function () if source == listaPlayers then local row,column = guiGridListGetSelectedItem(listaPlayers) if row == -1 then return end if row then getPlayerData(playerName) end end end ) function obtenerIPSerialPing(serial, ip, account, groups) guiSetText(serialLabel, "Serial: "..serial) guiSetText(IPLabel, "IP: "..ip) guiSetText(accountLabel, "Cuenta: "..account) guiSetText(aclLabel, "Derechos en ACL: "..table["groups"] or "None") end addEvent("getData", true) addEventHandler("getData", root, obtenerIPSerialPing) function getPlayerData(name) triggerServerEvent("datos", root, localPlayer, name) end Server: function aclGetAccountGroups ( account ) local acc = getAccountName ( account ) if ( not acc ) then return false end local res = {} acc = "user."..acc local all = "user.*" for ig, group in ipairs ( aclGroupList() ) do for io, object in ipairs ( aclGroupListObjects ( group ) ) do if ( ( acc == object ) or ( all == object ) ) then table.insert ( res, aclGroupGetName ( group ) ) break end end end return res end function obtenerdatos(source, name) local player = getPlayerFromName(name) local serial = getPlayerSerial(player) local IP = getPlayerIP (player) local playerAcc = getPlayerAccount(player) local account = getAccountName(playerAcc) local groups = aclGetAccountGroups(playerAcc) triggerClientEvent(source, "getData", source, serial, IP, account, groups) end addEvent("datos", true) addEventHandler("datos", root, obtenerdatos)
  11. Sasu

    table

    function aclGetAccountGroups ( account ) local acc = getAccountName ( account ) if ( not acc ) then return false end local res = {} acc = "user."..acc local all = "user.*" for ig, group in ipairs ( aclGroupList() ) do for io, object in ipairs ( aclGroupListObjects ( group ) ) do if ( ( acc == object ) or ( all == object ) ) then table.insert ( res, aclGroupGetName ( group ) ) break end end end return res end Ok, I could not see where the function was created. And can you help me?
  12. Sasu

    table

    function aclGetAccountGroups ( account ) local acc = getAccountName ( account ) if ( not acc ) then return false end local res = {} acc = "user."..acc local all = "user.*" for ig, group in ipairs ( aclGroupList() ) do for io, object in ipairs ( aclGroupListObjects ( group ) ) do if ( ( acc == object ) or ( all == object ) ) then table.insert ( res, aclGroupGetName ( group ) ) break end end end return res end
  13. Sasu

    table

    Client: function obtenerIPSerialPing(serial, ip, account, groups) guiSetText(serialLabel, "Serial: "..serial) guiSetText(IPLabel, "IP: "..ip) guiSetText(accountLabel, "Cuenta: "..account) guiSetText(aclLabel, "Derechos en ACL: "..table["groups"]) end addEvent("getData", true) addEventHandler("getData", root, obtenerIPSerialPing) Server: function obtenerdatos(source, name) local player = getPlayerFromName(name) local serial = getPlayerSerial(player) local IP = getPlayerIP (player) local playerAcc = getPlayerAccount(player) local account = getAccountName(playerAcc) local groups = aclGetAccountGroups(playerAcc) triggerClientEvent(source, "getData", source, serial, IP, account, groups) end addEvent("datos", true) addEventHandler("datos", root, obtenerdatos) My error on debugscript 3: ERROR: adminPanel\panel.lua:294: attempt to concatenate field 'groups'(a nil value) I want that set text with the acl like the admin panel 'p' -> Groups: Admin, Everyone, etc Can anybody help me? Thanks in advance.
  14. Sasu

    Player Money

    Ok. I will try. Thank you very much.
  15. Sasu

    Player Money

    Why this script set text the local player money? local player = getPlayerFromName(playerName) local playerMoney = getPlayerMoney(player) guiSetText(dineroLabel, "Dinero: $"..playerMoney)
  16. Sasu

    CreateObject

    No se a que te refieres con scale.
  17. Sasu

    CreateObject

    Primero que nada, getPlayerSkin te saldra error xq sera removido usa getElementModel en vez de getPlayerSkin. Y para obtener objetos de un mapa podes usar getElementID. Nunca lo utilize buscalo en la wiki para mas info.
  18. Sasu

    ACL Label

    How do I do to set text in label the ACL of player?
  19. Sasu

    Admin error

    I have the same problem with resource 'superman'
  20. Sorry change: if msg == 'ping' and msgT == 1 then to if msg == 'ping' and msgT == 0 then And check in the meta that the type script is server. Execute command debugscript 3 on game to see if it has error.
  21. Try this: addEventHandler('onPlayerChat', root, -- When player sends the message in chatbox function ( msg, msgT ) if msg == 'ping' and msgT == 1 then -- if message was "ping" then cancelEvent ( ) -- don't show the message outputChatBox(getPlayerName(source) .. "'s ping is: " .. getPlayerPing (source), root, 255, 255, 0 , true) -- Output player's name and ping end end )
  22. Sasu

    colshape

    I want that the object create a projectile. local object = createObject(3267, 1304.9000244141, -2081.1000976563, 73.599998474121, 0, 0, 47.840698242188)
  23. Sasu

    colshape

    Why this dont create a projectile? function projectiles(hitElement) if source == colshape then if getElementType(hitElement) == "player" then local data = getElementData(hitElement, "Basejuli") if data == "Aceptado" then outputChatBox("Bienvenido a la base", 0, 255, 0) else createProjectile(object, 20, _,_,_, 200, hitElement) outputChatBox("Intruso detectado. Lanzando projectiles...", 255, 0, 0) end end end end addEventHandler("onClientColShapeHit", root, projectiles)
  24. It doesn't work Also when I type the command for my other commands like this: addEventHandler ( "onPlayerChat", root, function ( message ) if ( message == "players" ) then outputChatBox("we are "..getPlayerCount( source ).. " players",root,255,255,0,true) cancelEvent ( ) end end ) It shows the message before I say that ((( I mean this happened, I say players[/ban] and... Me: players we are 1 players It happened... That PLease Help getPlayerCount haven't arguments so delete "source".
  25. He put the name of the player in the end. outputChatBox("You're in "..getTeamName( getPlayerTeam ( source ) ).. " team "..getPlayerName( source ),root,255,255,255,true)
×
×
  • Create New...