Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Странно, я туда добавил аккаунт, открыл через SQLBrowser, там пусто. Ну да ладно. Почему компилятор не компилирует скрипты в кодировке отличной от ANSI ? Ничего если мой клиентский скрипт скомпилируется не в UTF-8, а имеено в ANSI? Перекодируй просто
  2. Kenix

    Help help

    You can write what is not work?
  3. So i need check if all players in team Survivors in marker but it not work debug says nothing . teamSurvivor = createTeam ( "Survivors", 0, 255, 0 ) setTeamFriendlyFire(teamSurvivor, false ) addEventHandler("onGamemodeMapStart", root, function( startedMap ) local Spawnpoint = getElementsByType ("spawnpoint") local random = math.random ( 1, #Spawnpoint ) local posX = getElementData(Spawnpoint[random], "posX") local posY = getElementData(Spawnpoint[random], "posY") local posZ = getElementData(Spawnpoint[random], "posZ") local rot = getElementData(Spawnpoint[random], "rot") or getElementData(Spawnpoint[random], "rotZ") or 0 for i,v in ipairs(getElementsByType("player"))do if not (getElementData(v,"Status") == "Joined") then setElementData( v,"showHud","y") setElementData( v,"Status","Playing") spawnPlayer ( v, posX, posY, posZ, rot, getElementData(v,"skin") ) setCameraTarget( v ) setPlayerTeam( v,teamSurvivor) setAllData( v,"showZombieWon","n") setAllData( v,"showSurvivorsWonPassing","n") dropStats( v ) end end local allPlayersInMarker = false local lastmarker = nil local marker = nil local mapRoot = getResourceRootElement(startedMap) local Final_Marker = getElementsByType ("Final_marker",mapRoot) for i,v in ipairs(Final_Marker) do local r,g,b,a = getColorFromString ( tostring(getElementData( v,"color")) ) marker = createMarker( tonumber(getElementData(v,"posX")), tonumber(getElementData(v,"posY")), tonumber(getElementData(v,"posZ")), "cylinder", tonumber(getElementData(v,"size")), r, g, b, a ) lastmarker = v end addEventHandler("onMarkerHit",root, function( player, dim ) if isTimer( CheckPlayersInMarker ) then killTimer( CheckPlayersInMarker ) end CheckPlayersInMarker = setTimer( function ( player,marker,source,lastmarker ) if isElement( player ) and getElementType( player ) == "player" then if source ~= marker then return end for i,v in pairs( getPlayersInTeam( getTeamFromName ( "Survivors" ) ) ) do if isElementWithinMarker ( v, marker ) then -- all players in marker destroyElement( source ) Endgame(true) --------- achievement --------------- setElementData( v,"achm3","y") end end end end,1000,0,player,marker,source,lastmarker ) end ) end ) Help guys
  4. you can write filename( script for replace cars ) and use /debugscript 3 Oh i found problem: Try it function replaceModel() txd1 = engineLoadTXD("vehicles/data/tahoma.txd") engineImportTXD(txd1, 566) dff1 = engineLoadDFF("vehicles/data/tahoma.dff", 566 ) engineReplaceModel(dff1, 566) txd2 = engineLoadTXD("vehicles/data/linerun.txd") engineImportTXD(txd2, 403) dff2 = engineLoadDFF("vehicles/data/linerun.dff", 403 ) engineReplaceModel(dff2, 403) end addEventHandler ( "onClientResourceStart", resourceRoot , replaceModel) read wiki please : https://wiki.multitheftauto.com/wiki/EngineLoadTXD
  5. Edit: function replaceModel() txd1 = engineLoadTXD("data/tahoma.txd", 566 ) engineImportTXD(txd1, 566) dff1 = engineLoadDFF("data/tahoma.dff", 566 ) engineReplaceModel(dff1, 566) txd2 = engineLoadTXD("data/linerun.txd", 403 ) engineImportTXD(txd2, 403) dff2 = engineLoadDFF("data/linerun.dff", 403 ) engineReplaceModel(dff2, 403) -- and your folders incorrect --[[ you have in meta.xml file path is <file src="vehicles/data/tahoma.txd" /> <file src="vehicles/data/tahoma.dff" /> <file src="vehicles/data/linerun.txd" /> <file src="vehicles/data/linerun.dff" /> remember it .]] end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceCar) -- you call functiom replaceCar() but you don't have this function Correct function replaceModel() txd1 = engineLoadTXD("vehicles/data/tahoma.txd", 566 ) engineImportTXD(txd1, 566) dff1 = engineLoadDFF("vehicles/data/tahoma.dff", 566 ) engineReplaceModel(dff1, 566) txd2 = engineLoadTXD("vehicles/data/linerun.txd", 403 ) engineImportTXD(txd2, 403) dff2 = engineLoadDFF("vehicles/data/linerun.dff", 403 ) engineReplaceModel(dff2, 403) end addEventHandler ( "onClientResourceStart", resourceRoot , replaceModel) and you can use variable resourceRoot instead of getResourceRootElement(getThisResource())
  6. Читай https://wiki.multitheftauto.com/wiki/OnVehicleDamage ...
  7. SweetyWolf, Для сохранения аккаунтов и т.п лучше сохранять в SQLite или на отдельном MySQL сервере. Сохранение на xml лучше не юзать для таких вещей ... DakiLLa прав однозначно.
  8. Kenix

    Question

    Thx all for help!
  9. Kenix

    Question

    Read my post better function getMaxData( data ) local name = "" for i,v in pairs( getElementsByType("player") ) do local count = getElementData(v,data) if v == math.max( count ) then name = getPlayerName( v ) end end return name end
  10. Kenix

    Question

    I want to get a player with the highest number of kill's data for example how do I do? I have elementData and i need check it Help Guys.
  11. Everybody can help me?
  12. When a player dies and goes to spectator can't spectate to another player .For example 2 players alive ( players in spectator can spectate players ( who get "Status" == "Playing" ) ), but sometimes when you switch the button( on keyboard ) "arrows" does not work to switch to another player but he is alive and have is in the table alivePlayers . Help guys. Server: alivePlayers = {} spec = {} local g_CurrentSpectated = 1 function spec.already( thePlayer ) local bool = false for k,i in ipairs ( alivePlayers ) do if ( i == thePlayer ) then bool = true end end return bool end function sizeof( t ) local s = 0 for _ in pairs( t ) do s = s + 1 end return s end addEvent("spec.some",true) function spec.some( ) if spec.get( ) >= 1 then triggerEvent("spec.next",source) end end addEventHandler("spec.some",root,spec.some) addEvent("spec.get",true) function spec.get() return sizeof(alivePlayers) end addEventHandler("spec.get",root,spec.get) addEvent("spec.add",true) function spec.add( ) if not ( spec.already( source ) ) then table.insert(alivePlayers, source) return true end return false end addEventHandler("spec.add",root,spec.add) addEvent("spec.remove",true) function spec.remove( ) local bool = false for i, val in ipairs(alivePlayers) do if (val == source) then table.remove(alivePlayers, i) bool = true end end return bool end addEventHandler("spec.remove", root,spec.remove) addEvent("spec.next",true) function spec.next( ) if g_CurrentSpectated >= sizeof(alivePlayers) then g_CurrentSpectated = 1 else g_CurrentSpectated = g_CurrentSpectated + 1 end setCameraTarget(source,alivePlayers[g_CurrentSpectated]) end addEventHandler("spec.next",root,spec.next) addEvent("spec.prev",true) function spec.prev( ) if g_CurrentSpectated <= 1 then g_CurrentSpectated = sizeof(alivePlayers) else g_CurrentSpectated = g_CurrentSpectated - 1 end setCameraTarget(source,alivePlayers[g_CurrentSpectated]) end addEventHandler("spec.prev",root,spec.prev) addEventHandler("onPlayerWasted",root, function() if source then triggerEvent("spec.remove",source) end end ) addEventHandler("onPlayerQuit",root,spec.remove) setTimer( function() for k,i in ipairs ( getElementsByType( "player" ) ) do if ( getElementData( i, "Status" ) == "Spectator" ) then local target = getCameraTarget( i ) if ( getElementType( target ) == "player" ) then setElementData( i, "Specting", target ) else setElementData( i, "Specting", false ) end else setElementData( i, "Specting", false ) end end end , 1000, 0) Utils server: function callServerfunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerfunction) function callClientfunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end Client: local spec = { } local Spectator_text = { Rus = {},Eng = {}, Pl = {},Sp = {} } Spectator_text.Rus.text = "Следят за тобой:\n" Spectator_text.Eng.text = "People spectating you:\n" Spectator_text.Pl.text = "Ludzie widzem ci:\n" Spectator_text.Sp.text = "La gente te espectador:\n" Spectator_text.Rus.more = " И больше ..." Spectator_text.Eng.more = " more ..." Spectator_text.Pl.more = " wiecej ..." Spectator_text.Sp.more = " mas ..." local spectate = {} local me = getLocalPlayer() local Spector_image = {} local g_CurrentSpectated = 0 local x, y = guiGetScreenSize () local spectatorSettings = { count = 7, charLimit = 19, xOffset = 200, yOffset = (y / 2) - 40, alwaysShow = true } addEvent( "spec.show",true) function spec.show( bool ) callServerfunction("setElementData" , source,"Status","Spectator") callServerfunction("setElementData" , source,"showHud","n") bindKey("arrow_l", "down", spectate.prev) bindKey("arrow_r", "down", spectate.next) triggerServerEvent("spec.some",me) end addEventHandler("spec.show",root,spec.show) addEvent( "spec.hide",true) function spec.hide( ) if getElementData(me,"Status") == "Joined" then return end callServerfunction("setElementData" , me, "Status","Playing") callServerfunction("setElementData" , me, "show","none") unbindKey("arrow_l", "down", spectate.prev) unbindKey("arrow_r", "down", spectate.next) end addEventHandler("spec.hide",root,spec.hide) addEventHandler("onClientRender",root, function() if getElementData(me,"Status") == "Spectator" then dxDrawRelativeImage(416.0,762.0,134.0,121.0,"img/prv2.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawRelativeImage(722.0,762.0,134.0,121.0,"img/next2.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) if getElementData(me,"show") == "image1" then dxDrawRelativeImage(416.0,762.0,134.0,121.0,"img/prv.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) end if getElementData(me,"show") == "image2" then dxDrawRelativeImage(722.0,762.0,134.0,121.0,"img/next.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) end end end ) addEventHandler("onClientPlayerWasted",me, function( killer, weapon, bodypart ) if source then triggerEvent("spec.show",source) end end ) function spec.check ( elem ) if elem then if isElement (elem) then if (getElementType (elem) == 'player') then return true end end end return false end function spec.getSpecMe( ) local tableSpec = {} for i,v in ipairs(getElementsByType("player")) do if getElementData( v ,"Status" ) == "Spectator" then table.insert( tableSpec, v ) else table.remove( tableSpec, i ) end end return tableSpec end function spectate.prev() if getElementData(me,"Status") ~= "Spectator" then return end setElementData(me,"show","image1") setTimer(setElementData,200,1,me,"show","none") triggerServerEvent("spec.prev",me) end function spectate.next() if getElementData(me,"Status") ~= "Spectator" then return end setElementData(me,"show","image2") setTimer(setElementData,200,1,me,"show","none") triggerServerEvent("spec.next",me) end function updatePlayerSpec() if spec.spectating( ) then return else triggerEvent("hideSpector",me) end end setTimer(updatePlayerSpec,50,0) function spec.showSpectators( ) local spectators = spec.getSpecMe( ) local textX = x - spectatorSettings.xOffset local textY = spectatorSettings.yOffset if (not isPlayerDead(me)) and getElementData( me,"Status") == "Playing" then local s_Spectators = Spectator_text[ getElementData( me,"Lang" ) ].text if (#spectators > 0) then for i, v in ipairs(spectators) do if spec.check (v) then local target = getElementData( v, "Specting" ) if ( target == getLocalPlayer() ) then local name = string.gsub( getPlayerName(v), "#%x%x%x%x%x%x", "" ) if (string.len(name) > spectatorSettings.charLimit) then name = string.sub(name, 0, spectatorSettings.charLimit)..'..' end if (i > spectatorSettings.count) then s_Spectators = s_Spectators..tostring(#spectators - spectatorSettings.count)..''..Spectator_text[ getElementData( me,"Lang" ) ].more break else s_Spectators = s_Spectators..name..'\n' end else s_Spectators = '' end end end else s_Spectators = '' end dxDrawRelativeText (s_Spectators, textX, textY, x, y, tocolor(255, 255, 255, 255), 1.3, 'arial') end end addEventHandler('onClientRender', root, spec.showSpectators) Utils client: function dxDrawRelativeText(text,posX,posY,right,bottom,color,scale,font,alignX,alignY,clip,wordBreak,postGUI) local resolutionX = 1280 local resolutionY = 1024 local sWidth,sHeight = guiGetScreenSize() dxDrawText(tostring(text),(posX/resolutionX)*sWidth,(posY/resolutionY)*sHeight,(right/resolutionX)*sWidth,(bottom/resolutionY)*sHeight,color,(sWidth/resolutionX)*scale,font,alignX,alignY,clip,wordBreak,postGUI) end function dxDrawRelativeImage( posX, posY, width, height, path,rotation,rotationCenterOffsetX,rotationCenterOffsetY,color,postGUI) local resolutionX = 1280 local resolutionY = 1024 local sWidth,sHeight = guiGetScreenSize() dxDrawImage ( (posX/resolutionX)*sWidth, (posY/resolutionY)*sHeight, (width/resolutionX)*sWidth, (height/resolutionY)*sHeight, tostring(path) , rotation, rotationCenterOffsetX, rotationCenterOffsetY, color, postGUI ) end function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end function callClientFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onServerCallsClientFunction", true) addEventHandler("onServerCallsClientFunction", resourceRoot, callClientFunction)
  13. Вообщем проблема такая если ты находишься в спектаторе и переключаешь ( на кнопки ) то иногда не переключается на следуйшего или предыдушего игрока по таблице alivePlayers. Помогите пожалуйста. Сервер: alivePlayers = {} spec = {} local g_CurrentSpectated = 1 function spec.already( thePlayer ) local bool = false for k,i in ipairs ( alivePlayers ) do if ( i == thePlayer ) then bool = true end end return bool end function sizeof( t ) local s = 0 for _ in pairs( t ) do s = s + 1 end return s end addEvent("spec.some",true) function spec.some( ) if spec.get( ) >= 1 then triggerEvent("spec.next",source) end end addEventHandler("spec.some",root,spec.some) addEvent("spec.get",true) function spec.get() return sizeof(alivePlayers) end addEventHandler("spec.get",root,spec.get) addEvent("spec.add",true) function spec.add( ) if not ( spec.already( source ) ) then table.insert(alivePlayers, source) return true end return false end addEventHandler("spec.add",root,spec.add) addEvent("spec.remove",true) function spec.remove( ) local bool = false for i, val in ipairs(alivePlayers) do if (val == source) then table.remove(alivePlayers, i) bool = true end end return bool end addEventHandler("spec.remove", root,spec.remove) addEvent("spec.next",true) function spec.next( ) if g_CurrentSpectated >= sizeof(alivePlayers) then g_CurrentSpectated = 1 else g_CurrentSpectated = g_CurrentSpectated + 1 end setCameraTarget(source,alivePlayers[g_CurrentSpectated]) end addEventHandler("spec.next",root,spec.next) addEvent("spec.prev",true) function spec.prev( ) if g_CurrentSpectated <= 1 then g_CurrentSpectated = sizeof(alivePlayers) else g_CurrentSpectated = g_CurrentSpectated - 1 end setCameraTarget(source,alivePlayers[g_CurrentSpectated]) end addEventHandler("spec.prev",root,spec.prev) addEventHandler("onPlayerWasted",root, function() if source then triggerEvent("spec.remove",source) end end ) addEventHandler("onPlayerQuit",root,spec.remove) setTimer( function() for k,i in ipairs ( getElementsByType( "player" ) ) do if ( getElementData( i, "Status" ) == "Spectator" ) then local target = getCameraTarget( i ) if ( getElementType( target ) == "player" ) then setElementData( i, "Specting", target ) else setElementData( i, "Specting", false ) end else setElementData( i, "Specting", false ) end end end , 1000, 0) function callServerfunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerfunction) function callClientfunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end Клиент: local spec = { } local Spectator_text = { Rus = {},Eng = {}, Pl = {},Sp = {} } Spectator_text.Rus.text = "Следят за тобой:\n" Spectator_text.Eng.text = "People spectating you:\n" Spectator_text.Pl.text = "Ludzie widzem ci:\n" Spectator_text.Sp.text = "La gente te espectador:\n" Spectator_text.Rus.more = " И больше ..." Spectator_text.Eng.more = " more ..." Spectator_text.Pl.more = " wiecej ..." Spectator_text.Sp.more = " mas ..." local spectate = {} local me = getLocalPlayer() local Spector_image = {} local g_CurrentSpectated = 0 local x, y = guiGetScreenSize () local spectatorSettings = { count = 7, charLimit = 19, xOffset = 200, yOffset = (y / 2) - 40, alwaysShow = true } addEvent( "spec.show",true) function spec.show( bool ) callServerfunction("setElementData" , source,"Status","Spectator") callServerfunction("setElementData" , source,"showHud","n") bindKey("arrow_l", "down", spectate.prev) bindKey("arrow_r", "down", spectate.next) triggerServerEvent("spec.some",me) end addEventHandler("spec.show",root,spec.show) addEvent( "spec.hide",true) function spec.hide( ) if getElementData(me,"Status") == "Joined" then return end callServerfunction("setElementData" , me, "Status","Playing") callServerfunction("setElementData" , me, "show","none") unbindKey("arrow_l", "down", spectate.prev) unbindKey("arrow_r", "down", spectate.next) end addEventHandler("spec.hide",root,spec.hide) addEventHandler("onClientRender",root, function() if getElementData(me,"Status") == "Spectator" then dxDrawRelativeImage(416.0,762.0,134.0,121.0,"img/prv2.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawRelativeImage(722.0,762.0,134.0,121.0,"img/next2.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) if getElementData(me,"show") == "image1" then dxDrawRelativeImage(416.0,762.0,134.0,121.0,"img/prv.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) end if getElementData(me,"show") == "image2" then dxDrawRelativeImage(722.0,762.0,134.0,121.0,"img/next.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) end end end ) addEventHandler("onClientPlayerWasted",me, function( killer, weapon, bodypart ) if source then triggerEvent("spec.show",source) end end ) function spec.check ( elem ) if elem then if isElement (elem) then if (getElementType (elem) == 'player') then return true end end end return false end function spec.getSpecMe( ) local tableSpec = {} for i,v in ipairs(getElementsByType("player")) do if getElementData( v ,"Status" ) == "Spectator" then table.insert( tableSpec, v ) else table.remove( tableSpec, i ) end end return tableSpec end function spectate.prev() if getElementData(me,"Status") ~= "Spectator" then return end setElementData(me,"show","image1") setTimer(setElementData,200,1,me,"show","none") triggerServerEvent("spec.prev",me) end function spectate.next() if getElementData(me,"Status") ~= "Spectator" then return end setElementData(me,"show","image2") setTimer(setElementData,200,1,me,"show","none") triggerServerEvent("spec.next",me) end function updatePlayerSpec() if spec.spectating( ) then return else triggerEvent("hideSpector",me) end end setTimer(updatePlayerSpec,50,0) function spec.showSpectators( ) local spectators = spec.getSpecMe( ) local textX = x - spectatorSettings.xOffset local textY = spectatorSettings.yOffset if (not isPlayerDead(me)) and getElementData( me,"Status") == "Playing" then local s_Spectators = Spectator_text[ getElementData( me,"Lang" ) ].text if (#spectators > 0) then for i, v in ipairs(spectators) do if spec.check (v) then local target = getElementData( v, "Specting" ) if ( target == getLocalPlayer() ) then local name = string.gsub( getPlayerName(v), "#%x%x%x%x%x%x", "" ) if (string.len(name) > spectatorSettings.charLimit) then name = string.sub(name, 0, spectatorSettings.charLimit)..'..' end if (i > spectatorSettings.count) then s_Spectators = s_Spectators..tostring(#spectators - spectatorSettings.count)..''..Spectator_text[ getElementData( me,"Lang" ) ].more break else s_Spectators = s_Spectators..name..'\n' end else s_Spectators = '' end end end else s_Spectators = '' end dxDrawRelativeText (s_Spectators, textX, textY, x, y, tocolor(255, 255, 255, 255), 1.3, 'arial') end end addEventHandler('onClientRender', root, spec.showSpectators) function dxDrawRelativeText(text,posX,posY,right,bottom,color,scale,font,alignX,alignY,clip,wordBreak,postGUI) local resolutionX = 1280 local resolutionY = 1024 local sWidth,sHeight = guiGetScreenSize() dxDrawText(tostring(text),(posX/resolutionX)*sWidth,(posY/resolutionY)*sHeight,(right/resolutionX)*sWidth,(bottom/resolutionY)*sHeight,color,(sWidth/resolutionX)*scale,font,alignX,alignY,clip,wordBreak,postGUI) end function dxDrawRelativeImage( posX, posY, width, height, path,rotation,rotationCenterOffsetX,rotationCenterOffsetY,color,postGUI) local resolutionX = 1280 local resolutionY = 1024 local sWidth,sHeight = guiGetScreenSize() dxDrawImage ( (posX/resolutionX)*sWidth, (posY/resolutionY)*sHeight, (width/resolutionX)*sWidth, (height/resolutionY)*sHeight, tostring(path) , rotation, rotationCenterOffsetX, rotationCenterOffsetY, color, postGUI ) end function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end function callClientFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onServerCallsClientFunction", true) addEventHandler("onServerCallsClientFunction", resourceRoot, callClientFunction)
  14. Nice dude very cool maps.
  15. Ты можешь эту функцию сам написать. Там нет ничего трудного.
  16. Я не понимаю что ты вообще написал ... Посмотри мой код и разберись в нём.
  17. дай кусок с этими строчками на 1.0.5 <group name="Console"> <acl name="Moderator" /> <acl name="SuperModerator" /> <acl name="Admin" /> <acl name="RPC" /> <object name="user.Console" /> <object name="user.el_motoblock" /> </group> а на 1.1.1 не робит( <group name="Console"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="user.Console"> <object name="user.el_motoblock"></object> </group> может убрать Чтобы быть админом на сервере тебе нужно : <object name="user.el_motoblock"></object> Добавить в группу "Admin"
  18. Это тестовый код , ибо ты его должен доработать для себя.
  19. Что трудного то глянь в вики как создать прогресс бар , а мы поскажем если что не понятно. Пример Клиент: progressBar = guiCreateProgressBar( 0.8, 0.8, 0.1, 0.1, true ) addEventHandler("onClientPlayerWasted",root,function(killer,weapon,body) if killer then guiProgressBarSetProgress(progressBar,tonumber(guiProgressBarGetProgress(progressBar)*getElementData(me,"EXP")/getElementData(me,"EXPMAX"))) end end) Естественно когда игрок вошёл делаешь ему дату Сервер: addEventHandler("onPlayerJoin",root, function() setElementData(source,"EXP",0) setElementData(source,"EXPMAX",100) end ) Если пед умер то делаем + 1 очко к EXP дате. addEventHandler("onPedWasted",root, function(killer,weapon,body) if killer and getElementType(killer) == "player" then setElementData(killer,"EXP",tonumber(getElementData(killer,"EXP") + 1)) end end ) Я не знаю что ты хочешь сделать, но если ты собрался делать что то на подобии "системы прокачки" то тебе надо проверять елемент дату и если елемент дата больше текущий на пример довать новый уровень к существующему. Через Событие:OnElementDataChange . Удачи.
  20. This correct local teamGyg teamGyg = createTeam ( "~GYG~", 255, 255, 0 ) function setColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local col1,col2,col3 col1, col2, col3 = getTeamColor ( teamGyg ) setVehicleColor ( car, col1 or 0, col2 or 0, col3 or 0, 0 ) end end setTimer( setColors, 500, 0 )
  21. setVehicleColor( car, -- vehicle variable 255, -- color red 255, -- color green 0, -- color blue 0 )
  22. Not understand .What you need?
  23. You mean this? local teamName teamName = createTeam ( "Name", 255, 0, 0 ) col1, col2, col3 = getTeamColor ( teamName ) setVehicleColor ( playerVehicle, col1 or 0, col2 or 0, col3 or 0 , 0 ) Example: local teamName,col1,col2,col3 teamName = createTeam ( "Name", 255, 0, 0 ) function setColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local col1,col2,col3 col1, col2, col3 = getTeamColor ( teamName ) setVehicleColor ( car, col1 or 0, col2 or 0, col3 or 0 , 0 ) end end setTimer( setColors, 500, 0 )
×
×
  • Create New...