-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
Agrega: exports.scoreboard:scoreboardAddColumn("ID", root, 10, _, 1) function giveID() for i,v in ipairs(getElementsByType("player")) do setElementData(v, "ID", i) end end addEventHandler("onResourceStart", resourceRoot, giveID) addEventHandler("onPlayerJoin", root, giveID) addEventHandler("onPlayerQuit", root, giveID)
-
EDIT: Lo acabo de testear, y funciona perfectamente. getPlayerID --[[ Funcion getPlayerID Argumentos: source -- El jugador de quien quieres obtener el ID Devolucion: Devuelve un numero con la ID del jugador ]] function getPlayerID(source) local ID = false if source and isElement(source) then if getElementType(source) == "player" then for i,v in ipairs(getElementsByType("player")) do if v == source then ID = i break end end else return false end else return false end return ID end function chatbox(text, msgtype) local r,g,b = getPlayerNametagColor(source) local name = getPlayerName(source) local accountname = getAccountName (getPlayerAccount(source)) local Account = getPlayerAccount ( source ) local jugadorID = tostring(getPlayerID(source)) if (msgtype == 0) then if isGuestAccount ( Account ) then cancelEvent() outputChatBox("[".. jugadorID .."]#ffffff[invitado] "..RGBToHex(r,g,b)..name..": #ffffff"..text, getRootElement(),0,0,0,true) outputServerLog( "CHAT: [invitado] " .. getPlayerName ( source ).. ": " .. text ) elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then cancelEvent() outputChatBox("[".. jugadorID .."]#cc0000[ADMIN] "..RGBToHex(r,g,b)..name..": #ffffff"..text, getRootElement(),0,0,0,true) outputServerLog( "CHAT: [ADMIN] " .. getPlayerName ( source ).. ": " .. text) elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "SuperModerator" ) ) then cancelEvent() outputChatBox("[".. jugadorID .."]#ffcc00[ultra Moderador] "..RGBToHex(r,g,b)..name..": #ffffff"..text, getRootElement(),0,0,0,true) outputServerLog( "CHAT: [ultra Moderador] " .. getPlayerName ( source ).. ": " .. text ) elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Moderator" ) ) then cancelEvent() outputChatBox("[".. jugadorID .."]#00ff00[Moderador] "..RGBToHex(r,g,b)..name..": #ffffff"..text, getRootElement(),0,0,0,true) outputServerLog( "CHAT: [Moderador " .. getPlayerName ( source ).. ": " .. text ) elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Console" ) ) then cancelEvent() outputChatBox("[".. jugadorID .."]#cccccc[Consola] "..RGBToHex(r,g,b)..name..": #ffffff"..text, getRootElement(),0,0,0,true) outputServerLog( "CHAT: [Consola] " .. getPlayerName ( source ).. ": " .. text ) elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Everyone" ) ) then cancelEvent() outputChatBox("[".. jugadorID .."]#00b6f2[Jugador] "..RGBToHex(r,g,b)..name..": #ffffff"..text, getRootElement(),0,0,0,true) outputServerLog( "CHAT: [Jugador] " .. getPlayerName ( source ).. ": " .. text ) end end end addEventHandler("onPlayerChat", getRootElement(), chatbox) Recuerda tener la funcion useful "RGBToHex" o sino te dara error. Si no la tienes, aqui esta: function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end RGBToHex
-
I am not using race pickups. I am using weapons pickups. Anybody knows how to destroy weapon pickups?
-
How can I destroy a pickup? Because I used destroyElement but then respawn again.
-
Pues intenta. No podemos darte todo.
-
Podrias colocar todo el codigo? O si quieres puedes mandarmelo por PM y yo lo arreglare.
-
Es mejor reparar tu script como dice Alexs: --Client function updatePlayerInfo(ip, serial, account, money, ping, skin) guiSetText(jugadorSerial, serial) guiSetText(jugadorIP, ip) guiSetText(jugadorCuenta, account) guiSetText(jugadorDinero, money) guiSetText(jugadorPing, ping) guiSetText(jugadorSkin, skin) end addEvent("actualizarGuis", true) addEventHandler("actualizarGuis", getRootElement(), updatePlayerInfo) function refreshInfoLabel(name) triggerServerEvent("actualizarGui", localPlayer, name) end function whenClickPlayersList() if (source == playersList) then if (guiGridListGetSelectedItem(playersList) ~= -1) then selectedPlayer = guiGridListGetItemText(playersList, guiGridListGetSelectedItem(playersList), 1) guiSetText(playerNameEdit, selectedPlayer) refreshInfoLabel(selectedPlayer) end end end function onUpdateplayersList() guiGridListClear(playersList) for id, playeritem in ipairs (getElementsByType("player")) do local row = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, row, 1, getPlayerName(playeritem), false, false) end end addEventHandler("onClientPlayerJoin", getRootElement(), onUpdateplayersList) addEventHandler("onClientPlayerQuit", getRootElement(), onUpdateplayersList) addEventHandler("onClientPlayerChangeNick", getRootElement(), onUpdateplayersList) --Server function update(name) local who = getPlayerFromName (name); local account = getPlayerAccount( who ); local x, y, z = getElementPosition ( who ) triggerClientEvent (source, "actualizarGuis", source, getPlayerIP ( who ), getPlayerSerial ( who ), getAccountName ( account ), getPlayerMoney ( who ), getPlayerPing ( who ), getElementModel ( who ) ) end addEvent("actualizarGui", true) addEventHandler("actualizarGui", getRootElement(), update)
-
getPlayerIP y getPlayerAccount son funciones de server.
-
No. Y recuerda agregarlo al ACL Admin.
-
Y cual seria la funcion de esa funcion que dijiste?
-
En la wiki, hay un script, justo lo que queres. function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player"))do -- Loop all online players if (getPlayerIdleTime(thePlayer) > 300000) then -- Player hasn't moved for 300,000ms (5 minutes) kickPlayer(thePlayer, "Idle for 5 minutes") -- Kick the idle player end end end setTimer(checkAFKPlayers, 30000, 0) -- Timer to execute every 30 seconds, checking for idlers https://wiki.multitheftauto.com/wiki/GetPlayerIdleTime
-
No necesariamente. Puede crear una gui-imagen y usar el evento "onClientGUIClick".
-
https://community.multitheftauto.com/in ... ls&id=7468
-
Use los if's necesarios. Y no estoy enojado, es porque yo escribo asi . Seria tonto enojarse porque alguien le corrije. Podrías haber hecho un script mucho mas corto si usaras un for para los outPutChatBox si hubieses guardado los datos como Lv[1], Lv[2], Lv[3] y Lv[4]. Si lo hubieses hecho así el for te abría quedado así mira: for i=1,4 do if #lv[i] ~= 0 then outputChatBox("Level "..#lv[i]..": "..table.concat(lv[i], ", "), source, 0, 255, 0) else outputChatBox("Level "..#lv[i]..": Ninguno", source, 0, 255, 0) end end Mmmm. No se me ocurrio. Muchas gracias .
-
Use los if's necesarios. Y no estoy enojado, es porque yo escribo asi . Seria tonto enojarse porque alguien le corrije.
-
Yo hize el script. De que forma mas facil lo harias? Yo tambien quiero aprender usando "elseif" pero solo te ahorras los end..Es lo mismo En mi script, ya no es mas posible colocar mas elseif. Si quieres intentalo. Corrigeme si me equivoco.
-
Yo hize el script. De que forma mas facil lo harias? Yo tambien quiero aprender
-
Lo siento, me olvide de esi. Toma: function viewAdmin(source) local lv1 = {} local lv2 = {} local lv3 = {} local lv4 = {} for i,v in ipairs(getElementsByType("player")) do local accV = getPlayerAccount(v) local accName = getAccountName(accV) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv4" ) ) then table.insert(lv4, getPlayerName(v)) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv3" ) ) then table.insert(lv3, getPlayerName(v)) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv2" ) ) then table.insert(lv2, getPlayerName(v)) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv1" ) ) then table.insert(lv1, getPlayerName(v)) end end if #lv1 ~= 0 then outputChatBox("Level 1: "..table.concat(lv1, ", "), source, 0, 255, 0) else outputChatBox("Level 1: Ninguno", source, 0, 255, 0) end if #lv2 ~= 0 then outputChatBox("Level 2: "..table.concat(lv2, ", "), source, 0, 255, 0) else outputChatBox("Level 2: Ninguno", source, 0, 255, 0) end if #lv3 ~= 0 then outputChatBox("Level 3: "..table.concat(lv3, ", "), source, 0, 255, 0) else outputChatBox("Level 3: Ninguno", source, 0, 255, 0) end if #lv4 ~= 0 then outputChatBox("Level 4: "..table.concat(lv4, ", "), source, 0, 255, 0) else outputChatBox("Level 4: Ninguno", source, 0, 255, 0) end end addCommandHandler("admins", viewAdmin)
-
Modifica los ACL que yo puse por los tuyos. Y dime que dice en debugscript 3.
-
function viewAdmin(source) local lv1 = {} local lv2 = {} local lv3 = {} local lv4 = {} for i,v in ipairs(getElementsByType("player")) do local accV = getPlayerAccount(v) local accName = getAccountName(accV) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv4" ) ) then table.insert(lv4, getPlayerName(v)) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv3" ) ) then table.insert(lv3, getPlayerName(v)) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv2" ) ) then table.insert(lv2, getPlayerName(v)) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Lv1" ) ) then table.insert(lv1, getPlayerName(v)) end end if #lv1 ~= 0 then outputChatBox(table.concat(lv1, ", "), source, 0, 255, 0) else outputChatBox("Level 1: Ninguno", source, 0, 255, 0) end if #lv2 ~= 0 then outputChatBox(table.concat(lv2, ", "), source, 0, 255, 0) else outputChatBox("Level 2: Ninguno", source, 0, 255, 0) end if #lv3 ~= 0 then outputChatBox(table.concat(lv3, ", "), source, 0, 255, 0) else outputChatBox("Level 3: Ninguno", source, 0, 255, 0) end if #lv4 ~= 0 then outputChatBox(table.concat(lv4, ", "), source, 0, 255, 0) else outputChatBox("Level 4: Ninguno", source, 0, 255, 0) end end addCommandHandler("admins", viewAdmin) ( No testeado )
-
Mientras el cliente tenga la version 1.3 te deja entrar, a menos que el server tenga la configuracion de entrar solo si tienes la ultima version y revision.
-
viewtopic.php?f=148&t=56411#p545710 And Awesome
-
Original: https://community.multitheftauto.com/in ... ls&id=6772 Stolen: https://community.multitheftauto.com/in ... ls&id=7092 DONE
-
Fijate en mtaserver.conf te dice: <!-- Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described here: [url=https://wiki.multitheftauto.com/wiki/GetPlayerVersion]https://wiki.multitheftauto.com/wiki/GetPlayerVersion[/url] and look like this: 1.1.0-9.03100.0 Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the highest available. See: [url=https://nightly.multitheftauto.com/ver]https://nightly.multitheftauto.com/ver[/url] --> <minclientversion></minclientversion> <minclientversion></minclientversion> --> <minclientversion>1.3.3-9.05608.0</minclientversion>