warcry Posted December 11, 2012 Share Posted December 11, 2012 Привет всем ! все отлично шло и тут мне захотелось на сервер полиции нашел замечательный скрипт legalsystem все прописываю его он врубается но нечего не хочет работать blips не видно на карте , помогите очень надо на сервер полицию ! Link to comment
TwiX! Posted December 11, 2012 Share Posted December 11, 2012 экстрасенсов здесь нету ошибки в студию Link to comment
warcry Posted December 12, 2012 Author Share Posted December 12, 2012 экстрасенсов здесь нетуошибки в студию Извини что то я забыл посмотреть [2012-12-09 08:01:25] Some files in 'legalsystem' use deprecated functions. [2012-12-09 08:01:25] Use the 'upgrade' command to perform a basic upgrade of resources. [2012-12-09 08:01:25] Starting legalsystem [2012-12-09 08:01:25] start: Resource 'legalsystem' started [2012-12-09 08:01:38] Upgrading legalsystem:arrest_server.lua ...........done Вот пишет типо в arrest WARNING: legalsystem/arrest_server.lua(Line 114) [server] getPlayerWeapon is deprecated and may not work in future versions. Please replace with getPedWeapon. а что там изменить подскажи пожалуйста Link to comment
TwiX! Posted December 12, 2012 Share Posted December 12, 2012 просто напиши upgrade или upgrade legalsystem Link to comment
Kenix Posted December 12, 2012 Share Posted December 12, 2012 Тебе надо на строке 114 изменить функцию getPlayerWeapon на getPedWeapon. Link to comment
warcry Posted December 13, 2012 Author Share Posted December 13, 2012 Все заменил рестарт делаю ресурса и нефига на карте нету не полиции и на TAB когда жмешь нету группы полицейских ? пожалуйста кто может помочь очень надо ! Link to comment
TwiX! Posted December 13, 2012 Share Posted December 13, 2012 зайди на сервер, залогинься как админ, напиши /debugscript 3 и выложи сюда ошибки Link to comment
Kernell Posted December 13, 2012 Share Posted December 13, 2012 А ещё лучше: Прочитай что пишут в ошибках, а если не знаешь английский - тут тебе не переводчики, они находятся по адресу http://translate.google.com/ P.S. без базовых знаний английского языка можете забыть о Lua, о скриптинге и о сопровождении сервера МТА. Link to comment
warcry Posted December 14, 2012 Author Share Posted December 14, 2012 WARNING: legalsystem\wantedlevels.lua:19: Bad 'element' pointer @ 'getPlayerWantedLevel'(1) Вот ещё [2012-12-12 15:34:33] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] [2012-12-12 15:34:33] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] [2012-12-12 15:37:20] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] [2012-12-12 15:37:20] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] [2012-12-12 15:38:05] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] [2012-12-12 15:38:05] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] [2012-12-12 15:38:07] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] [2012-12-12 15:38:07] WARNING: legalsystem\arrest_server.lua:472: Bad argument @ 'getElementData' [Expected element at argument 1] Link to comment
warcry Posted December 15, 2012 Author Share Posted December 15, 2012 а где код посмотреть? Link to comment
Flaker Posted December 15, 2012 Share Posted December 15, 2012 Ахах) В одном из файлов .lua, в папку с ресурсом. Link to comment
warcry Posted December 15, 2012 Author Share Posted December 15, 2012 kingCOP = createElement( "Pgroup", "cops" ) kingCIV = createElement( "Pgroup", "civs" ) kingNONE = createElement( "Pgroup", "none" ) function legalstartup(startedresource) if startedresource == getThisResource() then WantedWatch = setTimer (wantedlevelmonitor, 1000, 0) local allplayers = getElementsByType ( "player" ) local detectmethod = get("legalsystem.Copmethod") for playerKey,thePlayer in ipairs(allplayers) do if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(thePlayer) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(thePlayer) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end end end end addEventHandler( "onResourceStart", getRootElement(), legalstartup) function copSpawnCheck() local detectmethod = get("legalsystem.Copmethod") if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(source) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(source) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), copSpawnCheck ) --ARREST PLAYERS BY SMACKING WITH A NIGHTSTICK function rodneykingcheck ( attacker, weapon, bodypart, loss ) if (attacker) and (weapon == 3) then if getElementParent(attacker) == kingCOP then local thecop = attacker local theprisoner = source local wlevel = getPlayerWantedLevel( source ) if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest") and (wlevel > 0) then if (getElementData ( attacker, "currentarrests" ) ~= "single" ) and (getElementData ( attacker, "currentarrests" ) ~= "double" ) then setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) elseif (getElementData ( attacker, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( source, true ) toggleAllControls ( source, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end addEventHandler ( "onPlayerDamage", getRootElement(), rodneykingcheck ) --ARREST PLAYERS BY HOLDING THEM AT GUNPOINT IF THEY HAVE LOW HP function sightscheck ( element ) if isElement(element) then if ( getElementType ( element ) == "player" ) then if ( getControlState ( source, "aim_weapon" ) ) then local currentgun = getPedWeapon ( source ) local wlevel = getPlayerWantedLevel( element ) if (currentgun > 19) and (currentgun < 39) and (wlevel > 0) then if getElementParent(source) == kingCOP then local thecop = source local theprisoner = element local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getElementHealth ( element ) < 15 ) and ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 3 ) then if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest" ) then if (getElementData ( thecop, "currentarrests" ) ~= "single" ) and (getElementData ( thecop, "currentarrests" ) ~= "double" ) then triggerClientEvent(thecop,"copdirections",thecop) setElementData ( thecop, "currentarrests", "single" ) elseif (getElementData ( thecop, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) -- local arresttoolong = setTimer ( freetheguy, 180000, 1, theprisoner ) end end end end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), sightscheck ) --ARREST PLAYERS BY PULLING THEM OUT OF A VEHICLE function yankhimout(player, seat, jacker) if isElement(jacker) then if getElementParent(jacker) == kingCOP then local wlevel = getPlayerWantedLevel( player ) if wlevel > 0 then if (getElementData ( jacker, "currentarrests" ) ~= "single" ) and (getElementData ( jacker, "currentarrests" ) ~= "double" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) elseif (getElementData ( jacker, "currentarrests" ) == "single" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "double" ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end end addEventHandler ( "onVehicleExit", getRootElement(), yankhimout ) --FORCES A PRISONER TO FOLLOW THE COP function walktheprisoner(thecop, theprisoner) if (getElementData ( theprisoner, "currentstatus" ) == "underarrest") and (getPedOccupiedVehicle ( theprisoner ) == false ) then local copx, copy, copz = getElementPosition ( thecop ) local prisonerx, prisonery, prisonerz = getElementPosition ( theprisoner ) copangle = ( 360 - math.deg ( math.atan2 ( ( copx - prisonerx ), ( copy - prisonery ) ) ) ) % 360 setPedRotation ( theprisoner, copangle ) setCameraTarget ( theprisoner, theprisoner ) local dist = getDistanceBetweenPoints2D ( copx, copy, prisonerx, prisonery ) if ( dist > 16 ) then freetheguy ( theprisoner ) --FREES PRISONER IF HE GETS FAR AWAY elseif ( dist > 12 ) then setControlState ( theprisoner, "sprint", true ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 6 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", true ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist < 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) end end end --FREES A PLAYER (RESETS THEIR CONTROLS AND STATUS) function freetheguy (theprisoner) local thecaptor = (getElementData ( theprisoner, "captor" )) setElementData ( theprisoner, "currentstatus", "none" ) setElementData ( theprisoner, "captor", "none" ) showCursor ( theprisoner, false ) setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) toggleAllControls (theprisoner, true) local prisonercheck = setTimer ( checkforprisoners, 1500, 1, thecaptor ) TimoutTimer = (getElementData ( theprisoner, "arrestTimeout" )) if isTimer(TimoutTimer) then killTimer(TimoutTimer) setElementData ( theprisoner, "arrestTimeout", nil) TimeoutTimer = nil end end function checkforprisoners(thecop) if isElement(thecop) then local prisoners = 0 local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if (getElementData ( thePlayer, "captor" ) == thecop ) then prisoners = prisoners+1 end end if prisoners == 0 then setElementData ( thecop, "currentarrests", "none" ) triggerClientEvent( thecop,"clearcopdirections",thecop) elseif prisoners == 1 then setElementData ( thecop, "currentarrests", "single" ) elseif prisoners == 2 then setElementData ( thecop, "currentarrests", "double" ) end end Link to comment
warcry Posted December 16, 2012 Author Share Posted December 16, 2012 ну что кто поможет? Link to comment
Flaker Posted December 16, 2012 Share Posted December 16, 2012 Боюсь никто не решится изучать весь код! Попробуй просто заного установить этот ресурс Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now