Jump to content

Mec.Love

Members
  • Posts

    50
  • Joined

  • Last visited

About Mec.Love

  • Birthday 09/07/1997

Details

  • Gang
    ITOS
  • Location
    Itaquera Osasco
  • Occupation
    Fundador
  • Interests
    aprender

Recent Profile Visitors

1,243 profile views

Mec.Love's Achievements

Snitch

Snitch (10/54)

2

Reputation

  1. opa, bom dia. Poderia mandar uma print do erro que dá no debugscript 3 por favor. E põe a parte do código onde o erro é mostrado
  2. opa, boa noite. então, estou com um backup de um servidor todo em mysql. configurei a conexão do mysql, startei e foi tudo ok. liguei o servidor no local porém dá um erro. Warning: un_auth\server.lua:105 "Bad argument @ 'dbQuery' [Expected db-connection at argument 3, got boolean] function playerRegister(username,password,confirmPassword, email) local mtaSerial = getPlayerSerial(client) local encryptionRule = tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9)) local encryptedPW = string.lower(md5(password)) local ipAddress = getPlayerIP(client) dbQuery(playerRegisterCallback, {client, username, password, mtaSerial, ipAddress, encryptedPW, encryptionRule, email}, mysql:getConnection(), "SELECT username,mtaserial FROM accounts WHERE (username = ? or mtaserial = ?)", username, mtaSerial) --linha 105 end addEvent("accounts:register:attempt",true) addEventHandler("accounts:register:attempt",getRootElement(),playerRegister) function playerRegisterCallback(queryHandler, client, username, password, serial, ip, encryptedPW, encryptionRule, email) local result, rows, err = dbPoll(queryHandler, 0) if rows > 0 then exports.un_notification:create(client,"Kullanıcı adı/email kullanılıyor veya yeni bir hesap oluşturmaya çalışıyorsun! ("..result[1]["username"]..")", "error") else dbExec(mysql:getConnection(), "INSERT INTO `accounts` SET `username`='"..username.."', `password`='"..encryptedPW.."', `email`='"..email.."', `registerdate`=NOW(), `ip`='"..ip.."', `salt`='"..encryptionRule.."', `mtaserial`='"..serial.."', `activated`='1' ") exports.un_notification:create(client,"Hesabınız başarıyla oluşturuldu, giriş yapabilirsiniz.", "success") end end Comentei na frente daLinha que está o erro > 105 < ajuda eu esse seria todo o codigo do serv side local mysql = exports.un_mysql local getElementData = getElementData local setElementData = setElementData local exports = exports function setElementDataEx(theElement, theParameter, theValue, syncToClient, noSyncAtall) setElementData(theElement, theParameter, theValue) return true end function resourceStart(resource) setWaveHeight ( 0 ) setGameType("Roleplay") setMapName("Istanbul") setRuleValue("Sürüm", "rc0.9") setRuleValue("Geliştiriciler", "UNT Development Team") for key, value in ipairs(exports.un_pool:getPoolElementsByType("player")) do triggerEvent("playerJoinResourceStart", value, resource) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), resourceStart) function onJoin() local skipreset = false local loggedIn = getElementData(source, "loggedin") if loggedIn == 1 then skipreset = true setElementData(source, "account:seamless:validated", true, false, true) end if not skipreset then setElementData(source, "loggedin", 0, false) setElementData(source, "account:loggedin", false, false) setElementData(source, "account:username", "", false) setElementData(source, "account:id", "", false) setElementData(source, "dbid", false) setElementData(source, "admin_level", 0, false) setElementData(source, "hiddenadmin", 0, false) setElementData(source, "globalooc", 1, false) setElementData(source, "muted", 0, false) setElementData(source, "loginattempts", 0, false) setElementData(source, "timeinserver", 0, false) setElementData(source, "chatbubbles", 0, false) setElementDimension(source, 9999) setElementInterior(source, 0) end exports.un_global:updateNametagColor(source) end addEventHandler("onPlayerJoin", getRootElement(), onJoin) addEvent("playerJoinResourceStart", false) addEventHandler("playerJoinResourceStart", getRootElement(), onJoin) function resetNick(oldNick, newNick) setElementData(client, "legitnamechange", 1) setPlayerName(client, oldNick) setElementData(client, "legitnamechange", 0) exports.un_global:sendMessageToAdmins("Admin Warn: " .. tostring(oldNick) .. " kendi adını değiştirmek için çalıştı " .. tostring(newNick) .. ".") end addEvent("resetName", true ) addEventHandler("resetName", getRootElement(), resetNick) function clientReady() local thePlayer = source local resources = getResources() local missingResources = false for key, value in ipairs(resources) do local resourceName = getResourceName(value) if resourceName == "un_global" or resourceName == "un_mysql" or resourceNmae == "un_pool" then if getResourceState(value) == "loaded" or getResourceState(value) == "stopping" or getResourceState(value) == "failed to load" then missingResources = true outputChatBox("Sunucu bağımlı kaynak eksik '"..getResourceName(value).."'.", thePlayer, 255, 0, 0) outputChatBox("Kısa bir süre sonra tekrar deneyiniz", thePlayer, 255, 0, 0) break end end end if missingResources then return end if not willPlayerBeBanned then triggerClientEvent(thePlayer, "beginLogin", thePlayer) else triggerClientEvent(thePlayer, "beginLogin", thePlayer, "Banned.") end end addEvent("onJoin", true) addEventHandler("onJoin", getRootElement(), clientReady) addEventHandler("accounts:login:request", getRootElement(), function () local seamless = getElementData(client, "account:seamless:validated") if seamless == true then setElementData(client, "account:seamless:validated", false, false, true) triggerClientEvent(client, "accounts:options", client) triggerClientEvent(client, "item:updateclient", client) return end triggerClientEvent(client, "accounts:login:request", client) end ); function playerRegister(username,password,confirmPassword, email) local mtaSerial = getPlayerSerial(client) local encryptionRule = tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9))..tostring(math.random(0,9)) local encryptedPW = string.lower(md5(password)) local ipAddress = getPlayerIP(client) dbQuery(playerRegisterCallback, {client, username, password, mtaSerial, ipAddress, encryptedPW, encryptionRule, email}, mysql:getConnection(), "SELECT username,mtaserial FROM accounts WHERE (username = ? or mtaserial = ?)", username, mtaSerial) end addEvent("accounts:register:attempt",true) addEventHandler("accounts:register:attempt",getRootElement(),playerRegister) function playerRegisterCallback(queryHandler, client, username, password, serial, ip, encryptedPW, encryptionRule, email) local result, rows, err = dbPoll(queryHandler, 0) if rows > 0 then exports.un_notification:create(client,"Kullanıcı adı/email kullanılıyor veya yeni bir hesap oluşturmaya çalışıyorsun! ("..result[1]["username"]..")", "error") else dbExec(mysql:getConnection(), "INSERT INTO `accounts` SET `username`='"..username.."', `password`='"..encryptedPW.."', `email`='"..email.."', `registerdate`=NOW(), `ip`='"..ip.."', `salt`='"..encryptionRule.."', `mtaserial`='"..serial.."', `activated`='1' ") exports.un_notification:create(client,"Hesabınız başarıyla oluşturuldu, giriş yapabilirsiniz.", "success") end end local accountCharacters = {} local onlineForPlayer = {} function validateCredentials(username,password,checksave) if not (username == "") then if not (password == "") then return true else exports.un_notification:create(client,"Lütfen şifrenizi girin.", "error") end else exports.un_notification:create(client,"Lütfen kullanıcı adınızı girin.", "error") end return false end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),validateCredentials) function playerLogin(username,password,checksave) if not validateCredentials(username,password,checksave) then return false end dbQuery(loginCallback, {client,username,password}, mysql:getConnection(), "SELECT * FROM `accounts` WHERE `username`='".. username .."'") end addEvent("accounts:login:attempt",true) addEventHandler("accounts:login:attempt",getRootElement(),playerLogin) function loginCallback(queryHandler,source,username,password) local result, rows, err = dbPoll(queryHandler, 0) if rows > 0 then row = result[1] local encryptionRule = row["salt"] local encryptedPW = string.lower(md5(password)) if row["password"] ~= encryptedPW then exports.un_notification:create(source,"Kullanıcı adı için şifreler eşleşmiyor!", "error") return end if (onlineForPlayer[row["id"]]) then thePlayer = onlineForPlayer[tonumber(row["id"])] if (thePlayer ~= source) then kickPlayer(thePlayer, thePlayer, "Bir kullanıcı hesabınıza giriş yaptı!") end end onlineForPlayer[tonumber(row["id"])] = source dbExec(mysql:getConnection(), "UPDATE accounts SET online='1' WHERE id = ?", tonumber(row["id"])) triggerClientEvent(source, "items:inventory:hideinv", source) setElementData(source, "account:loggedin", true, true) setElementData(source, "account:id", tonumber(row["id"]), true) local acID = tonumber(row['id']) setElementData(source, "account:username", row["username"], true) setElementData(source, "account:charLimit", tonumber(row["characterlimit"]), true) setElementData(source, "electionsvoted", row["electionsvoted"], true) setElementData(source, "account:email", row["email"]) setElementData(source, "account:creationdate", row["registerdate"]) setElementData(source, "account:email", row["email"]) setElementData(source, "credits", tonumber(row["credits"])) setElementData(source, "admin_level", tonumber(row['admin']), true) setElementData(source, "supporter_level", tonumber(row['supporter']), true) setElementData(source, "vct_level", tonumber(row['vct']), true) setElementData(source, "mapper_level", tonumber(row['mapper']), true) setElementData(source, "scripter_level", tonumber(row['scripter']), true) setElementData(source, "bakiye", tonumber(row["bakiye"]) or 0, true) setElementData(source, "uyk", tonumber(row["uyk"]) or 0, true) local tablolar = row["custom_animations"] if type(fromJSON(tablolar)) ~= "table" then tablolar = toJSON ( { } ) end local animler = fromJSON(tablolar or toJSON ( { } )) table.insert(animler, block) setElementData(source, "custom_animations", animler) exports['un_reports']:reportLazyFix(source) setElementData(source, "adminreports", tonumber(row["adminreports"]), true) setElementData(source, "adminreports_saved", tonumber(row["adminreports_saved"])) if tonumber(row['referrer']) and tonumber(row['referrer']) > 0 then setElementData(source, "referrer", tonumber(row['referrer']), false, true) end if exports.un_integration:isPlayerLeadAdmin(source) then setElementData(source, "hiddenadmin", row["hiddenadmin"], true) else setElementData(source, "hiddenadmin", 0, true) end local vehicleConsultationTeam = exports.un_integration:isPlayerVehicleConsultant(source) setElementData(source, "vehicleConsultationTeam", vehicleConsultationTeam, false) if tonumber(row["adminjail"]) == 1 then setElementData(source, "adminjailed", true, true) else setElementData(source, "adminjailed", false, true) end setElementData(source, "jailtime", tonumber(row["adminjail_time"]), true) setElementData(source, "jailadmin", row["adminjail_by"], true) setElementData(source, "jailreason", row["adminjail_reason"], true) if row["monitored"] ~= "" then setElementData(source, "admin:monitor", row["monitored"], true) end dbExec(mysql:getConnection(), "UPDATE `accounts` SET `ip`='" .. getPlayerIP(source) .. "', `mtaserial`='" .. getPlayerSerial(source) .. "' WHERE `id`='".. tostring(row["id"]) .."'") setElementData(source, "jailreason", row["adminjail_reason"], true) setElementData(source, "forum_name", row["forum_name"]) -- Militan for i=1, 6 do setElementData(source, "job_level:"..i, row["jlevel_"..i]) end loadAccountSettings(source, row["id"]) triggerClientEvent (source,"hideLoginWindow",source) triggerClientEvent(source, "vehicle_rims", source) local characters = {} dbQuery( function(qh, source) local res, rows, err = dbPoll(qh, 0) if rows > 0 then for index, value in ipairs(res) do if value.cked == 0 then local i = #characters + 1 if not characters[i] then characters[i] = {} end characters[i][1] = value.id characters[i][2] = value.charactername characters[i][3] = tonumber(value.cked) characters[i][4] = "" characters[i][5] = value.age characters[i][6] = value.gender characters[i][9] = value.skin characters[i][11] = value.height characters[i][12] = value.weight end end end setElementData(source, "account:characters", characters) triggerClientEvent(source, "accounts:login:attempt", source, 0 ) triggerEvent( "social:un_account", source, tonumber( row["id"] ) ) end, {source}, mysql:getConnection(), "SELECT * FROM characters WHERE account = ?", tonumber(row["id"])) else triggerClientEvent(source,"set_warning_text",source,"Login","Kullanıcı adı veritabanında bulunamadı! ('".. username .."')") end end addEventHandler("onPlayerQuit", root, function() onlineForPlayer[getElementData(source, "account:id")] = false dbExec(mysql:getConnection(), "UPDATE accounts SET online='0' WHERE id = ?", tonumber(getElementData(source, "account:id"))) end ) function myCallback( responseData, errno, id ) if errno == 0 then exports.un_cache:addImage(id, responseData) end end addEventHandler("onResourceStart", resourceRoot, function() imported_accounts = {} imported_characters = {} dbQuery( function(qh) local res, rows, err = dbPoll(qh, 0) if rows > 0 then for index, value in ipairs(res) do row_info = {} for count, data in pairs(value) do row_info[count] = data end imported_accounts[#imported_accounts + 1] = row_info end end end, mysql:getConnection(), "SELECT * FROM `accounts`") dbQuery( function(qh) local res, rows, err = dbPoll(qh, 0) if rows > 0 then for index, value in ipairs(res) do row_info = {} for count, data in pairs(value) do row_info[count] = data end imported_characters[#imported_characters + 1] = row_info end end end, mysql:getConnection(), "SELECT * FROM `characters`") end ) function updateTables() imported_accounts, imported_characters = {}, {} dbQuery( function(qh) local res, rows, err = dbPoll(qh, 0) if rows > 0 then for index, value in ipairs(res) do row_info = {} for count, data in pairs(value) do row_info[count] = data end imported_accounts[#imported_accounts + 1] = row_info end end end, mysql:getConnection(), "SELECT * FROM `accounts`") dbQuery( function(qh) local res, rows, err = dbPoll(qh, 0) if rows > 0 then for index, value in ipairs(res) do row_info = {} for count, data in pairs(value) do row_info[count] = data end imported_characters[#imported_characters + 1] = row_info end end end, mysql:getConnection(), "SELECT * FROM `characters`") end function getTableInformations() return imported_accounts, imported_characters end function characterList(theClient) if theClient then local dbid = getElementData(theClient, "account:id") local accounts, character = getTableInformations() -- // Hypnos local characters = {} for index, value in ipairs(character) do if value.account == dbid and value.cked == 0 then local i = #characters + 1 if not characters[i] then characters[i] = {} end characters[i][1] = value.id characters[i][2] = value.charactername characters[i][3] = tonumber(value.cked) characters[i][4] = "" characters[i][5] = value.age characters[i][6] = value.gender characters[i][9] = value.skin characters[i][11] = value.height characters[i][12] = value.weight end end return characters end end function reloadCharacters() if source then local chars = characterList(source) setElementData(source, "account:characters", chars) end end addEvent("updateCharacters", true) addEventHandler("updateCharacters", getRootElement(), reloadCharacters) function reconnectMe() redirectPlayer(client, "", 0 ) end addEvent("accounts:reconnectMe", true) addEventHandler("accounts:reconnectMe", getRootElement(), reconnectMe) function adminLoginToPlayerCharacter(thePlayer, commandName, ...) if exports.un_integration:isPlayerSeniorAdmin(thePlayer) then if not (...) then outputChatBox("KULLANIM: /" .. commandName .. " [Tam karakter adı]", thePlayer, 255, 194, 14, false) outputChatBox("Oyuncunun karakterine ait loglar görüntüleniyor.", thePlayer, 255, 194, 0, false) else targetChar = table.concat({...}, "_") dbQuery(loginCharacterAdminCallback, {thePlayer, targetChar}, mysql:getConnection(), "SELECT `characters`.`id` AS `targetCharID` , `characters`.`account` AS `targetUserID` , `accounts`.`admin` AS `targetAdminLevel`, `accounts`.`username` AS `targetUsername` FROM `characters` LEFT JOIN `accounts` ON `characters`.`account`=`accounts`.`id` WHERE `charactername`='"..targetChar.."' LIMIT 1") end end end addCommandHandler("loginto", adminLoginToPlayerCharacter, false, false) function loginCharacterAdminCallback(qh, thePlayer, name) local res, rows, err = dbPoll(qh, 0) if rows > 0 then local fetchData = res[1] local targetCharID = tonumber(fetchData["targetCharID"]) or false local targetUserID = tonumber(fetchData["targetUserID"]) or false local targetAdminLevel = tonumber(fetchData["targetAdminLevel"]) or 0 local targetUsername = fetchData["targetUsername"] or false local theAdminPower = exports.un_global:getPlayerAdminLevel(thePlayer) if targetCharID and targetUserID then local adminTitle = exports.un_global:getPlayerFullIdentity(thePlayer) if targetAdminLevel > theAdminPower then local adminUsername = getElementData(thePlayer, "account:username") outputChatBox("Sizden daha yüksek yetkiye sahip kişinin karakterine giriş yapamazsın.", thePlayer, 255,0,0) exports.un_global:sendMessageToAdmins("[GİRİŞ]: " .. tostring(adminTitle) .. " yüksek yetkiye sahip bir yöneticinin karakterine girmeye çalıştı ("..targetUsername..").") return false end spawnCharacter(targetCharID, targetUserID, thePlayer, targetUsername) exports.un_global:sendMessageToAdmins("[GİRİŞ]: " .. tostring(adminTitle) .. " hesabına giriş yaptı, '"..targetUsername.."'.") end else outputChatBox("Karakter adı bulunamadı.", thePlayer, 255,0,0) end end addEvent("account:charactersQuotaCheck", true) addEventHandler("account:charactersQuotaCheck", root, function(player) triggerClientEvent(player, "account:charactersQuotaCheck", player, true, "Onaylandı") end ) function spawnCharacter(characterID, remoteAccountID, theAdmin, targetAccountName, location) if theAdmin then client = theAdmin end if not client then return false end if not characterID then return false end if not tonumber(characterID) then return false end characterID = tonumber(characterID) triggerEvent('setDrunkness', client, 0) setElementData(client, "alcohollevel", 0, true) removeMasksAndBadges(client) setElementDataEx(client, "pd.jailserved") setElementDataEx(client, "pd.jailtime") setElementDataEx(client, "pd.jailtimer") setElementDataEx(client, "pd.jailstation") setElementData(client, "loggedin", 0, true) local timer = getElementData(client, "pd.jailtimer") if isTimer(timer) then killTimer(timer) end if (getPedOccupiedVehicle(client)) then removePedFromVehicle(client) end -- End cleaning up local accountID = tonumber(getElementData(client, "account:id")) local characterData = false if theAdmin then accountID = remoteAccountID sqlQuery = "SELECT * FROM `characters` LEFT JOIN `jobs` ON `characters`.`id` = `jobs`.`jobCharID` AND `characters`.`job` = `jobs`.`jobID` WHERE `id`='" .. tostring(characterID) .. "' AND `account`='" .. tostring(accountID) .. "'" else sqlQuery = "SELECT * FROM `characters` LEFT JOIN `jobs` ON `characters`.`id` = `jobs`.`jobCharID` AND `characters`.`job` = `jobs`.`jobID` WHERE `id`='" .. tostring(characterID) .. "' AND `account`='" .. tostring(accountID) .. "' AND `cked`=0" end dbQuery( function(qh, client, characterID, remoteAccountID, theAdmin, targetAccountName, location) local res, rows, err = dbPoll(qh, 0) if rows > 0 then characterData = res[1] if characterData then if characterData["description"] then setElementData(client, "look", fromJSON(characterData["description"]) or {"", "", "", "", characterData["description"], ""}) end setElementData(client, "weight", characterData["weight"]) setElementData(client, "height", characterData["height"]) setElementData(client, "race", tonumber(characterData["skincolor"])) setElementData(client, "maxvehicles", tonumber(characterData["maxvehicles"])) setElementData(client, "maxinteriors", tonumber(characterData["maxinteriors"])) --DATE OF BIRTH setElementData(client, "age", tonumber(characterData["age"])) setElementData(client, "month", tonumber(characterData["month"])) setElementData(client, "day", tonumber(characterData["day"])) -- LANGUAGES local lang1 = tonumber(characterData["lang1"]) local lang1skill = tonumber(characterData["lang1skill"]) local lang2 = tonumber(characterData["lang2"]) local lang2skill = tonumber(characterData["lang2skill"]) local lang3 = tonumber(characterData["lang3"]) local lang3skill = tonumber(characterData["lang3skill"]) local currentLanguage = tonumber(characterData["currlang"]) or 1 setElementData(client, "languages.current", currentLanguage, false) if lang1 == 0 then lang1skill = 0 end if lang2 == 0 then lang2skill = 0 end if lang3 == 0 then lang3skill = 0 end setElementData(client, "languages.lang1", lang1, false) setElementData(client, "languages.lang1skill", lang1skill, false) setElementData(client, "languages.lang2", lang2, false) setElementData(client, "languages.lang2skill", lang2skill, false) setElementData(client, "languages.lang3", lang3, false) setElementData(client, "languages.lang3skill", lang3skill, false) -- END OF LANGUAGES setElementData(client, "timeinserver", tonumber(characterData["timeinserver"]), false) setElementData(client, "account:character:id", characterID, false) setElementData(client, "dbid", characterID, true) -- workaround exports['un_items']:loadItems( client, true ) setElementData(client, "loggedin", 1, true) -- Check his name isn't in use by a squatter local playerWithNick = getPlayerFromName(tostring(characterData["charactername"])) if isElement(playerWithNick) and (playerWithNick~=client) then if theAdmin then local adminTitle = exports.un_global:getPlayerAdminTitle(theAdmin) local adminUsername = getElementData(theAdmin, "account:username") kickPlayer(playerWithNick, getRootElement(), adminTitle.." "..adminUsername.." has logged into your account.") outputChatBox(""..targetAccountName.." ("..tostring(characterData["charactername"]):gsub("_"," ")..") adlı hesap oyundan atıldı.", theAdmin, 0, 255, 0 ) else kickPlayer(playerWithNick, getRootElement(), "Başkası senin karakterinde oturum açmış olabilir.") end end setElementData(client, "bleeding", 0, false) -- Set their name to the characters setElementData(client, "legitnamechange", 1) setPlayerName(client, tostring(characterData["charactername"])) local pid = getElementData(client, "playerid") local fixedName = string.gsub(tostring(characterData["charactername"]), "_", " ") setElementData(client, "legitnamechange", 0) setPlayerNametagShowing(client, false) setElementFrozen(client, true) setPedGravity(client, 0) local locationToSpawn = {} if location then locationToSpawn.x = location[1] locationToSpawn.y = location[2] locationToSpawn.z = location[3] locationToSpawn.rot = location[4] locationToSpawn.int = location[5] locationToSpawn.dim = location[6] else locationToSpawn.x = tonumber(characterData["x"]) locationToSpawn.y = tonumber(characterData["y"]) locationToSpawn.z = tonumber(characterData["z"]) locationToSpawn.rot = tonumber(characterData["rotation"]) locationToSpawn.int = tonumber(characterData["interior_id"]) locationToSpawn.dim = tonumber(characterData["dimension_id"]) end spawnPlayer(client, locationToSpawn.x ,locationToSpawn.y ,locationToSpawn.z , locationToSpawn.rot, tonumber(characterData["skin"])) setElementDimension(client, locationToSpawn.dim) setElementInterior(client, locationToSpawn.int , locationToSpawn.x, locationToSpawn.y, locationToSpawn.z) setCameraInterior(client, locationToSpawn.int) exports["un_items"]:loadItems(client) setCameraTarget(client, client) setElementHealth(client, tonumber(characterData["health"])) setPedArmor(client, tonumber(characterData["armor"])) local teamElement = nil if (tonumber(characterData["faction_id"])~=-1) then teamElement = exports.un_pool:getElement('team', tonumber(characterData["faction_id"])) if not (teamElement) then -- Facshun does not exist? characterData["faction_id"] = -1 dbExec(mysql:getConnection(), "UPDATE characters SET faction_id='-1', faction_rank='1' WHERE id='" .. tostring(characterID) .. "' LIMIT 1") end end if teamElement then setPlayerTeam(client, teamElement) else setPlayerTeam(client, getTeamFromName("Citizen")) end local adminLevel = getElementData(client, "admin_level") local gmLevel = getElementData(client, "account:gmlevel") exports.un_global:updateNametagColor(client) -- ADMIN JAIL local jailed = getElementData(client, "adminjailed") local jailed_time = getElementData(client, "jailtime") local jailed_by = getElementData(client, "jailadmin") local jailed_reason = getElementData(client, "jailreason") if location then setElementPosition(client, location[1], location[2], location[3]) setElementPosition(client, location[4], 0, 0) end if jailed then local incVal = getElementData(client, "playerid") setElementDimension(client, 55000+incVal) setElementInterior(client, 6) setCameraInterior(client, 6) setElementPosition(client, 263.821807, 77.848365, 1001.0390625) setPedRotation(client, 267.438446) setElementData(client, "jailserved", 0, false) setElementData(client, "adminjailed", true) setElementData(client, "jailreason", jailed_reason, false) setElementData(client, "jailadmin", jailed_by, false) if jailed_time ~= 999 then if not getElementData(client, "jailtimer") then setElementData(client, "jailtime", jailed_time+1, false) --exports['un_admins']:timerUnjailPlayer(client) triggerEvent("admin:timerUnjailPlayer", client, client) end else setElementData(client, "jailtime", "Unlimited", false) setElementData(client, "jailtimer", true, false) end setElementInterior(client, 6) setCameraInterior(client, 6) end setElementData(client, "faction", tonumber(characterData["faction_id"]), true) setElementData(client, "factionMenu", 0) local factionPerks = type(characterData["faction_perks"]) == "string" and fromJSON(characterData["faction_perks"]) or { } setElementData(client, "factionPackages", factionPerks, true) setElementData(client, "factionrank", tonumber(characterData["faction_rank"]), true) setElementData(client, "factionphone", tonumber(characterData["faction_phone"]), true) setElementData(client, "factionleader", tonumber(characterData["faction_leader"]), true) local factionPerks = type(characterData["faction_perms"]) == "string" and fromJSON(characterData["faction_perms"]) or {} setElementData(client, "factionperms", factionPerms, true) setElementData(client, "businessprofit", 0, false) setElementData(client, "legitnamechange", 0) setElementData(client, "muted", tonumber(muted)) setElementData(client, "minutesPlayed", tonumber(characterData["minutesPlayed"]), true) setElementData(client, "hoursplayed", tonumber(characterData["hoursplayed"]), true) setPlayerAnnounceValue ( client, "score", characterData["hoursplayed"] ) setElementData(client, "alcohollevel", tonumber(characterData["alcohollevel"]) or 0, true) exports.un_global:setMoney(client, tonumber(characterData["money"]), true) exports.un_global:checkMoneyHacks(client) setElementData(client, "restrain", tonumber(characterData["cuffed"]), true) setElementData(client, "tazed", false, false) setElementData(client, "realinvehicle", 0, false) local duty = tonumber(characterData["duty"]) or 0 setElementData(client, "duty", duty, true) -- Job system - MAXIME setElementData(client, "job", tonumber(characterData["jobID"]) or 0, true) setElementData(client, "jobLevel", tonumber(characterData["jobLevel"]) or 0, true) setElementData(client, "jobProgress", tonumber(characterData["jobProgress"]) or 0, true) -- MAXIME JOB SYSTEM if tonumber(characterData["job"]) == 1 then if characterData["jobTruckingRuns"] then setElementData(client, "job-system-trucker:truckruns", tonumber(characterData["jobTruckingRuns"]), true) dbExec(mysql:getConnection(), "UPDATE `jobs` SET `jobTruckingRuns`='0' WHERE `jobCharID`='"..tostring(characterID).."' AND `jobID`='1' " ) end triggerClientEvent(client,"restoreTruckerJob",client) end triggerEvent("restoreJob", client) --triggerClientEvent(client, "updateCollectionValue", client, tonumber(characterData["photos"])) -------------------------------------------------------------------------- setElementData(client, "license.car", tonumber(characterData["car_license"]), true) setElementData(client, "license.bike", tonumber(characterData["bike_license"]), true) setElementData(client, "license.boat", tonumber(characterData["boat_license"]), true) setElementData(client, "license.pilot", tonumber(characterData["pilot_license"]), true) setElementData(client, "license.fish", tonumber(characterData["fish_license"]), true) setElementData(client, "license.gun", tonumber(characterData["gun_license"]), true) setElementData(client, "license.gun2", tonumber(characterData["gun2_license"]), true) setElementData(client, "bankmoney", tonumber(characterData["bankmoney"]), true) setElementData(client, "fingerprint", tostring(characterData["fingerprint"]), false) setElementData(client, "tag", tonumber(characterData["tag"])) setElementData(client, "blindfold", tonumber(characterData["blindfold"]), false) setElementData(client, "gender", tonumber(characterData["gender"])) setElementData(client, "deaglemode", 1, true) -- Default to lethal setElementData(client, "shotgunmode", 1, true) -- Default to lethal setElementData(client, "youtuber", tonumber(characterData["youtuber"]), true) setElementData(client, "rplus", tonumber(characterData["rplus"]), true) setElementData(client, "etiket", tonumber(characterData["etiket"]), true) setElementData(client, "donator", tonumber(characterData["donator"]), true) setElementData(client, "country", tonumber(characterData["ulke"]), true) setElementData(client, "hunger", tonumber(characterData["hunger"]), true) setElementData(client, "thirst", tonumber(characterData["thirst"]), true) setElementData(client, "level", tonumber(characterData["level"]), true) setElementData(client, "hoursaim", tonumber(characterData["hoursaim"]), true) setElementData(client, "box", tonumber(characterData["box"]), true) setElementData(client, "boxexp", tonumber(characterData["boxexp"]), true) setElementData(client, "vipver", 0) local resource = getResourceFromName("un_vip") if resource then local state = getResourceState(resource) if state == "running" then setElementData(client, "vipver", 0) exports['un_vip']:loadVIP(characterID) end end exports.un_anticheat:changeProtectedElementDataEx(client, "fakename", false, true) setElementData(client, "hapis_sure", tonumber(characterData["hapis_sure"])) setElementData(client, "hapis_sebep", characterData["hapis_sebep"], true) setElementData(client, "clothing:id", tonumber(characterData["clothingid"]) or nil, true) if (tonumber(characterData["restrainedobj"])>0) then setElementData(client, "restrainedObj", tonumber(characterData["restrainedobj"]), false) end if ( tonumber(characterData["restrainedby"])>0) then setElementData(client, "restrainedBy", tonumber(characterData["restrainedby"]), false) end takeAllWeapons(client) if (getElementType(client) == 'player') then triggerEvent("updateLocalGuns", client) end setPedStat(client, 70, 999) setPedStat(client, 71, 999) setPedStat(client, 72, 999) setPedStat(client, 74, 999) setPedStat(client, 76, 999) setPedStat(client, 77, 999) setPedStat(client, 78, 999) setPedStat(client, 77, 999) setPedStat(client, 78, 999) setPedStat(client, 79, 999) -- Strafeing fix toggleAllControls(client, true, true, true) triggerClientEvent(client, "onClientPlayerWeaponCheck", client) setElementFrozen(client, false) -- Player is cuffed if (tonumber(characterData["cuffed"])==1) then toggleControl(client, "sprint", false) toggleControl(client, "fire", false) toggleControl(client, "jump", false) toggleControl(client, "next_weapon", false) toggleControl(client, "previous_weapon", false) toggleControl(client, "accelerate", false) toggleControl(client, "brake_reverse", false) toggleControl(client, "aim_weapon", false) end setPedFightingStyle(client, tonumber(characterData["fightstyle"])) triggerEvent("onCharacterLogin", client, charname, tonumber(characterData["faction_id"])) triggerClientEvent(client, "accounts:characters:spawn", client, fixedName, adminLevel, gmLevel, tonumber(characterData["faction_id"]), tonumber(characterData["faction_rank"])) triggerClientEvent(client, "item:updateclient", client) if not theAdmin then -- dbExec(mysql:getConnection(), "UPDATE characters SET online='1', lastlogin=NOW() WHERE id='" .. characterID .. "'") local monitored = getElementData(client, "admin:monitor") if monitored then if monitored ~= "New Player" then exports.un_global:sendMessageToAdmins("[MONITOR] ".. getPlayerName(client):gsub("_", " ") .." ("..pid.."): "..monitored) exports.un_global:sendMessageToSupporters("[MONITOR] ".. getPlayerName(client):gsub("_", " ") .." ("..pid.."): "..monitored) end end end setTimer(setPedGravity, 2000, 1, client, 0.008) setElementAlpha(client, 255) -- WALKING STYLE triggerEvent("realism:applyWalkingStyle", client, characterData["walkingstyle"] or 128, true) if duty > 0 then local foundPackage = false for key, value in ipairs(factionPerks) do if tonumber(value) == tonumber(duty) then foundPackage = true break end end if not foundPackage then triggerEvent("duty:offduty", client) outputChatBox("Artık kullandığınız göreve erişiminiz yok - bu nedenle, kaldırıldı.", client, 255, 0, 0) end end triggerEvent("social:character", client) if theAdmin then local adminTitle = exports.un_global:getPlayerAdminTitle(theAdmin) local adminUsername = getElementData(theAdmin, "account:username") outputChatBox("You've logged into player's character successfully!", theAdmin, 0, 255, 0 ) local hiddenAdmin = getElementData(theAdmin, "hiddenadmin") if hiddenAdmin == 0 then exports.un_global:sendMessageToAdmins("AdmKmt: " .. tostring(adminTitle) .. " "..adminUsername.." başka bir hesaba girdi, ("..targetAccountName..") "..tostring(characterData["charactername"]):gsub("_"," ")..".") end end if (tonumber(characterData["blindfold"])==1) then setElementData(client, "blindfold", 1) outputChatBox("Karakterinin gözü kapalı. eğer bu OCC bir eylem ise, F2 tuşunu kullanarak yönetici ile iletişime geç.", client, 255, 194, 15) fadeCamera(client, false) else fadeCamera(client, true, 4) end if (tonumber(characterData["cuffed"])==1) then outputChatBox("Karakterin sınırlandırılmış.", client, 255, 0, 0) end loadCharacterSettings(client,characterID) triggerClientEvent(client, "drawAllMyInteriorBlips", client) triggerEvent("playerGetMotds", client) triggerEvent( "accounts:character:select", client ) end end end, {client, characterID, remoteAccountID, theAdmin, targetAccountName, location}, mysql:getConnection(), sqlQuery) end addEventHandler("accounts:characters:spawn", getRootElement(), spawnCharacter) function Characters_onCharacterChange() triggerClientEvent(client, "items:inventory:hideinv", client) triggerEvent("savePlayer", client, "Change Character") triggerEvent('setDrunkness', client, 0) setElementData(client, "alcohollevel", 0, true) setElementData(client, "clothing:id", nil, true) removeMasksAndBadges(client) setElementData(client, "pd.jailserved") setElementData(client, "pd.jailtime") setElementData(client, "pd.jailtimer") setElementData(client, "pd.jailstation") setElementData(client, "loggedin", 0, true) setElementData(client, "bankmoney", 0) setElementData(client, "account:character:id", false) setElementAlpha(client, 0) removeElementData(client, "jailed") removeElementData(client, "jail_time") removeElementData(client, "jail:id") removeElementData(client, "jail:cell") removeElementData(client, "enableGunAttach") triggerEvent("destroyWepObjects", client) if (getPedOccupiedVehicle(client)) then removePedFromVehicle(client) end exports.un_global:updateNametagColor(client) local clientAccountID = getElementData(client, "account:id") or -1 setElementInterior(client, 0) setElementDimension(client, 1) setElementData(client, "legitnamechange", 1) setElementData(client, "legitnamechange", 0) triggerEvent("shop:removeMeFromCurrentShopUser",client, client) triggerClientEvent(client, "hideGeneralshopUI", client) local padId = getElementData(client, "padUsing") if padId then removeElementData(client, "padUsing") for key, thePad in pairs(getElementsByType("object", getResourceRootElement(getResourceFromName("un_item-world")))) do if getElementData(thePad, "id") == padId then removeElementData(thePad, "playerUsing") break end end end triggerEvent("accounts:character:select", client) end addEventHandler("accounts:characters:change", getRootElement(), Characters_onCharacterChange) function removeMasksAndBadges(client) for k, v in ipairs({exports['un_items']:getMasks(), exports['un_items']:getBadges()}) do for kx, vx in pairs(v) do if getElementData(client, vx[1]) then setElementData(client, vx[1], false, true) end end end end local playersToBeSaved = { } function beginSave() outputDebugString("Yerdeki tum esyalar kaydedildi.") for key, value in ipairs(getElementsByType("player")) do --triggerEvent("savePlayer", value, "Save All") table.insert(playersToBeSaved, value) end local timerDelay = 0 for key, thePlayer in ipairs(playersToBeSaved) do timerDelay = timerDelay + 1000 setTimer(savePlayer, timerDelay, 1, "Save All", thePlayer) end end function syncTIS() for key, value in ipairs(getElementsByType("player")) do local tis = getElementData(value, "timeinserver") if (tis) and (getPlayerIdleTime(value) < 600000) then setElementData(value, "timeinserver", tonumber(tis)+1, false) end end end setTimer(syncTIS, 60000, 0) function savePlayer(reason, player) if source ~= nil then player = source end if isElement(player) then local logged = getElementData(player, "loggedin") if (logged==1 or reason=="Change Character") then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then local seat = getPedOccupiedVehicleSeat(player) triggerEvent("onVehicleExit", vehicle, player, seat) end local x, y, z, rot, health, armour, interior, dimension, cuffed, skin, duty, timeinserver, businessprofit, alcohollevel local x, y, z = getElementPosition(player) local rot = getPedRotation(player) local health = getElementHealth(player) local armor = getPedArmor(player) local interior = getElementInterior(player) local dimension = getElementDimension(player) local alcohollevel = getElementData(player, "alcohollevel") local d_addiction = ( getElementData(player, "drug.1") or 0 ) .. ";" .. ( getElementData(player, "drug.2") or 0 ) .. ";" .. ( getElementData(player, "drug.3") or 0 ) .. ";" .. ( getElementData(player, "drug.4") or 0 ) .. ";" .. ( getElementData(player, "drug.5") or 0 ) .. ";" .. ( getElementData(player, "drug.6") or 0 ) .. ";" .. ( getElementData(player, "drug.7") or 0 ) .. ";" .. ( getElementData(player, "drug.8") or 0 ) .. ";" .. ( getElementData(player, "drug.9") or 0 ) .. ";" .. ( getElementData(player, "drug.10") or 0 ) money = getElementData(player, "stevie.money") if money and money > 0 then money = 'money = money + ' .. money .. ', ' else money = '' end skin = getElementModel(player) if getElementData(player, "help") then dimension, interior, x, y, z = unpack( getElementData(player, "help") ) end -- Fix for #0000984 if getElementData(player, "businessprofit") and ( reason == "Quit" or reason == "Timed Out" or reason == "Unknown" or reason == "Bad Connection" or reason == "Kicked" or reason == "Banned" ) then businessprofit = 'bankmoney = bankmoney + ' .. getElementData(player, "businessprofit") .. ', ' else businessprofit = '' end -- Fix for freecam-tv if exports['un_freecam']:isPlayerFreecamEnabled(player) then x = getElementData(player, "tv:x") y = getElementData(player, "tv:y") z = getElementData(player, "tv:z") interior = getElementData(player, "tv:int") dimension = getElementData(player, "tv:dim") end local timeinserver = getElementData(player, "timeinserver") -- LAST AREA local zone = exports.un_global:getElementZoneName(player) if not zone or #zone == 0 then zone = "Unknown" end local hunger = getElementData(player, "hunger") or 100 local thirst = getElementData(player, "thirst") or 100 local _, characters_temp = getTableInformations() for index, value in ipairs(characters_temp) do if value.id == getElementData(player, "dbid") then table.remove(characters_temp, index) end end dbQuery( function(qh) local res, rows, err = dbPoll(qh, 0) if rows > 0 then for index, value in ipairs(res) do row_info = {} for count, data in pairs(value) do row_info[count] = data end imported_characters[#imported_characters + 1] = row_info end end end, mysql:getConnection(), "SELECT * FROM `characters` WHERE `id` = ?", getElementData(player, "dbid")) end end end addEventHandler("onPlayerQuit", getRootElement(), savePlayer) addEvent("savePlayer", false) addEventHandler("savePlayer", getRootElement(), savePlayer) setTimer(beginSave, 3600000, 0) addCommandHandler("saveall", function(p) if exports.un_integration:isPlayerSeniorAdmin(p) then beginSave() outputChatBox("Başarıyla kayıt alındı.", p) end end) addCommandHandler("saveme", function(p) triggerEvent("savePlayer", p, "Save Me", p) end) addEvent("checkAlreadyUsingName", true) addEventHandler("checkAlreadyUsingName", root, function(player, name) dbQuery( function(qh) local res, rows, err = dbPoll(qh, 0) if rows > 0 then a = false triggerClientEvent(player, "receiveNameRegisterable", player, a, name) else a = true triggerClientEvent(player, "receiveNameRegisterable", player, a, name) end end, mysql:getConnection(), "SELECT charactername FROM characters WHERE charactername='"..name:gsub(" ", "_").. "'") end ) local mysql = exports.un_mysql function newCharacter_create(characterName_, characterDescription_, race_, gender_, skin_, height_, weight_, age_, languageselectun_, month_, day_, location_) characterName, characterDescription, race, gender, skin, height, weight, age, languageselected, month, day, location = characterName_, characterDescription_, race_, gender_, skin_, height_, weight_, age_, languageselectun_, month_, day_, location_ if not (race > -1 and race < 3) then triggerClientEvent(client, "accounts:characters:new", client, 1, 2) -- State 1:2: error validating data return end if not (gender == 0 or gender == 1) then triggerClientEvent(client, "accounts:characters:new", client, 1, 3) -- State 1:3: error validating data return end characterName = string.gsub(tostring(characterName), " ", "_") dbQuery( function(qh, client, characterName, race, gender, skin, height, weight, age, languageselected, month, day) local res, rows, err = dbPoll(qh, 0) if rows > 0 then triggerClientEvent(client, "accounts:characters:new", client, 2, 1) else local accountID = getElementData(client, "account:id") local accountUsername = getElementData(client, "account:username") local fingerprint = md5((characterName) .. accountID .. race .. gender .. age) if month == "Ocak" then month = 1 end local walkingstyle = 128 if gender == 1 then walkingstyle = 129 end location = { 396.83984375, -1531.484375, 32.2734375, 0, 0, 0, "IGS Yaninda bir otobüs durağı"} dbExec(mysql:getConnection(), "INSERT INTO `characters` SET `charactername`='" .. (characterName).. "', `x`='"..location[1].."', `y`='"..location[2].."', `z`='"..location[3].."', `rotation`='"..location[4].."', `interior_id`='"..location[5].."', `dimension_id`='"..location[6].."', `lastarea`='"..(location[7]).."', `gender`='" .. (gender) .. "', `skincolor`='" .. (race) .. "', `weight`='" .. (weight) .. "', `height`='" .. (height) .. "', `description`='', `account`='" .. (accountID) .. "', `skin`='" .. (skin) .. "', `age`='" .. (age) .. "', `fingerprint`='" .. (fingerprint) .. "', `lang1`='" .. (languageselected) .. "', `lang1skill`='100', `currLang`='1' , `month`='" .. (month or "1") .. "', `day`='" .. (day or "1").."', `walkingstyle`='" .. (walkingstyle).."'") dbQuery( function(qh, client, characterName, race, gender, skin, height, weight, age, languageselected, month, day) local res, rows, err = dbPoll(qh, 0) if rows > 0 then local id = res[1]['id'] exports.un_anticheat:changeProtectedElementDataEx(client, "dbid", id, false) exports.un_global:giveItem( client, 16, skin ) -- ID CARD exports.un_global:giveItem( client, 152, characterName..";"..(gender==0 and "Bay" or "Bayan")..";"..exports.un_global:formatDate(day or 1).." "..exports.un_global:numberToMonth(month or 1).." "..exports.un_global:getBirthYearFromAge(age)..";"..fingerprint) -- Briefcase -- Briefcase if exports.un_global:giveItem( client, 160, 1 ) then triggerEvent("artifacts:toggle", client, client, "briefcase") end exports.un_anticheat:changeProtectedElementDataEx(client, "dbid") triggerClientEvent(client, "accounts:characters:new", client, 3, tonumber(id)) end end, {client, characterName, race, gender, skin, height, weight, age, languageselected, month, day}, exports.un_mysql:getConnection(), "SELECT id FROM characters WHERE id = LAST_INSERT_ID()") end end, {client, characterName, race, gender, skin, height, weight, age, languageselected, month, day}, exports.un_mysql:getConnection(), "SELECT charactername FROM characters WHERE charactername='" .. (characterName) .. "'") end addEventHandler("accounts:characters:new", getRootElement(), newCharacter_create) function emailDegistir(eposta) local username = getElementData(source, "account:username") if (string.len(eposta)<6) then triggerClientEvent(source, "email:GUIClose", source) triggerClientEvent(source, "accounts:error:window", source, "Geçersiz e-posta adresi.") elseif (string.len(eposta)>=50) then triggerClientEvent(source, "email:GUIClose", source) triggerClientEvent(source, "accounts:error:window", source, "Geçersiz e-posta adresi.") elseif (string.find(eposta, ";", 0)) or (string.find(eposta, ":", 0)) or (string.find(eposta, "'", 0)) or (string.find(eposta, ",", 0)) then triggerClientEvent(source, "email:GUIClose", source) triggerClientEvent(source, "accounts:error:window", source, "Geçersiz e-posta adresi.") else local query = dbExec(mysql:getConnection(), "UPDATE accounts SET email = '" .. eposta .. "', forceUpdate = 0 WHERE username = '" .. username .. "'") if query then outputChatBox("#575757UNT:#f9f9f9 E-posta adresiniz başarıyla değiştirildi.", source, 0, 255, 0, true) triggerClientEvent(source, "email:GUIClose", source) else triggerClientEvent(source, "accounts:error:window", source, "MySQL bağlantı hatası. F2 yetkili raporu açın.") end end end addEvent("email:degistir", true) addEventHandler("email:degistir", getRootElement(), emailDegistir)
  3. Bom amigo, aí é como eu disse, vai muito do modelador. Se ele souber bem a area onde ele atua, sim, daria para otimizar bastante.
  4. Acho que sim amigo, porém teria que converter. Bom seria alguém que conhecesse bem a ferramenta 3DSmax. E um bom modelador. Um exemplo seria esse vídeo aqui: Mapa do VC no MTA.
  5. Fiz, verifique para mim Lord se está correto. Cliente-side function vehiclefailures() failede = true local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle and (getVehicleType(vehicle) == "Automobile")) then if getElementHealth(vehicle) < 550 then triggerServerEvent("Caroff", getRootElement(), vehicle) setTimer(function() triggerServerEvent("Caron", getRootElement(), vehicle) end, 3000, 1) end end end addEventHandler("onClientVehicleDamage", root, vehiclefailures) addEventHandler("onClientVehicleEnter", root, vehiclefailures) function enginefailures() local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle and (getVehicleType(vehicle) == "Automobile")) then if getElementHealth(vehicle) < 550 then if not failede then return end setTimer(function() if not failede then return end triggerServerEvent("failurex", getRootElement(), vehicle) triggerServerEvent("Caroff", getRootElement(), vehicle) local sound = playSound("failure.wav") setTimer(function() triggerServerEvent("Caron", getRootElement(), vehicle) end, 3000, 1) failede = false setTimer(function() failede = true end, 25000, 1) end, 10, 1) end end end addEventHandler("onClientPreRender", root, enginefailures) function enginesoundf() if not sounding then sound = playSound("failure.wav") setSoundVolume(sound, 0.5) setTimer(function() sounding = true end, 5000, 1) end end addEvent("failureclient", true) addEventHandler("failureclient", getRootElement(), enginesoundf) Server-side function turnEngineOff(vehicle) setVehicleEngineState(vehicle, false) end addEvent("Caroff", true) addEventHandler("Caroff", getRootElement(), turnEngineOff) function turnEngineOn(vehicle) setVehicleEngineState(vehicle, true) end addEvent("Caron", true) addEventHandler("Caron", getRootElement(), turnEngineOn) function carfailure(vehicle) if getElementHealth(vehicle) < 360 then return end setElementHealth(vehicle, getElementHealth(vehicle) - 10) end addEvent("failurex", true) addEventHandler("failurex", getRootElement(), carfailure)
  6. Então, estou com um script para falha de motores, quanto mais o estado de vida do veículo para decaindo ou motor falhar com mais frequência, porém eu queria que quando esse nível de vida não ligasse mais. Lado do cliente function vehiclefailures() failede = true local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle and (getVehicleType(vehicle) == "Automobile")) then if getElementHealth(vehicle) < 550 then triggerServerEvent("Caroff", getRootElement(), vehicle) setTimer ( function() triggerServerEvent("Caron", getRootElement(), vehicle) end, 3000, 1 ) end end end addEventHandler("onClientVehicleDamage", root, vehiclefailures) addEventHandler("onClientVehicleEnter", root, vehiclefailures) function enginefailures() local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle and (getVehicleType(vehicle) == "Automobile")) then if getElementHealth(vehicle) < 550 then if not failede then return end setTimer( function() if not failede then return end triggerServerEvent("failurex", getRootElement(), vehicle) triggerServerEvent("Caroff", getRootElement(), vehicle) local sound = playSound("failure.wav") setTimer ( function() triggerServerEvent("Caron", getRootElement(), vehicle) end, 3000, 1 ) failede = false setTimer( function() failede = true end, 25000, 1 ) end, 10, 1 ) end end end addEventHandler ( "onClientPreRender", root, enginefailures ) function enginesoundf() if not sounding then sound=playSound("failure.wav") setSoundVolume(sound, 0.5) setTimer ( function() sounding = true end, 5000, 1 ) end end addEvent ( "failureclient", true ) addEventHandler ( "failureclient", getRootElement ( ), enginesoundf ) Lado do servidor function turnEngineOff (vehicle) setVehicleEngineState ( vehicle, false ) end addEvent("Caroff", true) addEventHandler("Caroff", getRootElement(), turnEngineOff) function turnEngineOn (vehicle) setVehicleEngineState ( vehicle, true ) end addEvent("Caron", true) addEventHandler("Caron", getRootElement(), turnEngineOn) function carfailure (vehicle) if getElementHealth(vehicle) < 360 then return end setElementHealth(vehicle, getElementHealth(vehicle) - 10 ) end addEvent("failurex", true) addEventHandler("failurex", getRootElement(), carfailure)
  7. Infelizmente a moderação brasileira não pode fazer nada sobre isso, sendo que é tratada pela gringa. Sinto muito e boa sorte
  8. Nunca testei, mas creio que sim, apenas fazendo um backup do seu internal.db. Depois que você resetar bastar inicia-lo e jogar a internal.db lá dentro novamente.
  9. Apenas os donos dos servidores em que você possui uma conta registrada podem ter acesso a esses dados.
  10. Caso você queira ter mais de 1 loja (sendo o mesmo resource) terá que mudar o nome das funções Caso a 1 Loja o nome da função de iniciar assalto for "IniciarAssalto" na outra você muda para "IniciarAssalto2" Mas não se esqueça de mudar o nome das funções nos eventos também! addEventHandler ("onPlayerTarget", root, IniciarAssalto) <--- 1 Evento da Função de Iniciar assalto / 2 Evento de iniciar o assalto ---> addEventHandler ("onPlayerTarget", root, IniciarAssalto2)
  11. Olá, peguei um sistema de assalto da net, queria por apenas para os PM'S receberem a msg de quando ela estiver sendo assaltada,.... --[[ ███████╗███████╗███████╗██████╗ ███████╗ ██████╗██████╗ ██╗██████╗ ████████╗███████╗██████╗ ╚══███╔╝██╔════╝██╔════╝██╔══██╗ ██╔════╝██╔════╝██╔══██╗██║██╔══██╗╚══██╔══╝██╔════╝██╔══██╗ ███╔╝ █████╗ █████╗ ██║ ██║ ███████╗██║ ██████╔╝██║██████╔╝ ██║ █████╗ ██████╔╝ ███╔╝ ██╔══╝ ██╔══╝ ██║ ██║ ╚════██║██║ ██╔══██╗██║██╔═══╝ ██║ ██╔══╝ ██╔══██╗ ███████╗███████╗███████╗██████╔╝ ███████║╚██████╗██║ ██║██║██║ ██║ ███████╗██║ ██║ ╚══════╝╚══════╝╚══════╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ --]] -----------------------/ MARKER'S \----------------------- local Marker_Assalto = createMarker(1689.549, -2251.223, -2.852 -1, "cylinder", 1.5, 255, 165, 0, 65) --local Blip_Loja = createBlipAttachedTo(Marker_Assalto, ID_Blip_Loja) --local Blip_Assaltada = createBlipAttachedTo(Marker_Assalto, ID_Blip_Loja_Assaltada) --setElementVisibleTo(Blip_Assaltada, root, false) ----------------/ MENSAGEM - AVISO \---------------- function Mensagem_Aviso(source) triggerClientEvent(source, "Zeed_Mensagem_Assalto", getRootElement()) end addEventHandler("onMarkerHit", Marker_Assalto, Mensagem_Aviso) function Fechar_Mensagem (source) triggerClientEvent(source, "Zeed_Mensagem_Assalto", getRootElement()) end addEventHandler("onMarkerLeave", Marker_Assalto, Fechar_Mensagem) -----------------------/ ASSALTO \----------------------- function Iniciar_Assalto (source) local Dinheiro_Sujo = getElementData(source, "Zeed_Dinheiro_Sujo") or 0 local Valor_Ganho = math.random(10, 20) -------------------------------------/ VALOR GANHO local Procurado = getPlayerWantedLevel(source) if isElementWithinMarker(source, Marker_Assalto) then if getElementData(source, "Zeed_Assaltando") then exports.a_infobox:addBox(source, "error", "A Loja Já esta Sendo Assaltada, Aguarde.") return end if isObjectInACLGroup("user. "..getAccountName(getPlayerAccount(source)), aclGetGroup (Grupo_Acl_Policial)) then exports.a_infobox:addBox(source, "error", "Você é Policial, Proibido Assaltar.") return end if getElementData(source, "Zeed_Loja_Assaltada") then exports.a_infobox:addBox(source, "error", "Loja Assaltada Recentemente, Aguarde.") return end exports.a_infobox:addBox(source, "info", "Assaltando, Aguarde.") setPedAnimation(source, "bomber", "bom_plant", -1, true, false, true) setElementData(source, "Zeed_Assaltando", true) triggerClientEvent(root, "Zeed_Ligar_Alarme", root, source) ----------------------------------/ Disparar o Alarme / iniciar alarme if Procurado < 6 then setPlayerWantedLevel(source, Procurado + 1) -------------------------------------/ QUANTIDADE ESTRELA end toggleAllControls(source, false) triggerClientEvent(source, "Zeed_Mensagem_Tempo", getRootElement()) Loja_Assaltada (source) setTimer(function() setPedAnimation(source, nil) toggleAllControls(source, true) setElementData(source, "Zeed_Assaltando", false) setElementData(source, "Zeed_Loja_Assaltada", true) setElementData(source, "Zeed_Dinheiro_Sujo", Dinheiro_Sujo + Valor_Ganho) triggerClientEvent(source, "Zeed_Mensagem_Tempo", getRootElement()) exports.a_infobox:addBox(source, "success", "Loja Assaltada com sucesso, Roubo de: $"..Valor_Ganho..".") end, Tempo_Assaltar_Loja*1000, 1) end end -----------------------/ BIND - TECLA \----------------------- function restart() for i, v in ipairs(getElementsByType("player")) do bindKey ( v, Tecla_Assalto, "down", Iniciar_Assalto ) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), restart) function join() bindKey ( source, Tecla_Assalto, "down", Iniciar_Assalto ) end addEventHandler("onPlayerJoin", getRootElement(), join) -----------------------/ LOJA ASSALTAR - AVISAR POLICIAL \----------------------- function Loja_Assaltada (source) setElementVisibleTo(Blip_Loja, root, false) setElementVisibleTo(Blip_Assaltada, root, true) exports.a_infobox:addBox(root, "info", "O jogador "..getPlayerName(source).." Está assaltando A Loja #02 em Los Santos.") setTimer(function() setElementVisibleTo(Blip_Loja, root, true) setElementVisibleTo(Blip_Assaltada, root, false) setElementData(source, "Zeed_Loja_Assaltada", false) end, Tempo_Recuperar_Loja*60000, 1) end ----------------/ SALVAR - DADOS \---------------- function Finalizar_Assalto (conta) if not (isGuestAccount (conta)) then if (conta) then local source = getAccountPlayer(conta) setPedAnimation(source, nil) toggleAllControls(source, true) setElementData(source, "Zeed_Loja_Assaltada", false) setElementData(source, "Zeed_Assaltando", false) end end end ----------------/ SALVAR - DADOS \---------------- function Restart_Resource (source) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then Finalizar_Assalto(acc) end end end end addEventHandler("onResourceStart", getRootElement(), Restart_Resource) ----------------/ SALVAR - DADOS \---------------- addEventHandler("onPlayerLogin", root, function( _, acc ) setTimer(Finalizar_Assalto, 50, 1, acc) end ) ----------------/ SALVAR - DADOS \---------------- function Desligar_Resource ( res ) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then Finalizar_Assalto(acc) end end end end addEventHandler("onResourceStop", getRootElement(), Desligar_Resource ) function Verificar_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 outputChatBox("O jogador possui "..Dinheiro.."$ de dinheiro sujo!", source, 255, 255, 255, true) end end end end addCommandHandler("verificarsujo", Verificar_Dinheiro) function Remover_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 setElementData(Jogador, "Zeed_Dinheiro_Sujo", 0) outputChatBox("Você removeu dinheiro sujo do jogador!", source, 255, 255, 255, true) end end end end addCommandHandler("removersujo", Remover_Dinheiro) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function Verificar_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 outputChatBox("O jogador possui "..Dinheiro.."$ de dinheiro sujo!", source, 255, 255, 255, true) end end end end addCommandHandler("verificarsujo", Verificar_Dinheiro) function Remover_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 setElementData(Jogador, "Zeed_Dinheiro_Sujo", 0) outputChatBox("Você removeu dinheiro sujo do jogador!", source, 255, 255, 255, true) end end end end addCommandHandler("removersujo", Remover_Dinheiro) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end esse de cima é o original esse é como eu tentei por --[[ ███████╗███████╗███████╗██████╗ ███████╗ ██████╗██████╗ ██╗██████╗ ████████╗███████╗██████╗ ╚══███╔╝██╔════╝██╔════╝██╔══██╗ ██╔════╝██╔════╝██╔══██╗██║██╔══██╗╚══██╔══╝██╔════╝██╔══██╗ ███╔╝ █████╗ █████╗ ██║ ██║ ███████╗██║ ██████╔╝██║██████╔╝ ██║ █████╗ ██████╔╝ ███╔╝ ██╔══╝ ██╔══╝ ██║ ██║ ╚════██║██║ ██╔══██╗██║██╔═══╝ ██║ ██╔══╝ ██╔══██╗ ███████╗███████╗███████╗██████╔╝ ███████║╚██████╗██║ ██║██║██║ ██║ ███████╗██║ ██║ ╚══════╝╚══════╝╚══════╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ --]] -----------------------/ MARKER'S \----------------------- local Marker_Assalto = createMarker(1316.453, -894.84, 39.578 -1, "cylinder", 1.5, 255, 165, 0, 65) --local Blip_Loja = createBlipAttachedTo(Marker_Assalto, ID_Blip_Loja) --local Blip_Assaltada = createBlipAttachedTo(Marker_Assalto, ID_Blip_Loja_Assaltada) --setElementVisibleTo(Blip_Assaltada, root, false) ----------------/ MENSAGEM - AVISO \---------------- function Mensagem_Aviso(source) triggerClientEvent(source, "Zeed_Mensagem_Assalto", getRootElement()) end addEventHandler("onMarkerHit", Marker_Assalto, Mensagem_Aviso) function Fechar_Mensagem (source) triggerClientEvent(source, "Zeed_Mensagem_Assalto", getRootElement()) end addEventHandler("onMarkerLeave", Marker_Assalto, Fechar_Mensagem) -----------------------/ ASSALTO \----------------------- function Iniciar_Assalto (source) local Dinheiro_Sujo = getElementData(source, "Zeed_Dinheiro_Sujo") or 0 local Valor_Ganho = math.random(10, 20) -------------------------------------/ VALOR GANHO local Procurado = getPlayerWantedLevel(source) if isElementWithinMarker(source, Marker_Assalto) then if getElementData(source, "Zeed_Assaltando") then exports.a_infobox:addBox(source, "error", "A Loja Já esta Sendo Assaltada, Aguarde.") return end if isObjectInACLGroup("user. "..getAccountName(getPlayerAccount(source)), aclGetGroup (Grupo_Acl_Policial)) then exports.a_infobox:addBox(source, "error", "Você é Policial, Proibido Assaltar.") return end if getElementData(source, "Zeed_Loja_Assaltada") then exports.a_infobox:addBox(source, "error", "Loja Assaltada Recentemente, Aguarde.") return end exports.a_infobox:addBox(source, "info", "Assaltando, Aguarde.") setPedAnimation(source, "bomber", "bom_plant", -1, true, false, true) setElementData(source, "Zeed_Assaltando", true) triggerClientEvent(root, "Zeed_Ligar_Alarme", root, source) ----------------------------------/ Disparar o Alarme / iniciar alarme if Procurado < 6 then setPlayerWantedLevel(source, Procurado + 1) -------------------------------------/ QUANTIDADE ESTRELA end toggleAllControls(source, false) triggerClientEvent(source, "Zeed_Mensagem_Tempo", getRootElement()) Loja_Assaltada (source) setTimer(function() setPedAnimation(source, nil) toggleAllControls(source, true) setElementData(source, "Zeed_Assaltando", false) setElementData(source, "Zeed_Loja_Assaltada", true) setElementData(source, "Zeed_Dinheiro_Sujo", Dinheiro_Sujo + Valor_Ganho) triggerClientEvent(source, "Zeed_Mensagem_Tempo", getRootElement()) exports.a_infobox:addBox(source, "success", "Loja Assaltada com sucesso, Roubo de: $"..Valor_Ganho..".") end, Tempo_Assaltar_Loja*1000, 1) end end -----------------------/ BIND - TECLA \----------------------- function restart() for i, v in ipairs(getElementsByType("player")) do bindKey ( v, Tecla_Assalto, "down", Iniciar_Assalto ) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), restart) function join() bindKey ( source, Tecla_Assalto, "down", Iniciar_Assalto ) end addEventHandler("onPlayerJoin", getRootElement(), join) -----------------------/ LOJA ASSALTAR - AVISAR POLICIAL \----------------------- function Loja_Assaltada (source) --setElementVisibleTo(Blip_Loja, root, false) --setElementVisibleTo(Blip_Assaltada, root, true) isObjectInACLGroup("user. "..getAccountName(getPlayerAccount(source)), aclGetGroup (Grupo_Acl_Policial)) exports.a_infobox:addBox(root, "info", "O jogador "..getPlayerName(source).." Está assaltando A Loja #01 em Los Santos.") setTimer(function() --setElementVisibleTo(Blip_Loja, root, true) --setElementVisibleTo(Blip_Assaltada, root, false) --setElementData(source, "Zeed_Loja_Assaltada", false) end, Tempo_Recuperar_Loja*60000, 1) end ----------------/ SALVAR - DADOS \---------------- function Finalizar_Assalto (conta) if not (isGuestAccount (conta)) then if (conta) then local source = getAccountPlayer(conta) setPedAnimation(source, nil) toggleAllControls(source, true) setElementData(source, "Zeed_Loja_Assaltada", false) setElementData(source, "Zeed_Assaltando", false) end end end ----------------/ SALVAR - DADOS \---------------- function Restart_Resource (source) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then Finalizar_Assalto(acc) end end end end addEventHandler("onResourceStart", getRootElement(), Restart_Resource) ----------------/ SALVAR - DADOS \---------------- addEventHandler("onPlayerLogin", root, function( _, acc ) setTimer(Finalizar_Assalto, 50, 1, acc) end ) ----------------/ SALVAR - DADOS \---------------- function Desligar_Resource ( res ) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then Finalizar_Assalto(acc) end end end end addEventHandler("onResourceStop", getRootElement(), Desligar_Resource ) function Verificar_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 outputChatBox("O jogador possui "..Dinheiro.."$ de dinheiro sujo!", source, 255, 255, 255, true) end end end end addCommandHandler("verificarsujo", Verificar_Dinheiro) function Remover_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 setElementData(Jogador, "Zeed_Dinheiro_Sujo", 0) outputChatBox("Você removeu dinheiro sujo do jogador!", source, 255, 255, 255, true) end end end end addCommandHandler("removersujo", Remover_Dinheiro) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function Verificar_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 outputChatBox("O jogador possui "..Dinheiro.."$ de dinheiro sujo!", source, 255, 255, 255, true) end end end end addCommandHandler("verificarsujo", Verificar_Dinheiro) function Remover_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "Zeed_Dinheiro_Sujo") or 0 setElementData(Jogador, "Zeed_Dinheiro_Sujo", 0) outputChatBox("Você removeu dinheiro sujo do jogador!", source, 255, 255, 255, true) end end end end addCommandHandler("removersujo", Remover_Dinheiro) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end
  12. E ai galera, peço por favor que me ajudem nesse! A duvida dos outros tópicos eu já consegui resolver. Porém quero vincular mais um script ao outro. Porém não tive sucesso! É um desmanche e uma loja de veiculos com garagem. Queria que ao desmanchar o veiculo o player perdesse o veiculo que comprou na loja. loja de veh lado server --[[ =========================================================== # Minha página: https://www.facebook.com/TioSteinScripter/# #╔════╗╔══╗╔═══╗ ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗ # #║╔╗╔╗║╚╣─╝║╔═╗║ ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║ # #╚╝║║╚╝─║║─║║─║║ ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║ # #──║║───║║─║║─║║ ╚══╗║──║║──║╔══╝─║║─║║╚╗║║ # #──║║──╔╣─╗║╚═╝║ ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║ # #──╚╝──╚══╝╚═══╝ ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝ # =========================================================== --]] addEventHandler("onResourceStart", resourceRoot, function(res) if res == getThisResource() then db = dbConnect( "sqlite", "veiculos.sqlite" ) dbExec(db, "CREATE TABLE IF NOT EXISTS Veiculos (ID, Conta, Valor, IDVeiculo, NomeVeiculo, Status, Cores)") for i, player in ipairs(getElementsByType("player")) do CarregarLista(player) end if db then outputDebugString("dbConnect[veiculos]: Sucesso!") else outputDebugString("dbConnect[veiculos]: Fail!") end end end) function getTabelaVehicles () return VeiculosAVenda end function NovoID() local result = dbPoll(dbQuery(db, "SELECT ID FROM Veiculos ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end for i=1, #Lojas do local x, y, z, int = Lojas[i][1], Lojas[i][2], Lojas[i][3], Lojas[i][4] Lojas[i] = createMarker( x, y, z, "cylinder", 1.8, 0, 255, 127, 90) Lojas.ID[Lojas[i]] = i --local Blips = createBlipAttachedTo ( Lojas[i], 55 ) --setBlipVisibleDistance(Blips, 180) setElementInterior(Lojas[i], int) end function hit (element) if Lojas.ID[source] then if getElementType(element) == "player" then local Conta = getPlayerAccount ( element ) if isGuestAccount ( Conta ) then triggerClientEvent(element, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffLogue-se para entrar na loja de veiculos!", "info") return end CarregarLista(element) triggerClientEvent(element, "TS:AbrirComprarCarro", element) end end end addEventHandler("onMarkerHit", resourceRoot, hit) for i=1, #Markers do local x, y, z, int = Markers[i][1], Markers[i][2], Markers[i][3], Markers[i][4] Markers[i] = createMarker( x, y, z, "cylinder", 1.8, 0, 255, 127, 90) Markers.ID[Markers[i]] = i --local Blips = createBlipAttachedTo ( Markers[i], 32 ) setBlipVisibleDistance(Blips, 180) setElementInterior(Markers[i], int) end function hit (element) if Markers.ID[source] then if getElementType(element) == "player" then local Conta = getPlayerAccount ( element ) if isGuestAccount ( Conta ) then triggerClientEvent(element, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffLogue-se para entrar na garagem!", "info") return end CarregarLista(element) triggerClientEvent(element, "TS:AbrirLojaCarros2", element) end end end addEventHandler("onMarkerHit", resourceRoot, hit) function AbrirDocumentacao(source) local VeiculoDentro = getPedOccupiedVehicle(source) if not VeiculoDentro then return end triggerClientEvent(source,"TS:AbrirDoc", source) end addCommandHandler("doc", AbrirDocumentacao) function RoubarVeiculo (source) for id, Veiculo in ipairs(getElementsByType("vehicle")) do local cx, cy, cz = getElementPosition ( Veiculo ) local px, py, pz = getElementPosition ( source ) local distance= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if ( distance <= 3 ) then if getElementData(Veiculo, "TS:Trancado") == true then local speedx, speedy, speedz = getElementVelocity ( Veiculo ) local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 if kmh >= 2 then return end triggerClientEvent(source, "TS:AbrirRouboVeiculo", source) toggleAllControls(source, false) setPedAnimation( source, "BOMBER", "BOM_Plant", 60000, true) setTimer(function() setElementData(Veiculo, "TS:Roubado", true) setPedAnimation( source, nil) triggerClientEvent(source, "TS:AbrirRouboVeiculo", source) toggleAllControls(source, true) triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Veiculo Aberto!") setElementData(Veiculo, "TS:Trancado", false) end, 60000, 1) end end end end addCommandHandler("roubarveiculo", RoubarVeiculo) VeiculoComprei = {} function ComprarVeiculo(source, NomeVeiculo, ValorVeiculo, AluguelVeiculo, IDVeiculo, r1, g1, b1, r2, g2, b2) local data = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ?", getAccountName(getPlayerAccount(source))), -1) if #data >= LimiteVeiculos then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff O seu limite de veiculos é "..LimiteVeiculos.."!") return end local Dinheiro = getPlayerMoney(source) local VeiculoDentro = getPedOccupiedVehicle(source) local NomeDono = getElementData(source,"ID") or "Error" abc = false for i, data in ipairs (data) do if data["IDVeiculo"] == tonumber(IDVeiculo) then abc = true break end end if abc == true then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você já tem esse veiculo!") return end if IDVeiculo and ValorVeiculo then if tonumber(Dinheiro) >= tonumber(ValorVeiculo) then local NewID = NovoID() local Placa = "CV" takePlayerMoney(source, ValorVeiculo) local Cor = r1, g1, b1, r2, g2, b2 dbExec(db, "INSERT INTO Veiculos VALUES( ?, ?, ?, ?, ?, ?, ?)", tonumber(NewID), getAccountName(getPlayerAccount(source)), tonumber(ValorVeiculo), tonumber(IDVeiculo), NomeVeiculo, "Guardado", Cor) triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Veiculo Comprado, olhe sua garagem!") CarregarLista(source) else triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Dinheiro Insuficiente") end end end addEvent("TS:ComprarVeiculo", true) addEventHandler("TS:ComprarVeiculo", root, ComprarVeiculo) VeiculoAluguel = {} function AlugarVeiculo (source, NomeVeiculo, ValorVeiculo, ValorAluguel, IDVeiculo, r1, g1, b1, r2, g2, b2) if getElementData(source, "TS:VeiculoAlugado") == true then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você já tem um veiculo alugado, aguarde "..TempoDeAluguel.." minutos !") return end local Dinheiro = getPlayerMoney(source) local NomeDono = getElementData(source,"ID") or "Error" if Dinheiro < tonumber(ValorAluguel) then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você não tem dinheiro suficiente!") return end takePlayerMoney(source, ValorAluguel) setElementData(source, "TS:VeiculoAlugado", true) VeiculoAluguel[source] = createVehicle(IDVeiculo, PosxAluga, PosyAluga, PoszAluga) warpPedIntoVehicle ( source, VeiculoAluguel[source] ) setElementData(VeiculoAluguel[source], "TS:Dono", NomeDono) setElementData(VeiculoAluguel[source], "TS:RGDono", "Alugado Por : "..getElementData(source, "ID")) setElementData(VeiculoAluguel[source], "TS:ValorCarro", 0) setVehiclePlateText(VeiculoAluguel[source], "Aluguel") triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Veiculo Alugado por "..TempoDeAluguel.." Minutos") setVehicleColor( VeiculoAluguel[source], r1, g1, b1, r2, g2, b2 ) setTimer(function() if VeiculoAluguel[source] then destroyElement(VeiculoAluguel[source]) end triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff A loja de veiculos pegou o veiculo alugado de volta !") setElementData(source, "TS:VeiculoAlugado", false) end, TempoDeAluguel*60000, 1) end addEvent("TS:AlugarVeiculo", true) addEventHandler("TS:AlugarVeiculo", root, AlugarVeiculo) VeiculoSpawnar = {} function getVehicleConceStein (vehicle) local tabela = VeiculosAVenda local model = getElementModel(vehicle) for i=1, #tabela do if tonumber(model) == tonumber(tabela[i][1]) then return tonumber(tabela[i][3]) end end end function getPorcentagem (porce, valor) if porce and valor then local valor_01 = porce/100 if valor_01 then local valor_02 = valor_01*valor if valor_02 then local valor = math.floor(valor_02) return tonumber(valor) end end end end function PegarVeiculo (source, NomeCarro, IDCarro, SlotCarro, ValorCarro41) local data2 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ? AND NomeVeiculo = ?", getAccountName(getPlayerAccount(source)), NomeCarro), -1) for i, data in ipairs (data2) do local VeiculoDentro = getPedOccupiedVehicle(source) if exports.MAT_Desmanche:isVehicleDesmanche(VeiculoDentro) then if getPlayerMoney(source) < tonumber(getPorcentagem (50, tonumber(getVehicleConceStein (vehicle)))) then return triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você não possui o valor de retirada do veiculo: "..tonumber(getPorcentagem (50, tonumber(getVehicleConceStein (vehicle))))) else takePlayerMoney(source, tonumber(getPorcentagem (50, tonumber(getVehicleConceStein (vehicle))))) exports.MAT_Desmanche:unlockvehicle(VeiculoDentro) end end if VeiculoDentro then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Saia do veiculo!") return end local ValorCarro = data["Valor"] local StatusVeiculo = data["Status"] local IDSlot = data["ID"] local IDVeiculo2 = data["IDVeiculo"] local ValorTotal = 10/100*ValorCarro if StatusVeiculo ~= "Guardado" then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Esse veiculo já está spawnado") return end local Nome = getElementData(source,"ID") or "Error" local PosPlayerx, PosPlayery,PosPlayerz = getElementPosition(source) local Cor1 = data["R"] local Cor2 = data["G"] local Cor3 = data["B"] VeiculoSpawnar[source] = createVehicle(IDVeiculo2, PosPlayerx, PosPlayery,PosPlayerz) warpPedIntoVehicle ( source, VeiculoSpawnar[source] ) setElementData(VeiculoSpawnar[source], "TS:Dono", Nome) setElementData(VeiculoSpawnar[source], "TS:ValorCarro", ValorCarro) setElementData(VeiculoSpawnar[source], "TS:NomeCarro", NomeCarro) setElementData(VeiculoSpawnar[source], "TS:ContaDono", getAccountName(getPlayerAccount(source))) setElementData(VeiculoSpawnar[source], "TS:IDCarro", IDCarro) setElementData(VeiculoSpawnar[source], "TS:RGDono", getElementData(source, "ID")) setElementData(VeiculoSpawnar[source], "TS:ID", IDSlot) setVehiclePlateText(VeiculoSpawnar[source], "ITOS - "..IDSlot) dbExec(db, "UPDATE Veiculos SET Status = ? WHERE Conta = ? AND ID = ?", "Spawnado", getAccountName(getPlayerAccount(source)), IDSlot) triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Seu veiculo foi spawnado") local color = split(data["Cores"], ',') r1 = color[1] or 255 g1 = color[2] or 255 b1 = color[3] or 255 r2 = color[4] or 255 g2 = color[5] or 255 b2 = color[6] or 255 setVehicleColor( VeiculoSpawnar[source], r1, g1, b1, r2, g2, b2 ) CarregarLista(source) end end addEvent("TS:PegarVeiculo", true) addEventHandler("TS:PegarVeiculo", root, PegarVeiculo) function GuardarVeiculo (source, NomeCarro, IDCarro, SlotCarro) local data2 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ? AND NomeVeiculo = ?", getAccountName(getPlayerAccount(source)), NomeCarro), -1) for i, data in ipairs (data2) do local VeiculoDentro = getPedOccupiedVehicle(source) local Nome = getElementData(source,"ID") or "Error" if not VeiculoDentro then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Para realizar essa ação é preciso estar no carro!") return end local IDVeiculo = getElementModel(VeiculoDentro) local NomeVeiculo = getElementData(VeiculoDentro, "TS:NomeCarro") or getVehicleNameFromModel (IDVeiculo) if getElementData(VeiculoDentro, "TS:Dono") ~= Nome then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Para realizar essa ação é preciso estar no carro!") return end if NomeVeiculo ~= NomeCarro then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você não está dentro do veiculo!") return end local StatusVeiculo = data["Status"] if StatusVeiculo == "Guardado" then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Esse veiculo já está guardado") return end local r1, g1, b1, r2, g2, b2 = getVehicleColor(VeiculoDentro, true) local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 local IDVeiculo2 = getElementData(VeiculoDentro, "TS:ID") dbExec(db, "UPDATE Veiculos SET Cores = ?, Status = ? WHERE Conta = ? AND ID = ?", color, "Guardado", getAccountName(getPlayerAccount(source)), IDVeiculo2) triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Seu veiculo foi Guardado") CarregarLista(source) destroyElement(VeiculoDentro) end end addEvent("TS:GuardarVeiculo", true) addEventHandler("TS:GuardarVeiculo", root, GuardarVeiculo) function VenderVeiculoConce (source, IDVeiculo, NomeVeiculo) local VeiculoDentro = getPedOccupiedVehicle(source) if not VeiculoDentro then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Para realizar essa ação é preciso estar no carro!") return end local Nome = getElementData(source,"ID") or "Error" local IDProprietario = getElementData(VeiculoDentro,"TS:ID") or "Error" local IDVeiculo2 = getElementModel(VeiculoDentro) local NomeVeiculo2 = getElementData(VeiculoDentro, "TS:NomeCarro") or getVehicleNameFromModel (IDVeiculo) local Valor = getElementData(VeiculoDentro, "TS:ValorCarro") or 0 local ValorTotal = 70/100*Valor local data2 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ? AND ID = ?", getAccountName(getPlayerAccount(source)), IDProprietario), -1) for i, data in ipairs (data2) do if getElementData(VeiculoDentro, "TS:Dono") ~= Nome then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Para realizar essa ação é preciso estar no carro!") return end if NomeVeiculo2 ~= NomeVeiculo then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você não está dentro do veiculo!") return end dbExec(db, "DELETE FROM Veiculos WHERE Conta = ? AND ID = ?", getAccountName(getPlayerAccount(source)), IDProprietario) destroyElement(VeiculoDentro) triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Veiculo Vendido Por "..ValorTotal.." ( 70% )") givePlayerMoney(source, ValorTotal) end end addEvent("TS:VenderVeiculoConce", true) addEventHandler("TS:VenderVeiculoConce", root, VenderVeiculoConce) function LocalizarVeiculo (source, NomeCarro, IDCarro, Emplacamento, ValorCarro41) if isElement(Blip) then destroyElement(Blip) return end local data2 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ? AND NomeVeiculo = ?", getAccountName(getPlayerAccount(source)), NomeCarro), -1) for i, data in ipairs (data2) do local VeiculoDentro = getPedOccupiedVehicle(source) local StatusVeiculo = data["Status"] local IDSlot = data["ID"] if StatusVeiculo == "Guardado" then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Esse veiculo não está spawnado!") return end local Veiculo = ProcurarPlacaVeiculo("ITOS - "..Emplacamento) if not Veiculo then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Veiculo não encontrado!") return end Blip = createBlipAttachedTo(Veiculo, 41) setElementVisibleTo(Blip, root, false) setElementVisibleTo(Blip, source, true) end end addEvent("TS:LocalizarVeiculo", true) addEventHandler("TS:LocalizarVeiculo", root, LocalizarVeiculo) function EnviarVeiculo (source, IDJogador, IDVeiculo, NomeVeiculo) local Jogador = getPlayerID(IDJogador) if Jogador then local VeiculoDentro = getPedOccupiedVehicle(source) if not VeiculoDentro then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Para realizar essa ação é preciso estar no carro!") return end local Nome = getElementData(source,"ID") or "Error" local IDProprietario = getElementData(VeiculoDentro,"TS:ID") or "Error" local IDVeiculo2 = getElementModel(VeiculoDentro) local NomeVeiculo2 = getElementData(VeiculoDentro, "TS:NomeCarro") or getVehicleNameFromModel (IDVeiculo) local data2 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ? AND ID = ?", getAccountName(getPlayerAccount(source)), IDProprietario), -1) for i, data in ipairs (data2) do local data3 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ?", getAccountName(getPlayerAccount(Jogador))), -1) if #data3 >= LimiteVeiculos then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff O limite de veiculos do jogador é "..LimiteVeiculos.."!") return end if getElementData(VeiculoDentro, "TS:Dono") ~= Nome then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Para realizar essa ação é preciso estar no carro!") return end if NomeVeiculo2 ~= NomeVeiculo then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você não está dentro do veiculo!") return end abc = false for i, data3 in ipairs (data3) do if data3["IDVeiculo"] == IDVeiculo2 then abc = true break end end if abc == true then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff O jogador já tem esse veiculo!") return end triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Você recebeu um veiculo, Olhe sua garagem") dbExec(db, "UPDATE Veiculos SET Conta = ?, Status = ? WHERE Conta = ? AND ID = ?", getAccountName(getPlayerAccount(Jogador)), "Guardado", getAccountName(getPlayerAccount(source)), IDProprietario) destroyElement(VeiculoDentro) triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Veiculo Enviado") end else triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Jogador não encontrado") end end addEvent("TS:EnviarVeiculo", true) addEventHandler("TS:EnviarVeiculo", root, EnviarVeiculo) addEventHandler ( "onResourceStart", resourceRoot, function ( mod ) setTimer( function() for i, player in ipairs (getElementsByType("player")) do dbExec(db, "UPDATE Veiculos SET Status = ? WHERE Conta = ? AND Status = ?", "Guardado", getAccountName(getPlayerAccount(player)), "Spawnado") setElementData(player, "TS:VeiculoAlugado", nil) end end, 3000, 1) end ) function DesmancheCarro(source, IdCar, ValorSeguro) local data2 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ? AND IDVeiculo = ?", getAccountName(getPlayerAccount(source)), IdCar), -1) for i, data in ipairs (data2) do local Seguro = data["Seguro"] if Seguro == "Sim" then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Seu veiculo foi desmanchado, você tinha seguro e recuperou 80% do valor!") givePlayerMoney(source, ValorSeguro) dbExec(db, "DELETE FROM Veiculos WHERE Conta = ? AND IDVeiculo = ?", getAccountName(getPlayerAccount(source)), IdCar) else triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Seu veiculo foi desmanchado, você não tinha seguro!") dbExec(db, "DELETE FROM Veiculos WHERE Conta = ? AND IDVeiculo = ?", getAccountName(getPlayerAccount(source)), IdCar) end end end addEvent("TS:DesmancheCarro", true) addEventHandler("TS:DesmancheCarro", root, DesmancheCarro) function Deslogar () local data2 = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ?", getAccountName(getPlayerAccount(source))), -1) for i, data in ipairs (data2) do local IDDoDono = getElementData(source, "ID") if not IDDoDono then return end local VeiculoIDDoDono = ProcurarVeiculosNoJogo(IDDoDono) --if VeiculoIDDoDono then destroyElement(VeiculoIDDoDono) end if VeiculoAluguel[source] then destroyElement(VeiculoAluguel[source]) end dbExec(db, "UPDATE Veiculos SET Status = ? WHERE Conta = ? AND Status = ?", "Guardado", getAccountName(getPlayerAccount(source)), "Spawnado") end end addEventHandler("onPlayerQuit", root, Deslogar) addEventHandler("onPlayerLogin", root, Deslogar) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function getVehicleIDConce(id) v = false for i, player in ipairs (getElementsByType("vehicle")) do if getElementData(player, "TS:ID") == id then v = player break end end return v end function ProcurarPlacaVeiculo(id) v = false for i, player in ipairs (getElementsByType("vehicle")) do if getVehiclePlateText(player) == id then v = player break end end return v end function ProcurarVeiculosNoJogo(id) v = false for i, player in ipairs (getElementsByType("vehicle")) do if getElementData(player, "TS:Dono") == id then v = player break end end return v end function CarregarLista(player) if isElement(player) then local result = dbPoll(dbQuery(db, "SELECT * FROM Veiculos WHERE Conta = ?", getAccountName(getPlayerAccount(player))), -1) if type(result) == "table" then setElementData(player, "TS:VeiculosInfo", result) end end end addEvent("TS:CarregarLista", true) addEventHandler("TS:CarregarLista", root, CarregarLista) function Placa(source, cmd) local Placa = getElementData(source, "TS:Placa") or "Ativa" if Placa == "Ativa" then setElementData(source, "TS:Placa", "Desativa") triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Placas desativadas") else setElementData(source, "TS:Placa", "Ativa") triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺#ffffff Placas Ativadas") end end addCommandHandler("placa", Placa) Desmanche lado server local zones = { {2553.872, -1126.315, 63.709}, } local zone = {} local myZone = {} local elements = {} local zonetime = {} local tableZone = {} addEventHandler('onResourceStart', resourceRoot, function() for i=1, #zones do zone[i] = createColSphere(zones[i][1], zones[i][2], zones[i][3], 10) addEventHandler('onColShapeHit', zone[i], enterZone) addEventHandler('onColShapeLeave', zone[i], exitZone) end end) local function checkZone (zone) for i = 1, #zonetime do if zonetime[i] == zone then return false end end return true end local function getPosZone (zone) for i = 1, #zonetime do if zonetime[i] == zone then return i end end end setTimer(function() for i = 1, #zonetime do if tableZone and not tableZone[zonetime[i]] then tableZone[zonetime[i]] = {['Ocupada'] = true, ['Horas'] = 3, ['Minutos'] = 0, ['Segundos'] = 0} attWithinZone(zonetime[i]) end if tableZone[zonetime[i]]['Segundos'] <= 0 then tableZone[zonetime[i]]['Segundos'] = 59 tableZone[zonetime[i]]['Minutos'] = tableZone[zonetime[i]]['Minutos'] - 1 if tableZone[zonetime[i]]['Minutos'] <= 0 then tableZone[zonetime[i]]['Minutos'] = 59 if tableZone[zonetime[i]]['Horas'] > 0 then tableZone[zonetime[i]]['Horas'] = tableZone[zonetime[i]]['Horas'] - 1 end end end tableZone[zonetime[i]]['Segundos'] = tableZone[zonetime[i]]['Segundos'] - 1 if tableZone[zonetime[i]]['Segundos'] <= 0 and tableZone[zonetime[i]]['Horas'] == 0 then table.remove(zonetime, getPosZone (zonetime[i])) tableZone[zonetime[i]] = nil end end end, 1000, 0) function attWithinZone (zone) if tableZone[zone] then local player = nil for i=1, #getElementsWithinColShape(zone, "player" ) do player = getElementsWithinColShape(zone, "player" )[i] triggerClientEvent(player, 'rzk:load:timezone', resourceRoot, zone, true, tableZone[zone]['Horas'], tableZone[zone]['Minutos'], tableZone[zone]['Segundos']) end end end addEvent('rzk:ocupezone', true) addEventHandler('rzk:ocupezone', resourceRoot, function (player, zone, vehicle) if isElement(zone) then if checkZone (zone) then if not tableZone[zone] then table.insert(zonetime, zone) setElementData(vehicle, 'vehicle:desmanche', true) setElementData(player, 'player:vehicle', vehicle) else triggerClientEvent(player, 'cancel:service', resourceRoot) end else triggerClientEvent(player, 'cancel:service', resourceRoot) end end end) function exitZone (element) if getElementType (element) == "player" then triggerClientEvent(element, 'rzk:load:timezone', resourceRoot, source, false) local vehicle = getPedOccupiedVehicle (element) if vehicle then removeEventHandler ( "onVehicleExit", vehicle, exitVehicle) myZone[element] = nil end end end function enterZone (element) if getElementType (element) == "player" then if tableZone[source] then triggerClientEvent(element, 'rzk:load:timezone', resourceRoot, source, true, tableZone[source]['Horas'], tableZone[source]['Minutos'], tableZone[source]['Segundos']) else triggerClientEvent(element, 'rzk:load:timezone', resourceRoot, source, true) end local vehicle = getPedOccupiedVehicle (element) if vehicle then addEventHandler ( "onVehicleExit", vehicle, exitVehicle) end myZone[element] = source end end local blackListVehicle = { [401]=true, } function exitVehicle (player, seat) if isElement(source) then if not tableZone[myZone[player]] then if not blackListVehicle[getElementModel(source)] then if seat == 0 then removeEventHandler ( "onVehicleExit", source, exitVehicle) triggerClientEvent(player, 'rzk:startprogress', resourceRoot, source, myZone[player]) else removeEventHandler ( "onVehicleExit", source, exitVehicle) end else exports.Mat_Infos:serverNotification(player, "info", "Esse veiculo não pode ser desmanchado.", 10, 25) removeEventHandler ( "onVehicleExit", source, exitVehicle) end else exports.Mat_Infos:serverNotification(player, "info", "Aguarde "..tableZone[myZone[player]]['Horas'].." Horas e "..tableZone[myZone[player]]['Minutos'].." Minutos para realizar outro desmanche.", 10, 25) end end myZone[player] = nil end addEventHandler ( "onVehicleStartEnter", getRootElement(), function ( player, seat, jacked ) if (getElementData(source, 'vehicle:desmanche')) then --if the vehicle is one of 4 police cars, and the skin is not a police skin cancelEvent() exports.Mat_Infos:serverNotification(player, "info", "Esse veiculo está sendo desmanchado.", 10, 25) end end) addEvent('rzk:action:vehicle', true) addEventHandler('rzk:action:vehicle', resourceRoot, function (vehicle, door, action) if isElement(vehicle) then local door = tonumber(door) setVehicleDoorOpenRatio (vehicle, door, action, 2000) end end) addEvent('rzk:remove:component', true) addEventHandler('rzk:remove:component', resourceRoot, function (vehicle, component) if isElement(vehicle) then local players = getElementsByType("player") local player = nil for i = 1, #players do player = players[i] triggerClientEvent(player, 'remove:component', resourceRoot, vehicle, component) end end end) addEvent('rzk:setAnimation', true) addEventHandler('rzk:setAnimation', resourceRoot, function (player, anim_1, anim_2) if isElement(player) then if anim_1 then setElementFrozen(player, true) setPedAnimation(player, anim_1, anim_2) else setPedAnimation(player) setElementFrozen(player, false) end end end) addEvent('rzk:destroyVehicle', true) addEventHandler('rzk:destroyVehicle', resourceRoot, function (player, vehicle) if isElement(vehicle) then setElementData(vehicle, 'vehicle:desmanche', nil) setElementData(player, 'player:vehicle', nil) destroyElement(vehicle) givePlayerMoney(player, math.random(100, 1000)) exports.Mat_Infos:serverNotification(player, "info", "Veiculo desmanchado com sucesso.", 10, 25) end end) addEventHandler ( "onPlayerQuit", root, function () if getElementData(source, 'player:vehicle') then local vehicle = getElementData(source, 'player:vehicle') setElementData(vehicle, 'vehicle:desmanche', nil) local players = getElementsByType("player") local player = nil for i = 1, #players do player = players[i] triggerClientEvent(player, 'reset:remove:component', resourceRoot, vehicle) end setElementData(source, 'player:vehicle', nil) end end)
  13. Galera, tenho um mod de Lixeiro que ao dar /cavar nos marker ele ganha algum item aleatorio e vai para o inventario, porém o inventario que eu tenho é "EDIT" e usa a função triggerServerEvent para dar e pegar itens pelo client side e usa a função triggerEvent para o serv side e o outro inventario onde esse mod do lixeiro estava vinculado era por export.............. comandos para dar e pegar itens do inventario que uso. triggerServerEvent("TS:giveItem", localPlayer, localPlayer, iditem, quantidade) --- Cliente Side triggerEvent("TS:giveItem", source, source, iditem, quantidade) --- Server Side triggerServerEvent("TS:takeItem", localPlayer, localPlayer, iditem, quantidade) --- Cliente Side triggerEvent("TS:takeItem", source, source, iditem, quantidade) --- Server Side ]]-- segue abaixo o serv side do Mod lixeiro Minerios = { {"Plastico"}, {"Plastico"}, {"Plastico"}, {"Vidro"}, {"Plastico"}, {"Plastico"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"cobre"}, {"Vidro"}, {"Plastico"}, {"Plastico"}, {"Vidro"}, {"Plastico"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"Plastico"}, {"Vidro"}, {"Vidro"}, {"Plastico"}, {"Plastico"}, {"Vidro"}, {"Vidro"}, {"Plastico"}, {"Plastico"}, {"Plastico"}, {"Vidro"}, {"Vidro"}, {"Plastico"}, {"Vidro"}, {"Plastico"}, {"Vidro"}, {"Vidro"}, {"Vidro"}, {"Plastico"}, {"Plastico"}, {"Vidro"}, {"Plastico"}, {"Latinha"}, {"Plastico"}, {"Plastico"}, {"Plastico"}, {"Plastico"}, {"Vidro"}, {"Plastico"}, {"Plastico"}, {"Plastico"}, {"Plastico"}, {"Latinha"}, {"Vidro"}, {"Plastico"}, {"Vidro"}, {"Plastico"}, {"Vidro"}, {"Latinha"}, {"Plastico"}, {"Vidro"}, {"Vidro"}, {"Plastico"}, {"Cobre"}, {"Plastico"}, {"Latinha"}, } function Vender_Minerio2(source, Minerio, Quantidade, Valor) local Minerio_ = exports.inventario:getPlayerItem(source, Minerio) or 0 if tonumber(Minerio_) >= 1 then givePlayerMoney(source, Valor) exports.inventario:takePlayerItem(source, Minerio, 1) exports["a_infobox"]:addBox(source, "success", "Você vendeu um lixo: "..Minerio.."!") else exports["a_infobox"]:addBox(source, "error", "Você não possui esse tipo de lixo para vender!") end end addEvent ("DNL:Vender_Minerio2", true) addEventHandler ("DNL:Vender_Minerio2", root, Vender_Minerio2) Marker_Minerar2 = {} Markers_Minerios2 = { {-82.563, -1544.44, 2.611}, {-79.329, -1546.784, 2.611}, {-79.464, -1550.111, 2.611}, {-80.633, -1554.046, 2.611}, {-80.488, -1556.811, 2.662}, {-82.475, -1560.748, 2.614}, {-84.356, -1563.831, 2.673}, {-91.919, -1564.316, 2.659}, {-98.386, -1563.579, 2.916}, {-97.336, -1558.351, 4.906}, {-2069.997, -1442.155, 113.896}, {-2070.396, -1431.868, 112.74}, {-2069.828, -1421.878, 112.159}, {-2064.997, -1411.925, 112.526}, } function Gerar_Minerios2() for i, markers in ipairs ( Marker_Minerar2 ) do if isElement ( markers ) then destroyElement ( markers ) end end for i, v in ipairs ( Markers_Minerios2 ) do Marker_Minerar2[i] = createMarker ( v[1], v[2], v[3] -1, "cylinder", 2.5, 138, 43, 226, 255) setElementData(Marker_Minerar2[i], "Marker_Minerar2", true) setElementVisibleTo ( Marker_Minerar2[i], root, false ) end for ins, Player in ipairs(getElementsByType("player")) do local Emprego = getElementData ( Player, "Emprego" ) if Emprego == "Lixeiro" then for i, M_Minerar in ipairs ( Marker_Minerar2 ) do setElementVisibleTo ( M_Minerar, Player, true ) end exports["a_infobox"]:addBox(Player, "info", "Atenção os lixos foram liberados pra extração!") end end end Gerar_Minerios2 () setTimer(function() Gerar_Minerios2 () end, 240000, 0) function Minerar2(source) local Emprego = getElementData ( source, "Emprego" ) local Xp = tonumber(getElementData(source, "Exp")) or 0 local Random_Minerio = math.random ( #Minerios ) local Recompensa = math.random(10, 15) if Emprego == "Lixeiro" then if getElementData(source, "Cavando") == false then for _, Marker in ipairs( getElementsByType 'marker' ) do if getElementData(Marker, "Marker_Minerar2") == true then if isElementWithinMarker(source, Marker) then local Minerio_Ganho = getElementData(source, "Minerio_Ganho") or "Nada" local Minerio_Player = tonumber(getElementData(source, "min."..Minerio_Ganho.."")) or 0 if isElement (Marker) then destroyElement (Marker) end setElementData(source, "Minerio_Ganho", nil) setElementData(source, "Recompensa", 0) giveWeapon(source, 6, 1, true) setElementData(source, "Cavando", true) setPedAnimation(source, "BASEBALL", "Bat_4", 10000, true) exports["a_infobox"]:addBox(source, "info", "Você está garimpando, aguarde 10 segundos!") setTimer(function() takeWeapon(source, 6) setPedAnimation( source, nil ) setElementData(source, "Cavando", false) triggerEvent("TS:giveItem", source, source, Minerios[Random_Minerio], 1) --exports.inventario:givePlayerItem(source, Minerios[Random_Minerio][1]) exports["a_infobox"]:addBox(source, "info", "Você minerou e ganhou: "..Minerios[Random_Minerio][1].."!") if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then setElementData(source, "Recompensa", Recompensa) setElementData(source, "Exp", Xp + getElementData(source, "Recompensa")) end end, 10000, 1) end end end else exports["a_infobox"]:addBox(source, "info", "Você já está garimpando aguarde mais um pouco!") end else exports["a_infobox"]:addBox(source, "error", "Apenas lixeiros podem garimpar aqui!") end end addCommandHandler("cavar", Minerar2) function Mensagem_Aviso2(source) local Emprego = getElementData ( source, "Emprego" ) if Emprego == "Lixeiro" then if getElementData(source, "Cavando") == false then for _, Marker in ipairs( getElementsByType 'marker' ) do if getElementData(Marker, "Marker_Minerar2") == true then if isElementWithinMarker(source, Marker) then exports["a_infobox"]:addBox(source, "info", "Utilize /cavar para que começe a garimpar.") end end end end end end addEventHandler("onMarkerHit", root, Mensagem_Aviso2) edit do meu inventario --[[ =========================================================== # Minha página: https://www.facebook.com/TioSteinScripter/# # ╔════╗╔══╗╔═══╗ ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗ # # ║╔╗╔╗║╚╣─╝║╔═╗║ ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║ # # ╚╝║║╚╝─║║─║║─║║ ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║ # # ──║║───║║─║║─║║ ╚══╗║──║║──║╔══╝─║║─║║╚╗║║ # # ──║║──╔╣─╗║╚═╝║ ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║ # # ──╚╝──╚══╝╚═══╝ ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝ # =========================================================== --]] config = { Painel = { {0, 0, 0, 100}; ---- Cores Painel R,G,B,Alpha {11, 11, 11, 200};---- Cores Painel R,G,B,Alpha {255, 0, 0, 164};---- Cores Painel R,G,B,Alpha {11, 11, 11, 230};---- Cores Painel R,G,B,Alpha {title=" Mochila "}, ----- Titulo do painel {bind="B"}, --- Bind para abrir {morrerperde=false}, ---- Quando morrer resetar inventário true para sim false para não {soltarnocarro=false, enviarnocarro=false, usarnocarro=true}, ---- Soltar, enviar, usar no veiculo {quantidademorrer=30}, ---- Quantidade de vida que o samu cai, evitar bugs }, Pesos = { {kilostotal=150}, ----- Quantidade Maxima de Kilos }, Admin = { {acladmin="Console", commandgive="giveitem", commandtake="takeitem", commandreset="resetinv"}, --- ACL E Comandos de Admin }, Itens = { [1] = {"Hamburguer", 0.2, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [2] = {"Batata", 0.3, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [3] = {"Donuts", 0.4, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [4] = {"Prato Feito", 0.8, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [5] = {"Pizza", 0.6, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [6] = {"Água", 0.8, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [7] = {"Coca-Cola", 1, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [8] = {"Whisky", 1, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [9] = {"Vodka", 1, "Alimento", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [10] = {"Bandete", 1, "Saúde", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [11] = {"Kit de Reparo", 2, "Ferramentas", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [12] = {"Maconha", 0.5, "Intorpecentes", "Ilegal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [13] = {"AK-47", 2, "Arma", "Ilegal", 30, 14}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [14] = {"Munição 762", 0, "Munição", "Ilegal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [15] = {"M4", 2, "Arma", "Legal", 31, 16}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [16] = {"Munição 556", 0, "Munição", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [17] = {"MP5", 2, "Arma", "Legal", 29, 18}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [18] = {"Munição 9mm", 0, "Munição", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [19] = {"TEC-9", 2, "Arma", "Ilegal", 32, 18}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [20] = {"Uzi", 2, "Arma", "Ilegal", 28, 18}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [21] = {"Glock", 2, "Arma", "Legal", 22, 23}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [22] = {"Revolver - 38", 2, "Arma", "Legal", 24, 23}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [23] = {"Munição 45", 0, "Munição", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [24] = {"Faca", 0.3, "Arma", "Legal", 4, 24}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [25] = {"AK-47 VIP", 0.5, "Arma", "Legal", 30, 14}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [26] = {"AWP", 1, "Arma", "Legal", 34, 27}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [27] = {"Munição Sniper", 0, "Munição", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [28] = {"AWP VIP", 1, "Arma", "Legal", 34, 27}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [29] = {"Fall", 0.5, "Arma", "Legal", 30, 14}, --- nome, peso, tipo de objeto, legal ou ilegal, arma, cartucho [30] = {"Colete", 0.8, "Peça", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [31] = {"Dinheiro Sujo", 0, "Intorpecentes", "Ilegal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [32] = {"Galão de Gasolina", 4, "Ferramentas", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [33] = {"LockPick", 5, "Ferramentas", "Ilegal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [34] = {"Lanterna", 5, "Ferramentas", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [35] = {"Plastico", 0.1, "Ferramentas", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [36] = {"Vidro", 0.1, "Ferramentas", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [37] = {"Latinha", 0.1, "Ferramentas", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma [38] = {"Cobre", 0.1, "Ferramentas", "Legal", false}, --- nome, peso, tipo de objeto, legal ou ilegal, arma }, ElementsData = { {elementfome="AirNewSCR_Fome", elementsede="AirNewSCR_Sede"} --- Elements Data }, } CheckWeapons = { [30] = {13}, --- ID Arma, ID Item [31] = {15}, --- ID Arma, ID Item [29] = {17}, --- ID Arma, ID Item [32] = {19}, --- ID Arma, ID Item [28] = {20}, --- ID Arma, ID Item [22] = {21}, --- ID Arma, ID Item [24] = {22}, --- ID Arma, ID Item [4] = {24}, --- ID Arma, ID Item [34] = {26}, --- ID Arma, ID Item } Shops = { Painel = { {0, 0, 0, 100}; ---- Cores Painel R,G,B,Alpha {11, 11, 11, 200};---- Cores Painel R,G,B,Alpha {0, 185, 231, 255};---- Cores Painel R,G,B,Alpha {11, 11, 11, 230};---- Cores Painel R,G,B,Alpha {title="Shop - "}, ----- Titulo do painel {2, 156, 24, 255};---- Cores Painel R,G,B,Alpha {156, 2, 2, 255};---- Cores Painel R,G,B,Alpha }, Lojas = { {1234.543, -1377.071, 13.678 -1, "Alimento", 999}, ----- Posição x, Posição y, Posição z, tipo, blip {393.845, -1919.005, 8.178 -1, "Alimento", 999}, ----- Posição x, Posição y, Posição z, tipo, blip {2117.321, -1735.241, 13.878 -1, "Alimento", 999}, ----- Posição x, Posição y, Posição z, tipo, blip --{-2404.57227, -603.31317, 132.64844 -1, "Utilitários", 17}, ----- Posição x, Posição y, Posição z, tipo, blip --{-2422.03809, -605.34528, 132.56250 -1, "Alimento", 17}, ----- Posição x, Posição y, Posição z, tipo, blip }, ["Alimento"] = { ---- Nome que você colocou no tipo {1, 15}, -- Item ID, Preço {2, 15}, -- Item ID, Preço {3, 15}, -- Item ID, Preço {4, 15}, -- Item ID, Preço {5, 15}, -- Item ID, Preço {6, 15}, -- Item ID, Preço {7, 15}, -- Item ID, Preço {8, 15}, -- Item ID, Preço {9, 15}, -- Item ID, Preço }, ["Municao"] = { ---- Nome que você colocou no tipo {14, 25}, -- Item ID, Preço {16, 25}, -- Item ID, Preço {18, 25}, -- Item ID, Preço {23, 25}, -- Item ID, Preço {27, 0}, -- Item ID, Preço }, ["Armas"] = { ---- Nome que você colocou no tipo {21, 1500}, -- Item ID, Preço {25, 1500}, -- Item ID, Preço {13, 1500}, -- Item ID, Preço {15, 1500}, -- Item ID, Preço {17, 1500}, -- Item ID, Preço {24, 1500}, -- Item ID, Preço {28, 0}, -- Item ID, Preço }, ["Utilitários"] = { ---- Nome que você colocou no tipo {10, 100}, -- Item ID, Preço {11, 100}, -- Item ID, Preço }, ["Corporações"] = { ---- Nome que você colocou no tipo {29, 0}, -- Item ID, Preço {14, 0}, -- Item ID, Preço }, ["Droga"] = { ---- Nome que você colocou no tipo {12, 100}, -- Item ID, Preço }, } podem tentar me ajudar? Por favor
  14. Sim, eu tenho. e estão ligadas. Porém vou tentar com default
  15. Client local pShaders = {} local cor = {} local tec = {} local aba = false local panel = false local tableClothes = {} local nunAction local delay addEvent('rzk:load:tabela', true) addEventHandler('rzk:load:tabela', resourceRoot, function (tabela) if not tableClothes then tableClothes = {} end if tabela then local argument, tableC = descompTable (localPlayer, tabela, typ) if argument then tableClothes = tableC end end end) local function getPlayerClothes(id) for _, value in pairs(tableClothes) do if tonumber(id) == tonumber(value) then return true end end end local function isPlayerClothes(id) if tableClothes and #tableClothes > 0 then if getPlayerClothes(id) then return true end end end local function isShader (player, apply) if pShaders[player] then for _, t in pairs(pShaders[player]) do if t[2] == apply then return true, t[1], t[2], i end end end end function set_custom (player, shader, apply, arg_1, arg_2, typ) if isElement(player) then local search, arg_1, arg_2, i = isShader(apply) if search then print(getPlayerName(player)) engineRemoveShaderFromWorldTexture( arg_1, arg_2, player ) table.remove(pShaders[player], i) end if not pShaders[player] then pShaders[player] = {} end local shad = dxCreateShader('tex_replace.fx', 0, 0, true, 'ped') tex = dxCreateTexture(shader) dxSetShaderValue(shad, 'gTexture', tex) engineApplyShaderToWorldTexture(shad, apply, player) table.insert( pShaders[player], {shad, apply}) end end addEvent('rzk:set:custom:clothes', true) addEventHandler('rzk:set:custom:clothes', resourceRoot, set_custom) local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1920), (screenW/1080) local menu_principal = { {'Camisas'}, {'Camisas de time'}, {'Moleton'}, {'Calças'}, {'Bermudas'}, {'Tênis'}, {'Óculos'}, {'Relógio'}, {'Bandana'}, {'Corrente'}, {'Extras'}, } local camisas = { {'Remover roupa', '0', 0, 0}, {'Camisa Bart Simpson', '350', 7}, {'Camisa Bob Marley', '350', 9}, {'Camisa Caveira SFD', '550', 15}, {'Camisa Duff', '150', 16}, {'Camisa socadão', '550', 17}, {'Camisa Leão Rainbow', '350', 19}, {'Camisa QuikSilver', '150', 21}, {'Camisa Shift', '150', 29}, {'Camisa Preta', '150', 23}, {'Camisa Super Man', '150', 24}, {'Camisa USA', '350', 25}, {'Camisa Volcom', '350', 26}, {'Camisa Bullet Valent', '350', 32}, {'Camisa Alvo', '350', 33}, {'Camisa Cj Amarela', '550', 34}, {'Camisa Anjo', '150', 35}, {'Camisa Sabbat', '550', 36}, {'Camisa Bullet', '350', 37}, {'Camisa Diamond', '150', 38}, {'Camisa Dubfx', '150', 39}, {'Camisa Daniels', '150', 40}, {'Camisa LGBT', '150', 41}, {'Camisa Mão', '350', 42}, {'Camisa Feminista', '350', 43}, {'Camisa Branca', '350', 44}, {'Camisa Monster Branca', '350', 45}, {'Camisa Monster Preta', '550', 46}, {'Camisa Raider 55', '150', 47}, {'Camisa Rockstar', '550', 48}, } local times = { {'Remover roupa', '0', 0, 0}, {'Camisa Brasil', '350', 14}, {'Camisa Real Madrid', '350', 12}, {'Camisa Barcelona', '350', 2}, {'Camisa Boca Junior', '550', 10}, {'Camisa Botafogo', '150', 11}, {'Camisa Corinthians', '550', 30}, {'Moleton Corinthians', '350', 13}, {'Camisa Flamengo', '150', 1}, {'Camisa Fly Emirates', '150',8}, {'Camisa Gremios', '150', 18}, {'Camisa Palmeiras', '150', 20}, {'Camisa São Paulo', '350', 22}, {'Camisa Santos', '350', 31}, } local moleton = { {'Remover roupa', '0', 0, 0}, {'Moleton Caveira SFD', '550', 49}, {'Moleton socadão', '550', 50}, {'Moleton Leão Rainbow', '350', 51}, {'Moleton Preta', '150', 52}, {'Moleton Volcom', '350', 53}, {'Moleton Sabbat', '550', 54}, {'Moleton Bullet', '350', 55}, {'Moleton Dubfx', '150', 56}, {'Moleton Daniels', '150', 57}, {'Moleton Raider 55', '150', 58}, {'Moleton Bandana', '550', 59}, {'Moleton Crips', '550', 60}, {'Moleton Ferrari', '350', 61}, {'Moleton Hollister', '150', 62}, {'Moleton Hollister Preta', '350', 63}, {'Moleton Jungle', '550', 64}, {'Moleton Meme', '350', 65}, {'Moleton Nike', '150', 66}, {'Moleton Puma', '150', 67}, {'Moleton Puma Branco', '150', 68}, } local calcas = { {'Remover roupa', '0', 0, 2}, {'Calça Adidas Branca', '550', 69}, {'Calça Adidas Verde', '550', 70}, {'Calça Adidas Preta', '150', 71}, {'Calça Adidas', '350', 72}, {'Calça Adidas Laranja', '550', 73}, {'Calça Adidas Vermelha', '350', 74}, {'Calça Jeans', '150', 75}, {'Calça Jeans 2', '150', 76}, {'Calça Jeans 3', '150', 77}, {'Calça Jeans 4', '550', 79}, {'Calça Jeans 5', '550', 79}, {'Calça Jeans 6', '350', 80}, {'Calça Jeans 7', '150', 81}, {'Calça Jeans 8', '350', 82}, {'Calça Jeans 9', '550', 83}, {'Calça Jeans 10', '350', 84}, } local bermudas = { {'Remover roupa', '0', 0, 2}, {'Bermuda Branca', '550', 6}, {'Bermuda Cyclone', '550', 85}, {'Bermuda Cyclone', '150', 86}, {'Bermuda Element', '350', 87}, {'Bermuda Oakley', '550', 88}, {'Bermuda Iridescent Pants', '350', 89}, {'Bermuda Quik Azul', '150', 90}, {'Bermuda Quik Laranja', '150', 91}, {'Bermuda Quik Preta', '150', 92}, {'Bermuda Chicago Boll', '550', 93}, {'Bermuda USA', '550', 94}, } local tenis = { {'Remover roupa', '0', 0, 3}, {'Tênis Bask Prl', '100', 98}, {'Tênis Bask Pjs', '100', 99}, {'Tênis Bask PJL', '100', 100}, {'Tênis Bask NK', '100', 101}, {'Tênis Bask MZ', '100', 102}, {'Tênis CONV KL', '100', 103}, {'Tênis CONV LK', '100', 104}, {'Tênis CONV IPO', '100', 105}, {'Tênis RAIDER', '100', 106}, {'Tênis RAIDER 55', '100', 107}, {'Tênis RAIDER JS', '100', 108}, {'Tênis RAIDER 99', '100', 109}, {'Tênis RAIDER LJK', '100', 110}, {'Tênis RAIDER BB', '100', 111}, {'Tênis RAIDER DZ7', '100', 112}, {'Tênis RAIDER JKS', '100', 113}, {'Tênis RAIDER PO', '100', 114}, {'Tênis RAIDER RIC', '100', 115}, {'Tênis FENIX GW', '100', 116}, {'Tênis FENIX PP', '100', 117}, {'Tênis FENIX KSA', '100', 118}, } local relogio = { {'Remover roupa', '0', 0, 14}, {'Relógio Rosa', '100', 119}, {'Relógio Amarelo', '100', 120}, {'Relógio Pro', '100', 121}, {'Relógio Pro 2', '100', 122}, {'Relógio Sub', '100', 123}, {'Relógio Sub 2', '100', 124}, {'Relógio Zip', '100', 125}, {'Relógio Zip 2', '100', 126}, {'Relógio Gno', '100', 127}, {'Relógio Gno 2', '100', 128}, {'Relógio Cro', '100', 129}, {'Relógio Cro 2', '100', 130}, } local oculos = { {'Remover roupa', '0', 0, 15}, {'Óculos 01', '100', 131}, {'Óculos 02', '100', 132}, {'Óculos 03', '100', 133}, {'Óculos 04', '100', 134}, {'Óculos 05', '100', 135}, {'Óculos 06', '100', 136}, {'Óculos 07', '100', 137}, {'Óculos 08', '100', 138}, {'Óculos 09', '100', 139}, {'Óculos 10', '100', 140}, } local bandana = { {'Remover roupa', '0', 0, 15}, {'Bandana Vermelha', '100', 141}, {'Bandana Azul', '100', 142}, {'Bandana Verde', '100', 143}, {'Bandana Preta', '100', 144}, } local corrente = { {'Remover roupa', '0', 0, 13}, {'Corrente Militar', '100', 145}, {'Corrente Africa', '100', 146}, {'Corrente Relógio', '100', 147}, {'Corrente Saints', '100', 148}, {'Corrente Hash', '100', 149}, {'Corrente Silver', '100', 150}, {'Corrente Gold', '100', 151}, {'Corrente Opes', '100', 152}, {'Corrente Peg', '100', 153}, {'Corrente Kls', '100', 154}, {'Corrente Doller', '100', 155}, {'Corrente Cross', '100', 156}, } local extras = { {'Remover roupa', '0', 0, 16}, {'Touca Cinza', '100', 161}, {'Boné Caminhoneiro', '100', 162}, {'Chapéu Cowboy', '100', 163}, {'Chapéu Cowboy 2', '100', 164}, {'Boné Verde', '100', 165}, {'Boné Verde p/Trás', '100', 166}, {'Boné Vermelho', '100', 167}, {'Boné Vermelho p/Trás', '100', 168}, {'Boné Azul', '100', 169}, {'Boné Azul p/Trás', '100', 170}, {'Boné Zip', '100', 173}, {'Boné Zip p/Trás', '100', 174}, {'Boné Preto', '100', 175}, {'Boné Preto p/Trás', '100', 176}, {'Touca Preta', '100', 181}, {'Chapéu Bucket Preta', '100', 171}, {'Chapéu Bucket Xadrez', '100', 172}, {'Chapéu 01', '100', 177}, {'Chapéu 02', '100', 178}, {'Chapéu 03', '100', 179}, } local font = exports.Fonts:getFont("f5") local font_1 = exports.Fonts:getFont("f3") local font_2 = exports.Fonts:getFont("f1") function rzk_clothes () local v = nil dxDrawRectangle(x*22, y*121, x*328, y*106, tocolor(0, 175, 255, 255), false) dxDrawText("Loja de Roupas", x*21, y*142, x*350, y*227, tocolor(255, 255, 255, 255), x*1.20, font_1, "center", "center", false, false, false, false, false) dxDrawRectangle(x*22, y*226, x*328, y*38, tocolor(1, 0, 0, 200), false) dxDrawText(menu, x*40, y*426, x*350, y*62, tocolor(255, 254, 254, 170), x*1.10, "default-bold", "left", "center", false, false, false, false, false) dxDrawText("("..nunAction.."/"..(#tabela or 0)..")", x*295, y*426, x*350, y*62, tocolor(255, 254, 254, 170), x*1.00, "default-bold", "center", "center", false, false, false, false, false) local elem = 0 for i = 1, #tabela do if #tabela ~= 0 then if valor then if (i >= nunAction and elem < 12) then elem = elem + 1 v = tabela[i] tec[i] = tocolor(255, 254, 254, 219) cor[i] = tocolor(1, 0, 0, 164) if nunAction > 0 then cor[nunAction] = tocolor(255, 255, 255, 255) tec[nunAction] = tocolor(0, 0, 0, 219) end dxDrawRectangle(x*22, screenW-(855-(elem*38))*y, x*328, y*38, cor[i], false) dxDrawText(v[1], x*40, screenW-(695-(elem*76))*y, x*350, y*100, tec[i], x*0.60, font_1, "left", "center", false, false, false, false, false) if valor then if v[2] and tonumber(v[2]) > 0 then if isPlayerClothes(tonumber(v[3])) then dxDrawText('USAR', x*255, screenW-(695-(elem*76))*y, x*340, y*100, tec[i], x*0.50, font_2, "right", "center", false, false, false, false, false) else dxDrawText('R$ '..v[2], x*255, screenW-(695-(elem*76))*y, x*340, y*100, tec[i], x*0.50, font_2, "right", "center", false, false, false, false, false) end else dxDrawText('GRÁTIS', x*255, screenW-(695-(elem*76))*y, x*340, y*100, tec[i], x*0.50, font_2, "right", "center", false, false, false, false, false) end end end else if nunAction <= 12 then v = tabela[i] tec[i] = tocolor(255, 254, 254, 219) cor[i] = tocolor(1, 0, 0, 164) if nunAction > 0 then cor[nunAction] = tocolor(255, 255, 255, 255) tec[nunAction] = tocolor(0, 0, 0, 219) end dxDrawRectangle(x*22, screenW-(855-(i*38))*y, x*328, y*38, cor[i], false) dxDrawText(v[1], x*40, screenW-(695-(i*76))*y, x*350, y*100, tec[i], x*0.60, font_1, "left", "center", false, false, false, false, false) end end end end if not valor then if #tabela <= 12 then dxDrawRectangle(x*22, screenW-(855-((#tabela + 1)*38))*y, x*328, y*38, tocolor(1, 0, 0, 191), false) dxDrawText("---", x*22, screenW-(745-((#tabela + 1)*76))*y, x*350, y*139, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) else dxDrawRectangle(x*22, screenW-(855-((12 + 1)*38))*y, x*328, y*38, tocolor(1, 0, 0, 191), false) dxDrawText("---", x*22, screenW-(745-((12 + 1)*76))*y, x*350, y*139, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) end end end addEvent('rzk:open:clothes', true) addEventHandler('rzk:open:clothes', resourceRoot, function (states) if states then if not panel then addEventHandler("onClientRender", root, rzk_clothes) menu = 'LOJA DE ROUPA' tabela = menu_principal nunAction = 1 unbindKey('arrow_d', 'down', up) unbindKey('arrow_u', 'down', down) bindKey('arrow_d', 'down', up) bindKey('arrow_u', 'down', down) bindKey('enter', 'down', enter) bindKey('backspace', 'down', back) aba = false valor = false panel = true end else if panel then removeEventHandler("onClientRender", root, rzk_clothes) menu = nil tabela = nil nunAction = nil unbindKey('arrow_d', 'down', up) unbindKey('arrow_u', 'down', down) unbindKey('enter', 'down', enter) unbindKey('backspace', 'down', back) panel = false triggerServerEvent('rzk:original:clothes', resourceRoot, localPlayer) end end end) addEventHandler( "onClientKey", root, function(button,press) if panel then if button == "arrow_d" or button == "arrow_u" then toggleAllControls(false) else toggleAllControls(true) end end end) function up () if nunAction >= 0 and nunAction < tonumber(#tabela) then nunAction = nunAction + 1 if aba then if menu == 'EXTRAS' or menu == 'ÓCULOS' or menu == 'RELÓGIO' or menu == 'BANDANA' or menu == 'CORRENTE' then local Texture, Model, Typ = getNameIdShader(tabela[nunAction][3]) addPedClothes(localPlayer, Texture, Model, Typ) else local name, skinid, argument_1, argument_2, typ = getNameIdShader(tabela[nunAction][3]) addPedClothes(localPlayer, argument_1, argument_2, typ) set_custom (localPlayer, name, skinid, argument_1, argument_2, typ) end end end -- end end function enter () if nunAction then if not aba then aba = nunAction if nunAction == 1 then nunAction = 1 tabela = camisas valor = true menu = 'CAMISAS' end if nunAction == 2 then nunAction = 1 tabela = times valor = true menu = 'CAMISAS DE TIMES' end if nunAction == 3 then nunAction = 1 tabela = moleton valor = true menu = 'MOLETONS' end if nunAction == 4 then nunAction = 1 tabela = calcas valor = true menu = 'CALÇAS' end if nunAction == 5 then nunAction = 1 tabela = bermudas valor = true menu = 'BERMUDAS' end if nunAction == 6 then nunAction = 1 tabela = tenis valor = true menu = 'TÊNIS' end if nunAction == 7 then nunAction = 1 tabela = oculos valor = true menu = 'ÓCULOS' end if nunAction == 8 then nunAction = 1 tabela = relogio valor = true menu = 'RELÓGIO' end if nunAction == 9 then nunAction = 1 tabela = bandana valor = true menu = 'BANDANA' end if nunAction == 10 then nunAction = 1 tabela = corrente valor = true menu = 'CORRENTE' end if nunAction == 11 then nunAction = 1 tabela = extras valor = true menu = 'EXTRAS' end else if not isTimer(delay) then local shaderID = tonumber(tabela[nunAction][3]) if (shaderID ~= 0) then if not isPlayerClothes(shaderID) then if shaderID >= 119 and shaderID <= 182 then table.insert(tableClothes, shaderID) local _, _, typ = getNameIdShader(tabela[nunAction][3]) triggerServerEvent('rzk:set:player:skin', resourceRoot, localPlayer, tabela[nunAction][2], shaderID, typ, tableClothes, true) else table.insert(tableClothes, shaderID) local name, skinid, argument_1, argument_2, typ = getNameIdShader(tabela[nunAction][3]) triggerServerEvent('rzk:set:player:skin', resourceRoot, localPlayer, tabela[nunAction][2], shaderID, typ, tableClothes, true) end else local name, skinid, argument_1, argument_2, typ = getNameIdShader(tabela[nunAction][3]) triggerServerEvent('rzk:set:player:skin', resourceRoot, localPlayer, tabela[nunAction][2], shaderID, typ, tableClothes, false) end else removePedClothes (localPlayer, tabela[nunAction][4]) end delay = setTimer(function() end, 5000, 1) else exports.Infos:serverNotification("info", "Aguarde alguns segundos para realizar uma nova ação.", 10, 5) end end end end function back () if nunAction then if not aba and panel then removeEventHandler("onClientRender", root, rzk_clothes) tabela = nil unbindKey('pgdn', 'down', up) unbindKey('pgup', 'down', down) unbindKey('enter', 'down', enter) unbindKey('backspace', 'down', back) panel = false else nunAction = 1 tabela = menu_principal menu = 'LOJA DE ROUPA' aba = false valor = false triggerServerEvent('rzk:original:clothes', resourceRoot, localPlayer) end end end function down () -- if tabela then if nunAction > 1 then nunAction = nunAction - 1 if aba then if menu == 'EXTRAS' or menu == 'ÓCULOS' or menu == 'RELÓGIO' or menu == 'BANDANA' or menu == 'CORRENTE' then local Texture, Model, Typ = getNameIdShader(tabela[nunAction][3]) addPedClothes(localPlayer, Texture, Model, Typ) else if tabela[nunAction][3] ~= 0 then local name, skinid, argument_1, argument_2, typ = getNameIdShader(tabela[nunAction][3]) addPedClothes(localPlayer, argument_1, argument_2, typ) set_custom (localPlayer, name, skinid, argument_1, argument_2, typ) end end end end -- end end local x,y = guiGetScreenSize() function isCursorOnElement(x,y,w,h) if isCursorShowing () then local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end end addEventHandler('onClientResourceStart', resourceRoot, function () if getElementData(localPlayer, 'logado') then setPlayerShaderClint() triggerServerEvent('rzk:get:tabela:all', resourceRoot, localPlayer) end end) addEvent('rzk:load:clothes:login:player', true) addEventHandler('rzk:load:clothes:login:player', resourceRoot, function (typ, player) if typ == 1 then if getElementData(localPlayer, 'logado') then setPlayerShaderClint() end else local allShadersString = getElementData(player, "rzk:player:clothes") if allShadersString then local argument, getc = descompTable(player, allShadersString) if argument then setShaderDescomp(player, getc) end end end end) function engineShader (states) if states == true then local player = nil for i = 1, #getElementsByType("player") do player = getElementsByType("player")[i] triggerEvent('rzk:load:clothes:login:player', resourceRoot, 1, player) end elseif states == false then local player = nil for i = 1, #getElementsByType("player") do player = getElementsByType("player")[i] if getElementData(player, 'logado') then local allShadersString = getElementData(player, "rzk:player:clothes") if allShadersString then local argument, getc = descompTable(player, allShadersString) local value = nil for i = 1, #getc do value = getc[i] local id = tonumber(value) local name, skinid, argument_1, argument_2, typ = getNameIdShader(id) if id >= 119 and id <= 182 then else local shad = dxCreateShader('tex_replace.fx', 0, 0, true, 'ped') engineRemoveShaderFromWorldTexture( shad, name, player ) end end end end end end end function descompTable (thePlayer, tabela, typ) local allShadersString = tabela local myclthes = split(allShadersString, 44) local getclothes = {} for i=0, 17, 1 do if myclthes[i+1] then table.insert(getclothes, myclthes[i+1]) end end return true, getclothes, allShadersString end function setPlayerShaderClint() local players = getElementsByType("player") local player = nil for i = 1, #players do player = players[i] local allShadersString = getElementData(player, "rzk:player:clothes") if allShadersString then local argument, getc = descompTable(player, allShadersString) if argument then setShaderDescomp(player, getc) end end end end function setShaderDescomp(player, getc) local value = nil for i = 1, #getc do value = getc[i] local id = tonumber(value) if id >= 119 and id <= 182 then local Texture, Model, typ = getNameIdShader(id) triggerServerEvent('rzk:set:app:clothes', resourceRoot, player, Texture, Model, typ) else local name, skinid, argument_1, argument_2, typ = getNameIdShader(id) if skinid then addPedClothes(player, argument_1, argument_2, typ) set_custom(player, name, skinid, argument_1, argument_2, typ) end end end end Client da pastade onde ele exporta as fontes. function getFont (font) if font == "f1" then return dxCreateFont('fonts/font_1.ttf', 20) or 'default' elseif font == "f2" then return dxCreateFont('fonts/font_2.ttf', 80) or 'default' elseif font == "f3" then return dxCreateFont('fonts/font_3.ttf', 20) or 'default' elseif font == "f4" then return dxCreateFont('fonts/font_4.ttf', 20) or 'default' elseif font == "f5" then return dxCreateFont('fonts/font_5.ttf', 20) or 'default' elseif font == "f6" then return dxCreateFont('fonts/font_6.otf', 20) or 'default' elseif font == "f7" then return dxCreateFont('fonts/font_7.otf', 20) or 'default' elseif font == "f8" then return dxCreateFont('fonts/font_8.otf', 20) or 'default' elseif font == "f9" then return dxCreateFont('fonts/font_9.otf', 20) or 'default' end end A pasta que o client side da loja tenta exportar está como "Fonts" eu não mudei, porém não aparece, não consigo resolver, me ajude pfv!!
×
×
  • Create New...