Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. -- server function makeadmin ( thePlayer, commandName, targetPlayer ) if ( hasObjectPermissionTo ( thePlayer, "command.makeadmin", true ) ) then local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick ( thePlayer, targetPlayer ) if ( not targetPlayer ) then outputChatBox ( "SYNTAX: ".. commandName ..": [PlayerName]", thePlayer ) else local targetPlayerAcc = getAccountName ( getPlayerAccount ( targetPlayer ) ) if ( targetPlayerAcc ) then aclGroupAddObject ( aclGetGroup ( "Admin" ), "user.".. targetPlayerAcc ) end end end end addCommandHandler ( "makeadmin", makeadmin ) Problems: 1: getPlayerAccount ( targetPlayer ) should have been after the "else". 2: You forgot to get the account name of the player with: getAccountName ( theAccount ).
  2. I don't see anything wrong with it. P.S: Why you declare your tables global? they should be local inside the function.
  3. panel = guiCreateWindow(217,172,327,240,"Panel",false) Players = guiCreateGridList(24,46,133,162,false,Players) guiGridListSetSelectionMode(Players,2) guiGridListAddColumn(Players,"Players",0.2) add = guiCreateButton(189,58,112,35,"Add Player",false,panel) remove = guiCreateButton(188,125,113,41,"Remove Player",false,panel) guiWindowSetMovable(panel,false) guiWindowSetSizable(panel,false) guiSetVisible(panel,false) function addP() guiSetVisible (panel,true) showCursor(true) end addCommandHandler("AFP",addP) -- getRootElement() esta de mas. function closePanel() if guiGetVisible(panel) then guiSetVisible(panel,false) showCursor(false) end end addCommandHandler("CFP",closePanel) -- getRootElement() esta de mas.
  4. Castillo

    Open Window

    I actually learned like 50p said.
  5. Are you sure they aren't being saved? try adding debug outputs to the script.
  6. https://wiki.multitheftauto.com/wiki/Weapons Are you sure that I didn't say: "A player can have a weapon of every slot." ?
  7. There's only 12 weapon slots.
  8. Castillo

    Open Window

    You can use: guiBringToFront as well.
  9. Are you sure that is the first argument the problem? I don't see why it wouldn't work.
  10. addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, thePlayer in ipairs ( getElementsByType ( "player" ) ) do if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) bindKey ( thePlayer, "F2", "down", bindear ) end end end end ) function bindear ( thePlayer ) triggerClientEvent ( thePlayer, "open:pGUI", thePlayer ) end
  11. @Alexs_Steel: The spaces between variable names has nothing to do with his problem, they make no difference. @blazy: The only problem I see is that you set "or N/A", but the function should return 3 arguments, so with one it'll cause that error. function refreshData ( ) local x, y, z = getElementPosition ( localPlayer ) local location = getZoneName ( x, y, z ) or "N/A" guiSetText ( perDataLabel[5], "Position : ".. tostring ( x ) ..",".. tostring ( y ) ..",".. tostring ( z ) ) guiSetText ( perDataLabel[6], "Location : ".. tostring ( location ) ) end
  12. I guess he's talking about the "Remote Management" window example, I doubt he knows what is this for.
  13. Castillo

    Button color

    You're welcome.
  14. Castillo

    Button color

    You can't change the button color, but yes the text color, you must use: guiSetProperty Search for the correct property.
  15. Very nice tutorial, it'll help these who don't know this. Good job .
  16. local maxPing = 100 setTimer ( function ( ) for i, v in ipairs ( getElementsByType'player' ) do -- loop through all players if ( getPlayerPing ( v ) >= maxPing ) then -- if a player's ping is too high kickPlayer ( v, "You got kicked for having a high ping" ) -- kick him end end end ,1000, 0 -- repeat the check every 1 second ) "checkPing" function was useless.
  17. Eso no tiene nada quever ElMota, el quiere volver a seleccionar el item que estaba seleccionado. @Araa: Usa esta funcion: https://wiki.multitheftauto.com/wiki/Gui ... lectedItem
  18. Castillo

    Musica

    Tendrias que crear un script que cree los teams al iniciar el recurso.
  19. Castillo

    Musica

    onPlayerCommand triggerClientEvent playSound
×
×
  • Create New...