Sergioks Posted December 16, 2013 Share Posted December 16, 2013 Hola! Tengo 1 Problema . Quiero Crear un Punish Panel para un proyecto que estoy haciendo. Cuando Quiero Banear a un usuario me salta un error con el hasObjectPermissionTo. Aqui mis lua's Client - Side: function Banear() showCursor ( true ) local reason = guiGetText ( GUIEditor.edit[1] ) local punished = guiGetText ( GUIEditor.gridlist[1] ) local timePunish = guiGetText ( GUIEditor.gridlist[2] ) triggerServerEvent("Ban", localPlayer, reason, punished, timePunish) end Server - Side: addEvent("Ban", true ) addEventHandler("Ban", root, function (reason, punished, timePunish, theClient) if ( hasObjectPermissionTo ( theClient, "function.banPlayer" ) ) then local bannedPlayer = getPlayerFromName ( punished ) banPlayer ( bannedPlayer, theClient, reason ) for _, player in ipairs ( getElementsByType ( "player" ) ) do outputChatBox ( "" .. punished .. " Fue Baneado Por ".. timePunish .." (Razon: ".. reason ..".", player, 255, 0, 0, true ) exports["notifications"]:showBox ( theClient, "info","El Usuario " .. punished .. " Ha Sido Baneado Exitosamente!!\n\nRazon: " .. reason .. "." ) exports["notifications"]:showBox ( theClient, "error","Usted No Posee Los Permisos para Banear!!" ) end end end ) Lo que me salta en la consola cuando doy click en el boton "banear" WARNING: Server.lua:55: Bad Arguments @ 'hasObjectPermissionTo' ¿Que Me Falta hacer? o que error tube? - Gracias por leer Link to comment
Arsilex Posted December 16, 2013 Share Posted December 16, 2013 addEvent("Ban", true ) addEventHandler("Ban", root, function (reason, punished, timePunish, theClient) if ( hasObjectPermissionTo ( client, "function.banPlayer" ) ) then banPlayer ( punished, client, reason ) for _, player in ipairs ( getElementsByType ( "player" ) ) do outputChatBox ( "" .. punished .. " Fue Baneado Por ".. timePunish .." (Razon: ".. reason ..".", player, 255, 0, 0, true ) exports["notifications"]:showBox ( theClient, "info","El Usuario " .. punished .. " Ha Sido Baneado Exitosamente!!\n\nRazon: " .. reason .. "." ) exports["notifications"]:showBox ( theClient, "error","Usted No Posee Los Permisos para Banear!!" ) end end end ) Link to comment
MTA Team 0xCiBeR Posted December 17, 2013 MTA Team Share Posted December 17, 2013 @Pekio te falto sacar theClient de los argumentos addEvent("Ban", true ) addEventHandler("Ban", root, function (reason, punished, timePunish) if ( hasObjectPermissionTo ( client, "function.banPlayer" ) ) then banPlayer ( punished, client, reason ) for _, player in ipairs ( getElementsByType ( "player" ) ) do outputChatBox ( "" .. punished .. " Fue Baneado Por ".. timePunish .." (Razon: ".. reason ..".", player, 255, 0, 0, true ) exports["notifications"]:showBox ( theClient, "info","El Usuario " .. punished .. " Ha Sido Baneado Exitosamente!!\n\nRazon: " .. reason .. "." ) exports["notifications"]:showBox ( theClient, "error","Usted No Posee Los Permisos para Banear!!" ) end end end ) Link to comment
Alexs Posted December 17, 2013 Share Posted December 17, 2013 @Pekio te falto sacar theClient de los argumentos addEvent("Ban", true ) addEventHandler("Ban", root, function (reason, punished, timePunish) if ( hasObjectPermissionTo ( client, "function.banPlayer" ) ) then banPlayer ( punished, client, reason ) for _, player in ipairs ( getElementsByType ( "player" ) ) do outputChatBox ( "" .. punished .. " Fue Baneado Por ".. timePunish .." (Razon: ".. reason ..".", player, 255, 0, 0, true ) exports["notifications"]:showBox ( theClient, "info","El Usuario " .. punished .. " Ha Sido Baneado Exitosamente!!\n\nRazon: " .. reason .. "." ) exports["notifications"]:showBox ( theClient, "error","Usted No Posee Los Permisos para Banear!!" ) end end end ) Removiste 'theClient' de los argumentos, sin embargo, lo utilizas en la linea 12 y en la linea 15. Link to comment
Sergioks Posted December 19, 2013 Author Share Posted December 19, 2013 @Pekio te falto sacar theClient de los argumentos addEvent("Ban", true ) addEventHandler("Ban", root, function (reason, punished, timePunish) if ( hasObjectPermissionTo ( client, "function.banPlayer" ) ) then banPlayer ( punished, client, reason ) for _, player in ipairs ( getElementsByType ( "player" ) ) do outputChatBox ( "" .. punished .. " Fue Baneado Por ".. timePunish .." (Razon: ".. reason ..".", player, 255, 0, 0, true ) exports["notifications"]:showBox ( theClient, "info","El Usuario " .. punished .. " Ha Sido Baneado Exitosamente!!\n\nRazon: " .. reason .. "." ) exports["notifications"]:showBox ( theClient, "error","Usted No Posee Los Permisos para Banear!!" ) end end end ) Removiste 'theClient' de los argumentos, sin embargo, lo utilizas en la linea 12 y en la linea 15. Como es el correcto? porque poniendo ese, y arreglando lo de "TheClient" y cambiandolo por "Client" como dice por alli, Me Dice: Server.lua:8: Access Denied @ "banPlayer" Link to comment
Alexs Posted December 19, 2013 Share Posted December 19, 2013 Tienes que dar permisos a este recurso desde el ACL. Link to comment
Sergioks Posted December 19, 2013 Author Share Posted December 19, 2013 Tienes que dar permisos a este recurso desde el ACL. Ya Lo Hice. ya no tengo problemas con el 'hasObjectPremissionTo' Ahora me dice lo siguiente: WARNING: Server.lua:8: Bad Argument @ 'banPlayer' ¿ Ahora que hago ? Link to comment
Recommended Posts