-
Posts
82 -
Joined
-
Last visited
Everything posted by Peti
-
EDIT First part done by myself, sorry: function clickIzquierdo(boton, estado) if boton == 'left' and estado == 'up' then local skinPed = guiGridListGetItemText(listaPedsDisponibles, guiGridListGetSelectedItem(listaPedsDisponibles), 1) setElementModel(localPlayer, skinPed) end end addEventHandler('onClientGUIClick', listaPedsDisponibles, clickIzquierdo) function flechas(boton, estado) if estado == true then local filaSeleccionada, columnaSeleccionada = guiGridListGetSelectedItem(listaPedsDisponibles) if boton == 'arrow_u' then guiGridListSetSelectedItem(listaPedsDisponibles, filaSeleccionada - 1, columnaSeleccionada, true) setElementModel(localPlayer, guiGridListGetItemText(listaPedsDisponibles, filaSeleccionada - 1, columnaSeleccionada)) elseif boton =='arrow_d' then guiGridListSetSelectedItem(listaPedsDisponibles, filaSeleccionada + 1, columnaSeleccionada, true) setElementModel(localPlayer, guiGridListGetItemText(listaPedsDisponibles, filaSeleccionada + 1, columnaSeleccionada)) end if filaSeleccionada == -1 then guiGridListSetSelectedItem(listaPedsDisponibles, 0, 1, true) end end end addEventHandler('onClientKey', root, flechas) Now, I need to know about the second part.
-
Well, the title is self explanatory. How I do that? I have a list with the click event, but I want to allow the user to navigate said list with arrows up and down. Also, I need to trigger the event aswell. P.S: BTW, how I get the name of each skin? I must do it by hand? local tablaSkins = getValidPedModels() local listaPedsDisponibles = guiCreateGridList(0.04, 0.1, 0.4, 0.78, true, ventanaCrearPed) local columnaSkins = guiGridListAddColumn(listaPedsDisponibles, 'Skins', 0.75) if (columnaSkins) then for _, skin in pairs(tablaSkins) do local fila = guiGridListAddRow(listaPedsDisponibles, skin) guiGridListSetItemText(listaPedsDisponibles, fila, columnaSkins, skin, false, true) end end addEventHandler('onClientGUIClick', listaPedsDisponibles, function(boton, estado) if boton == 'left' and estado == 'up' then local skinPed = guiGridListGetItemText(listaPedsDisponibles, guiGridListGetSelectedItem(listaPedsDisponibles), 1) setElementModel(localPlayer, skinPed) end end
-
¿Creas un timer por cada jugador que ingresa al servidor? No suena como la cosa más optimizada posible. ¿Por qué no guardas la hora que se conectó y la hora que se desconectó y luego haces una diferencia entre ambas?
-
Hi, I'm here with more questions. 1. What's the difference between creating peds on server and client? 2. If I want to make a ped that shoot people, I must do it on client or server? 3. Where do you usually create your peds (client or server)? Why?
-
My bad. If you take a look at the function, it says: bool killPed ( ped thePed, [ ped theKiller = nil, int weapon=255, int bodyPart=255, bool stealth = false ] ) You must provide an actual ped, not an ID, otherwise it would says "int thePed". Try getting the ped by its id, then proceed to delete it, just as DNL told you. P.S.: Don't worry about making tons of posts, this is the biggest scripting forum after all, but a good practise is to look at the Wiki and the examples it gives to you.
-
I've edited my post. Read it again, hope it helps
-
function matarPed(player, command, pedId) if killPed (pedId) then outputChatBox("Mataste", player) else outputChatBox("Erro", player) end end
-
Hi, as you may or not may know, I'm a total newbie trying to learn how to code by making basic scripts. Thankfully, today I released my first open source script so you guys can see it. Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=15854 It is just a basic mission in which you have to ride a pizzaboy hitting random markers. Also, there is a time limit (5 minutes) and if you do it correctly, you receieve 1000 dollars. Let me know if you use it and I'm open to suggestions
-
My bad, try this: setPlayerHudComponentVisible ( thePlayer, 'radar', false ) -- server-side. or setPlayerHudComponentVisible ( 'radar', false ) -- client-side.
-
Mi error! Gracias!
-
Try this instead showPlayerHudComponent ( 'radar', false );
-
I'm a total newbie here, but try to define the player and assign the plant to him. https://wiki.multitheftauto.com/wiki/SetElementData local plantsTable = { } local plant = createObject(...) setElementData(plant, 'id_player', playerId) plantsTable[index] = plant Then you can delete the plant which that player has. I don't know if this is correct, but definitely I would try it.
-
Espero no llegar muuuy tarde: showPlayerHudComponent ( 'radar', false ); Client-side.
-
I think you should take a look at these two: https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPoints2D https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPoints3D
-
lol!!!!!!1111!!!111!!!!11!!!ONE TEARSOFJOYEMOJI Hello, @MissCrow, try watching this video: https://www.youtube.com/watch?v=-FSqetbJj7U&list=PLUjRUDY47rlWA9KliNOTYwx0Xd2dSZ-sJ&index=10&t=2s
-
Here. This is a script for your server, you can't use it in servers where they don't have it.
-
Timer = setTimer( function () for _, plr in ipairs(Element.getAllByType("player")) do if (getWantedPoints(plr) and not getElementData(plr,"ArrestedBy")and not getElementData(plr,"Jailed") == true ) then if (getWantedPoints(plr) > 0) then setWantedPoints(plr, getWantedPoints(plr) - 1) end end end end, 60 * 1000, 0 ) Timer is undefined.
-
No sé cómo ayudarte cuando no conozco el script, jajaja.
-
I think it is a syntax error. Check if "Timer" is really called "Timer" and not "timer", "timeR" or whatever.
-
Se necesitan más datos. Qué bug, el link al script, esas cosas.
-
You're the GOAT. Thank you, man. I'm going to modify my code using your suggestions.