-
Posts
905 -
Joined
-
Last visited
Everything posted by TwiX!
-
yea i know that -__- but like i said when i use his script other people see when i enabled godmode so i do /godmode and other 40 players see that i activated godmode but it doesnt show like HuX has enabled GodMode! it shows like GodMode is Enabled! i dont want that players see on chat when i use /godmode command See on wiki outputChatBox to get hex codes learn scripting no one will not make it for you * Then you quit, your element data will removed
-
Действительно, простое и понятное объяснение, спасибо Скрипт уже переделал обращайся)
-
/start freeroam press f1 or download it from community https://community.multitheftauto.com/index.php?p= ... ails&id=43
-
1.You bought scripts with no-open code 2.Need pay for open code(This was said in the transaction) 3.Contact me : skype sane4ek73 4.I have all the logs don't try to lie to me
-
https://wiki.multitheftauto.com/wiki/OutputChatBox Server bool outputChatBox ( string text [, element visibleTo=getRootElement(), int r=231, int g=217, int b=176, [b]bool colorCoded=false[/b] ] ) Same client bool outputChatBox ( string text [, int r=231, int g=217, int b=176, [b]bool colorCoded=false[/b] ] ) Set to true
-
mapInfo.name Will work only with onMapStarting or onClientMapStarting Events addEvent ( "onMapStarting" ) addEventHandler ( "onMapStarting", root, function ( mapInfo, mapOptions, gameOptions ) cMap = nil if ( ismapDM ( mapInfo.name ) == 1 ) then cMap = 1; elseif ( ismapDM ( mapInfo.name ) == 2 ) then cMap = 2; elseif ( ismapDM ( mapInfo.name ) == 3 ) then cMap = 3; end end ) function ismapDM ( mapName ) if string.find ( mapName, "[DM]", 1, true ) then return 1 elseif string.find ( mapName, "[DD]", 1, true ) then return 2 elseif string.find ( mapName, "[FUN]", 1, true ) then return 3 end end addEvent("onClientRequestRespawn", true) addEventHandler("onClientRequestRespawn", getRootElement(), function(mapInfo, mapOptions, gameOptions,vehicleData) outputChatBox ( "Map info: ".. mapInfo ) outputChatBox ( "Map name: ".. mapInfo.name ) if ( cMap == 1 ) then -- source is the player that requested respawn. -- spawn at the position where last saved. triggerClientEvent(source, 'onClientCall_race', source, "Spectate.stop", 'manual') triggerEvent('onClientRequestSpectate', source, false) spawnPlayer(source, vehicleData.posX, vehicleData.posY, vehicleData.posZ) local vehicle = exports.race:getPlayerVehicle(source) warpPedIntoVehicle(source, vehicle) triggerClientEvent(source, 'onClientCall_race', source, "Spectate.stop", 'manual') setElementData(source, "race.spectating", true) setElementData(source, "status1", "dead") setElementData(source, "status2", "") --setElementData(source, "state", "training") setElementData(source, "race.finished", true) setCameraTarget(source, source) setElementData(vehicle, "race.collideworld", 1) setElementData(vehicle, "race.collideothers", 0) setElementData(source, "race.alpha", 255) setElementData(vehicle, "race.alpha", 255) setElementHealth(vehicle, vehicleData.health) setElementModel(vehicle, 481) -- fix motor sound. setElementModel(vehicle, tonumber(vehicleData.model)) setElementPosition(vehicle, vehicleData.posX, vehicleData.posY, vehicleData.posZ) setElementRotation(vehicle, vehicleData.rotX, vehicleData.rotY, vehicleData.rotZ) if(vehicleData.nitro ~= nil)then addVehicleUpgrade(vehicle, tonumber(vehicleData.nitro)) end setElementFrozen(vehicle, true) toggleAllControls(source, true) setVehicleLandingGearDown(vehicle, true) setTimer(delayedRespawn, 2000, 1, source, vehicle, vehicleData) elseif ( cMap == 2 ) then cancelEvent() elseif ( cMap == 3 ) then cancelEvent() end end )
-
во 1 у тебя будет ошибка, т.к ты пропустил end в raceWin во 2 смотри каждую секунду в твой дом прибегают 10 или 20 человек, которых ты не знаешь, ты например выгоняешь их, и через секунду они опять приходят и так бесконечно. в3 опять же 10 или 20 человек приходят тебе в дом, и ты их впускаешь и кормишь их, получается что ты кормишь их каждую секунду не проще ли сделать это 1 раз и выгнать людей тоже 1 раз? в4 всем этим игрокам ты присваиваешь дату, то есть это 20 запросов в базу данных sql каждую секунду представь например у тебя там за 2 месяца акков 1500 накопилось, на них есть эти данные, то есть sql запрос ищет в этой таблице игрока, берёт данные, записывает, зачем тебе этот геморой? если можно сделать только ОДНОМУ игроку, который финишировал
-
этот код просто убьёт твой сервер, когда будет игроков 10
-
dxDrawColorText not needed anymore
-
Thats that you use my panel function giveMoneyWinDie ( ) local account = getPlayerAccount ( source ); local playersAlive = getAliveGuys ( 2 ); local playersDead = getDeadGuys ( ); local pAll = playersAlive + playersDead; local checkYourPos = pAll - playersDead; local pos = nil; if tonumber ( checkYourPos ) == 1 then pos = 1 else pos = checkYourPos + 1; end if tonumber ( checkYourPos ) == 2 then pos = 2; end if pos == 1 or pos == 21 or pos == 31 then posName = "st"; elseif pos == 2 or pos == 22 or pos == 32 then posName = "nd"; elseif pos == 3 or pos == 23 or pos == 33 then posName = "rd"; else posName = "th"; end if not getElementData ( source, "gotMoney" ) then local money = math.ceil ( getPlayerCount ( ) * 50 / pos ); givePlayerMoney ( source, money ); outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true ); for _, player_ in ipairs ( getElementsByType ( "player" ) ) do exports["Evo-notificaciones"]:showBox ( player_, "info", getPlayerName ( player_ ) .. " #fffffftermino #abcdef[#ff0000" .. pos .. posName .. "#abcdef] #ffffffy gano #00ff00$" .. money .. "!" ); end setElementData ( source, "gotMoney", true ); if account then setAccountData (account, "money", tostring ( getPlayerMoney ( source ) ) ); end end end addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie ) For color codes: Open Evo-notificaciones Open box_c.lua replace dxDrawText on: dxDrawText (tipBox.string,textX,textY,textX+textWidth,textY+textHeight,tocolor(222,222,222),1,"default-bold","center","center",false,true,true,true)
-
root = getRootElement() function chat (msg , msgty,player) money = getPlayerMoney(source) a = money < 200 if msg and a then cancelEvent() outputChatBox(" You Dont Have 200$ To Chatting",player,255,0,0) else take = 200 a = money >= 200 if msg and a then takePlayerMoney(source,take) end end end addEventHandler ("onPlayerChat",root,chat) root = getRootElement() why? it's not needed anymore function chat (msg , msgty,player) What is player? onPlayerChat Event don't have this argument function chat ( msg , msgty ) local money = getPlayerMoney ( source ); if msg and tonumber ( money ) < 200 then cancelEvent() outputChatBox ( " You Don't Have 200$ To Chatting ", source, 255, 0, 0 ); else if msg and tonumber ( money ) >= 200 then takePlayerMoney ( source, 200 ); end end end addEventHandler ( "onPlayerChat", root, chat ) will better.. I think that this resource is not needed
-
chane callClientFunction("HideLoginGUI", Player) to callClientFunction ( Player, "HideLoginGUI" )
-
you need put only folderName or zipName
-
what is your resource name? my resource name is EXAMPLE so "resource.EXAMPLE">
-
first, you can ask Nextreme ( for use his panel ) second,
-
Спасибо. код не правильный щас edit -- обновил
-
addEventHandler ( 'onGamemodeMapStart', root, function ( mapres ) getMapDuration ( mapres ); end ) function getMapDuration ( mRes ) local meta = xmlLoadFile ( ':' .. getResourceName ( mRes ) .. '/' .. 'meta.xml' ); local mapnode = xmlFindChild ( meta, 'settings', 0 ); if mapnode then for i = 1,14 do -- Обычно 14 штук их.. local mapnode = xmlFindChild ( mapnode, 'setting', i ); local filename = mapnode and xmlNodeGetAttribute ( mapnode, 'name' ); if filename == "#duration" then local result = mapnode and xmlNodeGetAttribute ( mapnode, 'value' ); outputChatBox ( timeToString ( getNumberFromText ( result ) ) ); end end return false end return false end function timeToString ( seconds ) local miliseconds = seconds * 60 * 1000; --local seconds = math.floor ( miliseconds / 1000 ); local minutes = math.floor( seconds / 60 ); miliseconds = miliseconds - ( seconds * 1000 ); seconds = seconds - ( minutes * 60 ); if seconds < 10 then seconds = "0" .. seconds; end if miliseconds < 100 then miliseconds = "0" .. miliseconds; elseif miliseconds < 10 then miliseconds = "00" .. miliseconds; end return minutes .. ":" .. seconds .. ":" .. string.sub ( tostring ( miliseconds ) , 0, 3 ); end --Ty Flaker function getNumberFromText ( rText ) rText = tostring ( rText ); local s = string.gsub ( rText, '[[-|]', ' ' ); return tonumber ( s ); end
-
local Window = guiCreateWindow(0, 0, 0.5, 0.4, "Information", true) guiSetVisible(Window, false) local tabPanel = guiCreateTabPanel(0, 0.1, 1, 1, true, Window) local tabMap = guiCreateTab("Map Information", tabPanel) local tabHelp = guiCreateTab("Help", tabPanel) local image = guiCreateStaticImage(0, 0, 1, 1, "bg.png", true, Window) guiCreateLabel(0.02,0.04,0.94,0.2,"This is information about the current map",true,tabMap) guiCreateLabel(0.02,0.04,0.94,0.92,"This is help text.",true,tabHelp) bindKey("F1", "down", function() guiSetVisible(Window, not guiGetVisible(Window)) showCursor(guiGetVisible(Window)) end)
-
you can add it by yourself.. will add in next version
-
put your code here
-
CLIENT-SIDE If you want all server-side use onResourceStart addEventHandler ( "onClientResourceStart", getRootElement(getThisResource()), function( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do if getPlayerTeam(player) ~= nil then local r, g, b = getTeamColor(getPlayerTeam(player)) createBlipAttachedTo ( player, 0, 2, r,g,b ) else if ( players[player] ) then createBlipAttachedTo ( player, 0, 2, players[player][1], players[player][2], players[player][3] ) else createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] ) end end end end ) SERVER-SIDE addEventHandler ( "onPlayerSpawn",getRootElement(), function( spawnpoint ) if getPlayerTeam(source) ~= nil then local r, g, b = getTeamColor(getPlayerTeam(source)) createBlipAttachedTo ( source, 0, 2, r,g,b ) else if ( players[source] ) then createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] ) else createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] ) end end end ) playerTimer = {} addEventHandler('onResourceStart', resourceRoot, function() for i, v in ipairs(getElementsByType('player')) do playerTimer[v] = setTimer(updatePlayerBlip, 50, 0) end end ) addEventHandler('onPlayerSpawn', root, function() playerTimer[source] = setTimer(updatePlayerBlip, 50, 0, source) end ) function getPlayerBlip(src) if src then local attached = getAttachedElements ( src ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then return element end end end end end function updatePlayerBlip(src) if src then if not isPedDead(src) then if getPlayerBlip(src) then local r, g, b = getPlayerNametagColor(src) setBlipColor(getPlayerBlip(src), r, g, b, 255) end end end end addEventHandler('onPlayerQuit', root, function() if isTimer(playerTimer[source]) then killTimer(playerTimer[source]) end end ) addEventHandler('onPlayerWasted', root, function() if isTimer(playerTimer[source]) then killTimer(playerTimer[source]) end end )
-
Your resource(code) on 1 server local serverIP = "127.0.0.1:22005" -- Server ip [ Need HTTP Port (Not mta) ] function callBack (remote,code) if not code then return end outputDebugString( remote.." "..code ); end function aMap(player) local accName = getAccountName ( getPlayerAccount ( player ) ); if isObjectInACLGroup ( "user." .. tostring( accName ), aclGetGroup( "Admin" ) ) then local mapName = getResourceInfo ( exports.mapmanager:getRunningGamemodeMap(), "name" ); if mapName then callRemote ( serverIP, getResourceName ( getThisResource() ), "gotResult", callBack, 1, mapName ); end else outputChatBox("* You need #ff0000Admin #ffffffRights!",player,255,255,255,true) end end addCommandHandler("accepted",aMap) function dMap(player) local accName = getAccountName ( getPlayerAccount ( player ) ); if isObjectInACLGroup ( "user." .. tostring( accName ), aclGetGroup( "Admin" ) ) then local mapName = getResourceInfo ( exports.mapmanager:getRunningGamemodeMap(), "name" ); if mapName then callRemote ( serverIP, getResourceName ( getThisResource() ), "gotResult", callBack, 2, mapName ); end else outputChatBox("* You need #ff0000Admin #ffffffRights!",player,255,255,255,true) end end addCommandHandler("declined",dMap) Other server function gotResult (mode,mapName) if mode == 1 then outputChatBox ( "[TESTING RESULTS]", getRootElement(), 255, 255, 255, true ); outputChatBox ( "Map #ff0000'#ffffff" ..mapName.. "#ff0000'#ffffff was #00ff00accepted", getRootElement(), 255, 255, 255, true ); outputChatBox ( "[TESTING RESULTS]", getRootElement(), 255, 255, 255, true ); else outputChatBox ( "[TESTING RESULTS]", getRootElement(), 255, 255, 255, true ); outputChatBox ( "Map #ff0000'#ffffff" ..mapName.. "#ff0000'#ffffff was #ff0000declined", getRootElement(), 255, 255, 255, true ); outputChatBox ( "[TESTING RESULTS]", getRootElement(), 255, 255, 255, true ); end end meta.xml <export function="gotResult" http="true" /> This resource is SERVER-SIDE and need Admin Rights for 'callRemote'