Tomas
Members-
Posts
2,530 -
Joined
-
Last visited
Everything posted by Tomas
-
No es así, pues también estaría reemplazando objetos existentes en el mapa original de San Andreas. Nope, si no lo creas con createObject no habría problema, es una odisea lograr reemplazar algo del mapa original https://wiki.multitheftauto.com/wiki/En ... odel_notes
-
Puedes usar cualquier ID, siempre y cuando que luego no las vuelvas a usar con createObject
-
Supongo que el draw utiliza getVehicleNameFromModel, postea la parte del script en la cuál se obtiene el nombre y te ayudo a crear excepciones
-
Intenta con esto: local max = -math.huge local maxv = nil for k, v in ipairs (getElementsByType("players")) do if ( getElementData(v, "zombieskilled") > max ) then maxv = v max = getElementData(v, "zombieskilled") end end if ( isElement(maxv) ) then outputChatBox(getPlayerName(maxv)) end
-
¿Esto no restaría la health del ataque con melee más el daño que tú das? ¿Quizás deberías usar cancelEvent? cancelEvent ( ) No estoy seguro, agradecería que me arreglaran esta duda... Depende de si getElementHealth obtiene la salud en el mismo evento, o justo con la salud de la katana perdida... ¿La Katana hace daño?
-
Me gusta bastante, lo único que le modificaría sería que la munición siempre esté en la misma posición, es decir, que la parte blanca esté en un lugar y la gris en otro que no cambie según las cifras.
-
http://stackoverflow.com/questions/1744 ... -converter
-
Problema de blip personalizado
Tomas replied to Nigichi's topic in Ayuda relacionada al cliente/servidor
Tienes que utilizar las funciones exportadas que trae el recurso, depende de lo que quieras hacer será la función que necesites. -
Los isElements y la comprobación del 'source' son innecesarias, no es necesario que compruebes que ambos jugadores tengan una gang, simplemente comparas ambas y luego sólo te fijas que una exista (o no sea false). Agregar los argumentos weapon y bodypart es un desperdicio de memoria ya que no los estás usando.
-
1. You're calling the function before defining it. 2. Replace local kapcsolat = exports["mysql"]:getConnection() with addEventHandler("onResourceStart", root, function(res) if ( ( res == getResourceFromName("mysql") ) or ( res == getThisResource() and getResourceState(res) == "running") ) then kapcsolat = exports["mysql"]:getConnection() end end ) 3. local mysql = exports.mysql local postable = {} local regisztalhat = true function playerRegister(player, username, password, password2) local md5password = md5(password) if(password~=password2)then triggerClientEvent("info",player,"A felhasználónév túl rövid!", "red") return end if(string.len(username)<5)then triggerClientEvent("info",player,"A felhasználónév túl rövid!", "red") return end if(string.len(password)<5)then triggerClientEvent("info", player, "A jelszó túl rövid!", "red") return end serial = getPlayerSerial(player) dbQuery(function(qh, player, username, md5password) local a, b, c = dbPoll(qh, 0) if b > 0 then outputChatBox("Neked már van accountod") regisztalhat = false return end end, {player,username,md5password}, mysql:getConnection(), "SELECT * FROM characters WHERE charactername='" .. safecharname .. "' AND account='" .. mysql:escape_string(id) .. "' AND cked = 0") dbQuery(function(qh, player, username, md5password) local result, rows, errorMsg = dbPoll(qh, 0) if not regisztalhat then return end if rows > 0 then exports.sg_box:addNotification("Ez a felhasználónév már foglalt!","red") else local _, id = mysql:query_free("INSERT INTO accounts SET serial = '".. serial .."', username = '"..tostring(username).."', password = '"..tostring(md5password).."'", true) exports.sg_box:addNotification("Sikeresen regisztráltál!","green") end end, {player,username,md5password}, mysql:getConnection(), "SELECT * FROM accounts WHERE username = ? LIMIT 1", username) end addEvent("playerRegister", true) addEventHandler("playerRegister", getRootElement(), playerRegister) function playerLogin(player, username, password) password = md5(password) local query = mysql:singleQuery("SELECT * FROM accounts WHERE username = ? AND password = ? LIMIT 1", username, password) if query then --local querys = mysql:singleQuery("SELECT serial FROM accounts WHERE username = ? LIMIT 1", username) outputChatBox("[socialGaming] #FFFFFFSikeres bejelentkezés!",player,169,139,101,true) setElementData(player, "accountID", query.id) acc = getElementData(player, "accountID") CharSelect(acc, player) setElementData(player, "adminlevel", query.admin) else outputChatBox("[socialGaming] #FFFFFFSikertelen bejelentkezés!",player,177,9,45,true) end end addEvent("playerLogin", true) addEventHandler("playerLogin", getRootElement(), playerLogin) addEvent("createCharacter", true) addEventHandler("createCharacter", getRootElement(), function(p, nev, kor, suly, magassag, leiras, gender, color) acc = getElementData(p, "accountID") local qh = dbQuery( mysql:getConnection(), "SELECT `charactername` FROM `karakterek` WHERE `charactername` = ?", tostring(a)) local result = dbPoll ( qh, -1 ) local count = 0 local pw u = nil if result then for _, row in ipairs ( result ) do u = string.lower(row["charactername"]) end if u ~= nil then exports.sg_box:createSmallNotification(client,"Már van ilyen karakter név, kérlek válassz másikat!", 1) return end end dbFree( qh ) local user = getElementData(client, "username") qhh = dbExec( mysql:getConnection(), "INSERT INTO `karakterek` SET `charactername` = ?, `id` = ?, `skin` = 1, `kor` = ?, `suly` = ?, `magassag` = ?, `leiras` = ?, `gender` = ?,`color` = ? ", nev, acc, kor, suly, magassag, leiras, gender, color) if qhh then CharSelect(acc, p) end end) local postable = {} function CharSelect(acc, source) local accid = getElementData(source,"accountID") local qh = dbQuery(mysql:getConnection(),"SELECT * FROM karakterek WHERE id = ? LIMIT 1", accid) local result, lineNumber = dbPoll ( qh, -1 ) if(result) then if(lineNumber > 0) then for _, rows in ipairs( result ) do postable = {} level = rows["level"] xp = rows["xp"] jatszottpercek = rows["spentTime"] nev = rows["charactername"] anev = rows["adminnick"] fraki = rows["faction"] frakir = rows["factionrank"] factionleader = rows["factionleader"] skin = rows["skin"] dutyskin = rows["dutyskin"] induty = rows["inDuty"] kor = rows["kor"] suly = rows["suly"] mag = rows["magassag"] job = rows["job"] desc = rows["leiras"] gender = rows["gender"] health = rows["health"] bankmoney = rows["bankmoney"] keszpenz = rows["keszpenz"] money = rows["money"] color = rows["color"] pajzs = rows["pajzs"] ehesseg = rows["ehesseg"] maxvehicles = rows["maxvehicles"] hasznaltkocsislot = rows["hasznaltkocsislot"] premiumPont = rows["premiumPont"] adminduty = rows["adminduty"] adminlevel = rows["adminlevel"] pozicio = fromJSON(rows["pozicio"]) postable = {pozicio[1],pozicio[2],pozicio[3],pozicio[4]} halal = rows["isDead"] end setPlayerName(source, string.gsub(nev, " ", "_")) setElementData(source, "charactername", nev) setElementData(source, "adminduty", 0) setElementData(source, "adminnick", anev) spawnPlayer(source, postable[1], postable[2], postable[3], postable[4]) setElementData(source, "logedin", true) setElementData(source, "jatszottpercek", jatszottpercek) setElementData(source, "faction", fraki) setElementData(source, "factionrank", frakir) setElementData(source, "factionleader", factionleader) setElementData(source, "age", kor) setElementData(source, "gender", gender) setElementData(source, "bankmoney", bankmoney) setElementData(source, "keszpenz", keszpenz) setElementData(source, "adminduty", adminduty) setElementData(source, "adminlevel", adminlevel) setElementData(source, "premiumPont", premiumPont) setElementData(source, "xp", xp) setElementData(source, "level", level) if halal == 1 then setElementHealth(source, 0) else setElementHealth(source, health) end setElementData(source, "money", money) setElementData(source, "color", color) setPedArmor(source, pajzs) setElementData(source, "weight", suly) setElementData(source, "height", mag) setElementData(source, "desc", desc) setElementData(source, "job:id", job) setElementData(source, "ehesseg", ehesseg) setElementData(source, "maxvehicles", maxvehicles) setElementData(source, "hasznaltkocsislot", hasznaltkocsislot) setElementData(source, "normalskin", skin) setElementData(source, "dutyskin", dutyskin) setElementData(source, "inDuty", induty) if getElementData(source, "inDuty") then actualskin = getElementData(source, "dutyskin") else actualskin = getElementData(source, "normalskin") end setElementModel(source, actualskin) --color health ehesseg pajzs spentTime faction factionrank factionleader maxVeh maxInt setCameraTarget(source) triggerClientEvent(source,"succes", source) else triggerClientEvent(source,"characterCreation", source) end end end addEventHandler("onPlayerQuit", getRootElement(), function() if getElementData(source, "logedin") then savePlayer(source) end end) function savePlayer(p) if isElement(p) then local x,y,z = getElementPosition(p) local rot = getPedRotation(p) local dbid = tonumber(getElementData(p, "accountID")) or 0 local admin = tonumber(getElementData(p, "adminlevel")) or 0 local position = toJSON({x,y,z,rot}) local orak = getElementData(p, "jatszottpercek") or 0 local faction = getElementData(p, "faction") or 0 local hp = getElementHealth(p) local bankmoney = getElementData(p, "bankmoney") local keszpenz = getElementData(p, "keszpenz") local money = getElementData(p, "money") local armor = getPedArmor(p) local ehesseg = getElementData(p, "ehesseg") local skin = getElementData(p, "normalskin") local duty = getElementData(p, "inDuty") local dutyskin = getElementData(p, "dutyskin") local job = getElementData(p, "job:id") local maxvehicles = getElementData(p, "maxvehicles") or 4 local hasznaltkocsislot = getElementData(p, "hasznaltkocsislot") or 0 local premiumPont = getElementData(p, "premiumPont") or 0 local xp = getElementData(p, "xp") or 0 local level = getElementData(p, "level") or 0 dbExec(mysql:getConnection(), "UPDATE karakterek SET pozicio = ?, spentTime = ?, faction = ?, health = ?, bankmoney = ?, money = ?, pajzs = ?, ehesseg = ?, skin = ?, job = ? WHERE ID = ?", position, spentTime, faction, hp, bankmoney, money, armor, ehesseg, skin, job, dbid) dbExec(mysql:getConnection(), "UPDATE karakterek SET maxvehicles = ?,hasznaltkocsislot = ?,premiumPont = ?, inDuty = ?, dutyskin = ?, keszpenz = ? WHERE ID = ?", maxvehicles,hasznaltkocsislot,premiumPont, duty, dutyskin,keszpenz,dbid) dbExec(mysql:getConnection(), "UPDATE accounts SET admin = ? WHERE ID = ?",admin,xp,level,dbid) dbExec(mysql:getConnection(), "UPDATE karakterek SET xp=?,level=? WHERE ID = ?",xp,level,dbid) end end addEvent("savePlayer", true) addEventHandler("savePlayer", getRootElement(), savePlayer) function saveAllPlayer() local count = 0 for i, p in ipairs(getElementsByType("player")) do if (getElementData(p, "logedin") or false) then savePlayer(p) count = count + 1 end end outputDebugString("Ellett mentve "..count.." jatekos adata!") end saveAllPlayer() setTimer(saveAllPlayer, 1000*60*10, 0) addCommandHandler("saveall",saveAllPlayer) addEvent("checkPlayerBanState", true) addEventHandler("checkPlayerBanState", getRootElement(), function(player) local serial = getPlayerSerial(player) local query = dbQuery(mysql:getConnection(),"SELECT * FROM banlist WHERE serial=?",serial) local qh = dbPoll(query, -1) local playerSerial, timeStamp, bannedBy, reason if #qh > 0 then for k, data in
-
You may also use MySQL, under which version are you running MyBB?
-
O simplemente %D, quita todo lo que no sean números
-
Could you explain your problem? dont get it
-
Borra desde la línea 209 a la 217 y reemplaza este código por el que está desde la 203 a la 207 addEventHandler("onClientResourceStart", resourceRoot, function () username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( recordar, true ) guiSetText ( editUsuario, tostring(username)) guiSetText ( editPassword, tostring(password)) else guiCheckBoxSetSelected ( recordar, false ) guiSetText ( editUsuario, tostring(username)) guiSetText ( editPassword, tostring(password)) end end )
-
Esta? https://community.multitheftauto.com/index.php?p= ... ls&id=7615
-
Blindado al 100 por ciento? que no reciba daño o que reciba menos?
-
Entonces el problema es el guardado, publica el script completo.
-
No creo que logres que sólo se dibuje afuera, deberías tomar tus propias coordenadas del ped con millones de offsets (y eso para cada skin) ya que el mismo GTA viene con la hitzone de sus peds media mal
-
What are you trying to do?
-
row.neon[1] ??
-
if not noTeams[teamName] then