Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That's because each vehicle is different.
  2. Castillo

    [TUT] SQLite

    As far as I know, is not required.
  3. Go to "freeroam/fr_client.lua" and remove this: function createVehicleCommand(cmd, ...) local vehID local vehiclesToCreate = {} local args = { ... } for i,v in ipairs(args) do vehID = tonumber(v) if not vehID then vehID = getVehicleModelFromName(v) end if vehID then table.insert(vehiclesToCreate, math.floor(vehID)) end end server.giveMeVehicles(vehiclesToCreate) end addCommandHandler('createvehicle', createVehicleCommand) addCommandHandler('cv', createVehicleCommand)
  4. The same for every other GUI-element, "onClientGUIClick", but you must get selected item with: guiGridListGetSelectedItem
  5. Castillo

    PM system pls

    I haven't used it on that script. Is used to count the items of an indexed table, or a variable to count the characters.
  6. Castillo

    PM system pls

    What do you mean by "has tag"? About ipairs & pairs differences: http://www.luafaq.org/#T1.10
  7. Castillo

    PM system pls

    addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) chats = { } pmmain = guiCreateWindow(1020, 410, 253, 398, "", false) guiWindowSetSizable(pmmain, false) playerlist = guiCreateGridList(10, 68, 234, 277, false, pmmain) pcolumn = guiGridListAddColumn(playerlist, "Player List", 0.9) pmbut = guiCreateButton(20, 357, 80, 27, "Msg", false, pmmain) notifychk = guiCreateCheckBox(130, 360, 93, 21, "sound", true, false, pmmain) ftalabel = guiCreateLabel(42, 40, 170, 18, "pm system", false, pmmain) guiSetFont(ftalabel, "clear-normal") playerName = guiGridListGetItemText ( playerlist, guiGridListGetSelectedItem ( playerlist ), 1 ) for id, player in ipairs ( getElementsByType ( "player" ) ) do guiGridListSetItemText ( playerlist, guiGridListAddRow ( playerlist ), pcolumn, getPlayerName ( player ), false, false ) end -- addEventHandler( "onClientGUIDoubleClick", playerlist, msgwino, false ) -- guiSetVisible ( pmmain, false ) end ) function msgwino () local row, col = guiGridListGetSelectedItem ( playerlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( playerlist, row, 1 ) local player = getPlayerName ( getPlayerFromName ( playerName ) ) if ( player ) then chats [ player ] = { } chats [ player ].window = guiCreateWindow(889, 491, 342, 298, "PM with: " ..playerName, false) guiWindowSetSizable(chats [ player ].window, false) chats [ player ].memo = guiCreateMemo(14, 45, 312, 206, "", false, chats [ player ].window) guiMemoSetReadOnly(chats [ player ].memo, true) chats [ player ].edit = guiCreateEdit(14, 261, 227, 26, "", false, chats [ player ].window) guiSetProperty(chats [ player ].edit, "NormalTextColour", "FF7F7F7F") chats [ player ].send = guiCreateButton(248, 260, 78, 27, "Send", false, chats [ player ].window) chats [ player ].close = guiCreateButton(314, 23, 18, 18, "X", false, chats [ player ].window) addEventHandler ( "onClientGUIClick", chats [ player ].close, function ( ) destroyElement ( chats [ player ].window ) end ,false ) end end end bindKey ( "F3", "down", function ( ) if ( guiGetVisible ( pmmain ) == false ) then guiSetVisible ( pmmain, true ) showCursor ( guiGetVisible ( pmmain ) ) guiSetInputEnabled ( true ) toggleAllControls ( false ) else guiSetVisible ( pmmain, false ) showCursor ( guiGetVisible ( pmmain ) ) guiSetInputEnabled ( false ) toggleAllControls ( true ) for _, elements in pairs ( chats ) do for _, element in pairs ( elements ) do if ( isElement ( element ) ) then if ( getElementType ( element ) == "gui-window" ) then guiSetVisible ( element, false ) end end end end end end )
  8. Castillo

    PM system pls

    Post your entire script.
  9. Castillo

    PM system pls

    Use this: for _, element in pairs ( chats ) do if ( isElement ( element ) ) then if ( getElementType ( element ) == "gui-window" ) then guiSetVisible ( element, false ) end end end That should hide all the windows.
  10. Castillo

    PM system pls

    What are you trying to do?
  11. Castillo

    PM system pls

    'player' is not defined anywhere.
  12. Decis categorias? entonces si, crea una carpeta nueva asi: [nombre], y luego metes los recursos dentro.
  13. Castillo

    error

    You're welcome.
  14. Castillo

    error

    addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local zombiekills = getAccountData(account,"Zombie kills") or 0 if (zombiekills >= 0) and (zombiekills <= 4) then setAccountData ( account, "Rango", "Nuevo" ) elseif (zombiekills >= 5) and (zombiekills <= 99) then setAccountData ( account, "Rango", "Iniciado" ) elseif (zombiekills >= 100) and (zombiekills <= 249) then setAccountData ( account, "Rango", "Aficionado" ) elseif (zombiekills >= 250) and (zombiekills <= 499) then setAccountData ( account, "Rango", "Amateur" ) elseif (zombiekills >= 500) and (zombiekills <= 999) then setAccountData ( account, "Rango", "Asesino" ) elseif (zombiekills >= 1000) and (zombiekills <= 1499) then setAccountData ( account, "Rango", "Maestro" ) elseif (zombiekills >= 1500) and (zombiekills <= 1999) then setAccountData ( account, "Rango", "Cannibal" ) elseif (zombiekills >= 2000) and (zombiekills <= 2999) then setAccountData ( account, "Rango", "Rampager" ) elseif (zombiekills >= 3000) and (zombiekills <= 3999) then setAccountData ( account, "Rango", "Monster" ) elseif (zombiekills >= 4000) and (zombiekills <= 4999) then setAccountData ( account, "Rango", "Blooder" ) elseif (zombiekills >= 5000) and (zombiekills <= 5999) then setAccountData ( account, "Rango", "ZombieKiller" ) elseif (zombiekills >= 5000) and (zombiekills <= 5999) then setAccountData ( account, "Rango", "HeadShooter" ) elseif (zombiekills >= 6000) and (zombiekills <= 6999) then setAccountData ( account, "Rango", "Animal" ) elseif (zombiekills >= 7000) and (zombiekills <= 7999) then setAccountData ( account, "Rango", "Depredador" ) elseif (zombiekills >= 8000) and (zombiekills <= 8999) then setAccountData ( account, "Rango", "Psicopata" ) elseif (zombiekills >= 9000) and (zombiekills <= 10000000) then setAccountData ( account, "Rango", "PsykoKiller" ) end end ) addEventHandler("onPlayerSpawn",root, function () local cuenta = getPlayerAccount(source) if isGuestAccount(cuenta) then return end local rango = getAccountData(cuenta,"Rango") if rango then setElementData(source,"Rango", rango) end end ) I added so if 'Zombie kills' account data is nil, it'll be 0.
  15. Castillo

    error

    Obviously "zombiekills" is returning "nil" because the data is not there.
  16. Castillo

    PM system pls

    chats = { } function msgwino () local row, col = guiGridListGetSelectedItem ( playerlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( playerlist, row, 1 ) local player = getPlayerFromName ( playerName ) if ( player ) then chats [ player ] = { } chats [ player ].window = guiCreateWindow(889, 491, 342, 298, "PM with: " ..playerName, false) guiWindowSetSizable(chats [ player ].window, false) chats [ player ].memo = guiCreateMemo(14, 45, 312, 206, "", false, chats [ player ].window) guiMemoSetReadOnly(chats [ player ].memo, true) chats [ player ].edit = guiCreateEdit(14, 261, 227, 26, "", false, chats [ player ].window) guiSetProperty(chats [ player ].edit, "NormalTextColour", "FF7F7F7F") chats [ player ].send = guiCreateButton(248, 260, 78, 27, "Send", false, chats [ player ].window) chats [ player ].close = guiCreateButton(314, 23, 18, 18, "X", false, chats [ player ].window) addEventHandler ( "onClientGUIClick", chats [ player ].close, function ( ) _destroyElement ( chats [ player ].window ) end ,false ) end end end I haven't tested it, I leave that to you.
  17. Castillo

    MTA Market

    This website isn't for these who know how to script, that would be useless. Let these who will actually want to buy to discuss if it's expensive for them. I've lowered the prices of many things. P.S: It doesn't take just 5 minutes, takes more.
  18. https://wiki.multitheftauto.com/wiki/OnPlayerStealthKill
  19. Castillo

    PM system pls

    function msgwino () local row, col = guiGridListGetSelectedItem ( playerlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( playerlist, row, 1 ) msgwin = guiCreateWindow(889, 491, 342, 298, "PM with: " ..playerName, false) guiWindowSetSizable(msgwin, false) chatmemo = guiCreateMemo(14, 45, 312, 206, "", false, msgwin) guiMemoSetReadOnly(chatmemo, true) sendpm = guiCreateEdit(14, 261, 227, 26, "", false, msgwin) guiSetProperty(sendpm, "NormalTextColour", "FF7F7F7F") sendbut = guiCreateButton(248, 260, 78, 27, "Send", false, msgwin) close = guiCreateButton(314, 23, 18, 18, "X", false, msgwin) end end You can make a table to store all GUI elements of each chat.
  20. You may want to set it when he enters the vehicle instead. addEventHandler ( "onVehicleEnter", getRootElement(), function ( player ) local team = getPlayerTeam ( player ) if ( not team ) then setVehicleColor ( source, 255, 255, 255 ) end end )
  21. I'm not sure, but I think you would need to edit the race game mode itself to add a check so non logged players don't spawn.
  22. Castillo

    No funciona

    Sera porque nunca ejecutas la funcion 'show' que es lo que agrega los jugadores? P.D: Cambia el nombre de esta variable: createTeam = guiCreateButton(243,186,256,52,"Create team",false,Ventana)
  23. Castillo

    Simbol

    You're welcome.
  24. Castillo

    Simbol

    It's the same as any other letter.
×
×
  • Create New...