Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

MTA - Problem z Maker'em


Adamosking

Rekomendowane odpowiedzi

Opublikowano

Jak stawiam marker (teleport) są problemy, jest napis ale marker nie działa. Powie mi ktoś czy dobrze poprawione ? Sam już nie wiem a dopisałem trochę.

 

 

 

 

marker = createMarker(-160,-260.021484375,2, "cylinder" , 3, 0, 180, 247, 150 )
markeraaaa = createMarker(-160,-275.595703125,2, "cylinder" , 3, 0, 180, 247, 150 )
markeraaa = createMarker(-160,-291.1708984375,2, "cylinder" , 3, 0, 180, 247, 150 )
 
marke = createMarker(-231.0625, -235.61033630371,3, "cylinder" , 5, 0, 180, 247, 150 )
markee = createMarker(-4.0894527435303,-375.76797485352,7, "cylinder" , 5, 0, 180, 247, 150 )
markeee = createMarker(-175.0654296875, -218.435546875,0, "cylinder" , 5, 0, 180, 247, 150 )
markeeeeee = createMarker(-95.583984375,-380.857421875,0, "cylinder" , 5, 0, 180, 247, 150 )
 
markeeeeeee = createMarker(-103.7431640625, -561.6748046875,0,"cylinder" , 5, 0, 180, 247, 150 )
 
function pan (hitElement)
local vehicle = getPedOccupiedVehicle( hitElement )
if vehicle then
triggerClientEvent ( "ppanel", hitElement )
setElementVelocity ( vehicle, 0, 0, 0 )
else
triggerClientEvent ( "ppanel", hitElement )
end
end
 
addEventHandler ("onMarkerHit",marke,pan)
addEventHandler ("onMarkerHit",markee,pan)
addEventHandler ("onMarkerHit",markeee,pan)
addEventHandler ("onMarkerHit",markeeee,pan)
addEventHandler ("onMarkerHit",markeeeee,pan)
addEventHandler ("onMarkerHit",markeeeeee,pan)
addEventHandler ("onMarkerHit",markeeeeeee,pan)
 
addEventHandler ("onMarkerHit",marker,pan)
addEventHandler ("onMarkerHit",markera,pan)
addEventHandler ("onMarkerHit",markeraa,pan)
addEventHandler ("onMarkerHit",markeraaa,pan)
addEventHandler ("onMarkerHit",markeraaaa,pan)
 
addEventHandler ("onMarkerHit",markerx,pan)
addEventHandler ("onMarkerHit",markerax,pan)
addEventHandler ("onMarkerHit",markeraax,pan)
addEventHandler ("onMarkerHit",markeraaax,pan)
addEventHandler ("onMarkerHit",markeraaaax,pan)
vehicleAddonsInfo = {
  {
  496,
  4,
  1,
  1,
15
  },
  {
  531,
  4,
  1,
  1,
20
  },
  {
  602,
  4,
  1,
  1,
20
  },
  {
  587,
  4,
  1,
  1,
20
  },
  {
  415,
  4,
  1,
  1,
20
  },
  {
  527,
  4,
  1,
  1,
20
  },
  {
    461,
    2,
    1,
    1,
25
  },
  {
    462,
    2,
    1,
    1,
25
  },
  {
    463,
    2,
    1,
    1,
25
  },
  
  {
    448,
    2,
    1,
    1,
25
  },
  {
    445,
    4,
    1,
    1,
25
  },
  {
    495,
    4,
    2,
    1,
25
  },
  {
    562,
    4,
    2,
    1,
25
  },
  {
    424,
    4,
    1,
    1,
25
  },
  {
    402,
    4,
    2,
    1,
25
  },
  {
    541,
    4,
    2,
    1,
25
  },
  {
    605,
    4,
    1,
    1,
25
  },
  {
    601,
    4,
    1,
    1,
25
  },
  {
    511,
    3,
    2,
    1,
25
  },
  {
    417,
    3,
    2,
    1,
1000
  },
  {
    460,
    0,
    1,
    0,
25
  },
  {
    521,
    2,
    1,
    1,
25
  },
  {
    463,
    2,
    1,
    1,
25
  },
  {
    593,
    0,
    1,
    1,
20
  },
  {
    568,
    4,
    1,
    1,
10
  },
  {
    490,
    4,
    1,
    1,
35
  },
  {
    549,
    4,
    1,
    1,
15
  },
  {
    500,
    4,
    1,
    1,
20
  },
  {
    400,
    4,
    1,
    1,
30
  },
  {
    471,
    4,
    1,
    1,
10
  },
  {
    422,
    4,
    1,
    1,
20
  },
  {
    470,
    4,
    1,
    1,
38
  },
  {
    468,
    2,
    1,
    1,
6
  },
  {
    433,
    6,
    1,
    1,
64
  },
  {
    437,
    6,
    1,
    1,
56
  },
  {
    509,
    0,
    0,
    0,
0
  },
  {
    487,
    0,
    1,
    1,
10
  },
  {
    497,
    0,
    1,
    1,
10
  },
  {
428,
4,
1,
1,
1000
},
{
542,
4,
1,
1,
30
},
  {
    453,
    0,
    1,
    1,
10
  }
}
function getVehicleAddonInfos(id)
  for i, veh in ipairs(vehicleAddonsInfo) do
    if veh[1] == id then
      return veh[2], veh[3], veh[4], veh[5]
    end
  end
end
function wyprowadz (gang, lider, x,y,z, poj, maxpoj, id, poziom, wybranypojazd, nazwa)
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("Bazy/" ..id..".xml")
ust = xmlFindChild ( xml, "Ustawienia", 0 )
local poj = xmlFindChild( ust, "Pojazdy", 0 )
local maxp = xmlFindChild( ust, "MaxPojazdow", 0 )
gangx = getElementData(source, "gang")
if gang == gangx then
pojj = xmlNodeGetValue(poj)
maxpoj = xmlNodeGetValue(maxp)
xxdd = pojj - 1
de = 0
setElementData ( source, "bazaID", id )
local pojx = xmlFindChild( ust, "Zaparkowane", 0 )
local listapojazdow = xmlNodeGetChildren(pojx)
for i,node in ipairs(listapojazdow) do
local Pojazd = xmlFindChild( node, "Pojazd", 0 )
local Dostepny = xmlFindChild( node, "Jest", 0 )
Pojazd = xmlNodeGetValue(Pojazd)
Dostepnyx = xmlNodeGetValue(Dostepny)
if de == 0 and Pojazd == wybranypojazd and Dostepnyx == "TAK" then
de = 1
xmlNodeSetValue ( Dostepny, "NIE" )
local ilbaz = xmlNodeSetValue ( poj, tostring(xxdd) )
outputChatBox ( "Wyprowadziles pojazd: "..nazwa..", aktualna ilosc pojazdow w bazie:" .. xxdd .."/"..maxpoj.."!", source, 0,255, 0, true )
 local x,y,z = getElementPosition(source)
 local veh = createVehicle(getVehicleModelFromName (nazwa), x * 55, y * 55, z, getElementRotation(source))
 vehCol = createColSphere(x * 55, y * 55, z, 2.5)
 attachElements(vehCol, veh, 0, 0, 0)
 setElementData(vehCol, "parent", veh)
 setElementData(veh, "parent", vehCol)
 setElementData(veh, "spawnedViaPanel", true)
 setElementData(vehCol, "vehicle", true)
 local tires, engine, parts, sloty = getVehicleAddonInfos(getElementModel(veh))
 setElementData(vehCol, "Tire_inVehicle", tires)
 setElementData(vehCol, "Engine_inVehicle", engine)
 if sloty then
 setElementData(vehCol, "MAX_Slots", sloty)
 else
 setElementData(vehCol, "MAX_Slots", 25)
 end
 setElementData(vehCol, "fuel", 16)
 setElementData(veh, "spawner", source)
 setTimer(setElementPosition, 200, 1, veh, x, y, z)
 setTimer(warpPedIntoVehicle, 200, 1, source, veh)
 addEventHandler("onVehicleExplode", veh, function()
setTimer(destroyElement, 5000, 1, veh)
setTimer(destroyElement, 5000, 1, vehCol)
end)
end
end
xmlSaveFile(xml)
xmlUnloadFile(xml)
end
end
end
addEvent("wyprowadz", true)
addEventHandler("wyprowadz", getRootElement(), wyprowadz)
 
function nowyplik()
local xml = xmlCreateFile("config.xml","config")
local iloscbaz = xmlCreateChild ( xml, "IloscBaz" )
local ilbaz = xmlNodeSetValue ( iloscbaz, "0" )
local bazy = xmlCreateChild ( xml, "Bazy" )
xmlSaveFile(xml)
xmlUnloadFile(xml)
end
 
addCommandHandler("ff212x", nowyplik)
 
function aktualizuj ()
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("config.xml")
bazy = xmlFindChild ( xml, "Bazy", 0 )
    local bazylista = xmlNodeGetChildren(bazy)
    for i,node in ipairs(bazylista) do
proxy = xmlNodeGetValue(node)
local bazzax = xmlLoadFile("Bazy/"..proxy..".xml")
local nodeustx = xmlFindChild( bazzax, "Ustawienia", 0 )
local pozxx = xmlFindChild( nodeustx, "POSX", 0 )
local pozyx = xmlFindChild( nodeustx, "POSY", 0 )
local pozzx = xmlFindChild( nodeustx, "POSZ", 0 )
local pojazdyx = xmlFindChild( nodeustx, "Pojazdy", 0 )
local maxpojx = xmlFindChild( nodeustx, "MaxPojazdow", 0 )
local gangx = xmlFindChild( nodeustx, "Gang", 0 )
local liderx = xmlFindChild( nodeustx, "Lider", 0 )
local poziom = xmlFindChild( nodeustx, "PoziomBazy", 0 )
posx = xmlNodeGetValue(pozxx)
posy = xmlNodeGetValue(pozyx)
posz = xmlNodeGetValue(pozzx)
pojazd = xmlNodeGetValue(pojazdyx)
maxpoj = xmlNodeGetValue(maxpojx)
gang = xmlNodeGetValue(gangx)
lider = xmlNodeGetValue(liderx)
poziomek = xmlNodeGetValue(poziom)
xmlUnloadFile(bazzax)
triggerClientEvent(source, "Zaktualizuj",root, gang, lider, posx,posy,posz,pojazd,maxpoj,proxy,poziomek)
end
        xmlUnloadFile(xml)
    end
end
addEvent("Aktualizuj", true)
addEventHandler("Aktualizuj", getRootElement(), aktualizuj)
 
function aktualizujbx ()
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("config.xml")
bazy = xmlFindChild ( xml, "Bazy", 0 )
    local bazylista = xmlNodeGetChildren(bazy)
    for i,node in ipairs(bazylista) do
proxy = xmlNodeGetValue(node)
local bazzax = xmlLoadFile("Bazy/"..proxy..".xml")
local nodeustx = xmlFindChild( bazzax, "Ustawienia", 0 )
local pozxx = xmlFindChild( nodeustx, "POSX", 0 )
local pozyx = xmlFindChild( nodeustx, "POSY", 0 )
local pozzx = xmlFindChild( nodeustx, "POSZ", 0 )
local pojazdyx = xmlFindChild( nodeustx, "Pojazdy", 0 )
local maxpojx = xmlFindChild( nodeustx, "MaxPojazdow", 0 )
local gangx = xmlFindChild( nodeustx, "Gang", 0 )
local liderx = xmlFindChild( nodeustx, "Lider", 0 )
local poziom = xmlFindChild( nodeustx, "PoziomBazy", 0 )
posx = xmlNodeGetValue(pozxx)
posy = xmlNodeGetValue(pozyx)
posz = xmlNodeGetValue(pozzx)
pojazd = xmlNodeGetValue(pojazdyx)
maxpoj = xmlNodeGetValue(maxpojx)
gang = xmlNodeGetValue(gangx)
lider = xmlNodeGetValue(liderx)
poziomek = xmlNodeGetValue(poziom)
xmlUnloadFile(bazzax)
gangx = getElementData(source,"gang")
if gang == gangx then
triggerClientEvent(source, "Zaktualizuj",root, gang, lider, posx,posy,posz,pojazd,maxpoj,proxy,poziomek)
end
end
        xmlUnloadFile(xml)
    end
end
addEvent("Aktualizujb", true)
addEventHandler("Aktualizujb", getRootElement(), aktualizujbx)
 
function Sprawdzpojazdy (gang, lider, x,y,z, poj, maxpoj, id, poziom)
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("Bazy/"..id..".xml")
local ust = xmlFindChild( xml, "Ustawienia", 0 )
local zaparko = xmlFindChild( ust, "Zaparkowane", 0 )
local lol = xmlNodeGetChildren(zaparko)
    for i,node in ipairs(lol) do
local pojazd = xmlFindChild( node, "Pojazd", 0 )
local Parkowal = xmlFindChild( node, "Parkowal", 0 )
local DataParkowania = xmlFindChild( node, "DataParkowania", 0 )
local Dostepny = xmlFindChild( node, "Jest", 0 )
Jest = xmlNodeGetValue(Dostepny)
if Jest == "TAK" then
pojazd = xmlNodeGetValue(pojazd)
park = xmlNodeGetValue(Parkowal)
Data = xmlNodeGetValue(DataParkowania)
triggerClientEvent(source, "Pojazdyx",root, pojazd,park,data)
end
end
        xmlUnloadFile(xml)
    end
end
addEvent("Sprawdzpojazdy", true)
addEventHandler("Sprawdzpojazdy", getRootElement(), Sprawdzpojazdy)
 
function zaladujbazy()
local xml = xmlLoadFile("config.xml")
bazy = xmlFindChild ( xml, "Bazy", 0 )
    local bazylista = xmlNodeGetChildren(bazy)
    for i,node in ipairs(bazylista) do
proxy = xmlNodeGetValue(node)
local bazzax = xmlLoadFile("Bazy/"..proxy..".xml")
local nodeustx = xmlFindChild( bazzax, "Ustawienia", 0 )
local pozxx = xmlFindChild( nodeustx, "POSX", 0 )
local pozyx = xmlFindChild( nodeustx, "POSY", 0 )
local pozzx = xmlFindChild( nodeustx, "POSZ", 0 )
local po = xmlFindChild( nodeustx, "PoziomBazy", 0 )
posx = xmlNodeGetValue(pozxx)
posy = xmlNodeGetValue(pozyx)
posz = xmlNodeGetValue(pozzx)
poziomek = xmlNodeGetValue(po)
if poziomek == "1" then
baza = createObject ( 3965, tonumber(posx), tonumber(posy), tonumber(posz-2), 0, 0, 0 )
xmlUnloadFile(bazzax)
elseif poziomek == "2" then
baza = createObject ( 3966, tonumber(posx), tonumber(posy), tonumber(posz-2), 0, 0, 0 )
xmlUnloadFile(bazzax)
elseif poziomek == "3" then
baza = createObject ( 3964, tonumber(posx), tonumber(posy+20), tonumber(posz-2), 0, 0, 0 )
xmlUnloadFile(bazzax)
end
    end
        xmlUnloadFile(xml)
end
addEventHandler ( "onResourceStart", getRootElement(), zaladujbazy )
 
function wejdz (gang, lider,x,y,z,poj, maxpoj, id)
if not isGuestAccount(getPlayerAccount(source)) then
gangx = getElementData(source, "gang")
if gangx == gang then
setElementPosition ( source, tonumber(x), tonumber(y), tonumber(z) )
outputChatBox ( "Wpisz: /wyjdz, aby wyjść z bazy!", source, 0,255, 0, true )
else
outputChatBox ( "Nie możesz wejść do tej bazy!", source, 255,0, 0, true )
end
    end
end
addEvent("Wejdz", true)
addEventHandler("Wejdz", getRootElement(), wejdz)
 
function wejdzx (gang, lider, pojazd,x,y,z,poj, maxpoj, id,nazwapojazdu)
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("Bazy/" ..id..".xml")
ust = xmlFindChild ( xml, "Ustawienia", 0 )
local poj = xmlFindChild( ust, "Pojazdy", 0 )
local maxp = xmlFindChild( ust, "MaxPojazdow", 0 )
gangx = getElementData(source, "gang")
if gang == gangx then
pojj = xmlNodeGetValue(poj)
maxpoj = xmlNodeGetValue(maxp)
if pojj == maxpoj then
outputChatBox ( "Osiągnięto limit pojazdów w bazie!", source, 0,255, 0, true )
else
destroyElement(getElementData(pojazd, "parent"))
destroyElement(pojazd)
xxdd = pojj + 1
local ilbaz = xmlNodeSetValue ( poj, tostring(xxdd) )
--outputChatBox ( "Wpisz: /wyjdz, aby wyjść z bazy!", source, 0,255, 0, true )
outputChatBox ( "Zaparkowałeś/aś pojazd! Aktualna ilość pojazdów to:" .. xxdd .."/"..maxpoj.."!", source, 0,255, 0, true )
setElementData ( source, "bazaID", id )
local pojx = xmlFindChild( ust, "Zaparkowane", 0 )
local poj = xmlCreateChild(pojx, "Poj")
local time = getRealTime()
local hours = time.hour
local minutes = time.minute
local monthday = time.monthday
local month = time.month 
parkowal = getPlayerName(source)
xmlNodeSetValue (xmlCreateChild ( poj, "Pojazd"), tostring(nazwapojazdu) )
xmlNodeSetValue (xmlCreateChild ( poj, "Nazwa"), tostring(nazwapojazdu) )
xmlNodeSetValue (xmlCreateChild ( poj, "Parkowal"), tostring(parkowal) )
xmlNodeSetValue (xmlCreateChild ( poj, "DataParkowania"), tostring(month).."miesiac,"..tostring(monthday).."dzien,godzina:"..tostring(hours)..":"..tostring(minutes).."" )
xmlNodeSetValue (xmlCreateChild ( poj, "Jest"), "TAK" )
xmlSaveFile(xml)
end
xmlUnloadFile(xml)
end
end
end
addEvent("Wejdzzpojazdem", true)
addEventHandler("Wejdzzpojazdem", getRootElement(), wejdzx)
 
function info ()
if not isGuestAccount(getPlayerAccount(source)) then
pp = getElementData(source, "PP")
if pp >= tonumber(50) then
xml = xmlLoadFile ( "config.xml" )
if xml then
local node = xmlFindChild( xml, "IloscBaz", 0 )
local ilosc = xmlNodeGetValue ( node )
local gangx = getElementData(source,"gang")
porr = ilosc + 1
local ilbaz = xmlNodeSetValue ( node, tostring(porr) )
local nodelol = xmlFindChild( xml, "Bazy", 0 )
local baz = xmlCreateChild(nodelol, "Baza")
local ilbaz = xmlNodeSetValue ( baz, "Gang"..tostring(porr).."" )
liderx = getAccountName(getPlayerAccount(source))
local x,y,z = getElementPosition( source )
local xmlxd = xmlCreateFile("Bazy/Gang"..porr..".xml","config")
local ustx = xmlCreateChild(xmlxd, "Ustawienia")
local pojazdy = xmlCreateChild ( ustx, "Pojazdy" )
local pojazdymax = xmlCreateChild ( ustx, "MaxPojazdow" )
local poziombazy = xmlCreateChild ( ustx, "PoziomBazy" )
local gng = xmlCreateChild ( ustx, "Gang" )
local lid = xmlCreateChild ( ustx, "Lider" )
local wartoscpoj = xmlNodeSetValue ( pojazdy, "0" )
local wartoscpojmax = xmlNodeSetValue ( pojazdymax, "5" )
local wartoscgang = xmlNodeSetValue ( gng, gangx )
local wartosclider = xmlNodeSetValue ( lid, liderx )
local poziomek = xmlNodeSetValue ( poziombazy, "1" )
local posx = xmlCreateChild ( ustx, "POSX" )
local posy = xmlCreateChild ( ustx, "POSY" )
local posz = xmlCreateChild ( ustx, "POSZ" )
local p = xmlCreateChild ( ustx, "Zaparkowane" )
iloscx = getElementData(source,"PP")
setElementData(source,"PP",iloscx - 50)
pan(source)
outputChatBox ( "Kupiłeś/aś małą bazę! -50PP!", source, 0, 255, 0, true )
zy = 3000
yy = 0 + (ilosc-50) * 100
xy = 0 + 500
local wartposx = xmlNodeSetValue ( posx, tostring(xy) )
local wartposy = xmlNodeSetValue ( posy, tostring(yy) )
local wartposz = xmlNodeSetValue ( posz, tostring(zy) )
createObject ( 3965, xy, yy, zy-2, 0, 0, 0 )
xmlSaveFile(xml)
xmlUnloadFile(xml)
xmlSaveFile(xmlxd)
xmlUnloadFile(xmlxd)
end
else
outputChatBox ( "Nie stać Cię!", source, 255, 0, 0, true )
end
else
outputChatBox ( "Nie możesz kupić!", source, 255, 0, 0, true )
end
end
addEvent("StworzBaze", true)
addEventHandler("StworzBaze", getRootElement(), info)
 
function infoo ()
if not isGuestAccount(getPlayerAccount(source)) then
pp = getElementData(source, "PP")
if pp >= tonumber(100) then
xml = xmlLoadFile ( "config.xml" )
if xml then
local node = xmlFindChild( xml, "IloscBaz", 0 )
local ilosc = xmlNodeGetValue ( node )
local gangx = getElementData(source,"gang")
porr = ilosc + 1
local ilbaz = xmlNodeSetValue ( node, tostring(porr) )
local nodelol = xmlFindChild( xml, "Bazy", 0 )
local baz = xmlCreateChild(nodelol, "Baza")
local ilbaz = xmlNodeSetValue ( baz, "Gang"..tostring(porr).."" )
liderx = getAccountName(getPlayerAccount(source))
local x,y,z = getElementPosition( source )
local xmlxd = xmlCreateFile("Bazy/Gang"..porr..".xml","config")
local ustx = xmlCreateChild(xmlxd, "Ustawienia")
local pojazdy = xmlCreateChild ( ustx, "Pojazdy" )
local pojazdymax = xmlCreateChild ( ustx, "MaxPojazdow" )
local poziombazy = xmlCreateChild ( ustx, "PoziomBazy" )
local gng = xmlCreateChild ( ustx, "Gang" )
local lid = xmlCreateChild ( ustx, "Lider" )
local wartoscpoj = xmlNodeSetValue ( pojazdy, "0" )
    local wartoscpojmax = xmlNodeSetValue ( pojazdymax, "10" )
local wartoscgang = xmlNodeSetValue ( gng, gangx )
    local wartosclider = xmlNodeSetValue ( lid, liderx )
local poziomek = xmlNodeSetValue ( poziombazy, "2" )
local posx = xmlCreateChild ( ustx, "POSX" )
local posy = xmlCreateChild ( ustx, "POSY" )
local posz = xmlCreateChild ( ustx, "POSZ" )
local p = xmlCreateChild ( ustx, "Zaparkowane" )
iloscx = getElementData(source,"PP")
setElementData(source,"PP",iloscx - 100)
pan(source)
outputChatBox ( "Kupiłeś/aś średnią bazę! -100PP!", source, 0, 255, 0, true )
zy = 3000
yy = 0 + (ilosc-50) * 100
xy = 0 + 500
    local wartposx = xmlNodeSetValue ( posx, tostring(xy) )
local wartposy = xmlNodeSetValue ( posy, tostring(yy) )
local wartposz = xmlNodeSetValue ( posz, tostring(zy) )
createObject ( 3966, xy, yy, zy-2, 0, 0, 0 )
xmlSaveFile(xml)
xmlUnloadFile(xml)
xmlSaveFile(xmlxd)
xmlUnloadFile(xmlxd)
end
else
outputChatBox ( "Nie stać Cię!", source, 255, 0, 0, true )
end
else
outputChatBox ( "Nie możesz kupić!", source, 255, 0, 0, true )
end
end
addEvent("StworzBazee", true)
addEventHandler("StworzBazee", getRootElement(), infoo)
 
function infooo ()
if not isGuestAccount(getPlayerAccount(source)) then
pp = getElementData(source, "PP")
if pp >= tonumber(200) then
xml = xmlLoadFile ( "config.xml" )
if xml then
local node = xmlFindChild( xml, "IloscBaz", 0 )
local ilosc = xmlNodeGetValue ( node )
local gangx = getElementData(source,"gang")
porr = ilosc + 1
local ilbaz = xmlNodeSetValue ( node, tostring(porr) )
local nodelol = xmlFindChild( xml, "Bazy", 0 )
local baz = xmlCreateChild(nodelol, "Baza")
local ilbaz = xmlNodeSetValue ( baz, "Gang"..tostring(porr).."" )
liderx = getAccountName(getPlayerAccount(source))
local x,y,z = getElementPosition( source )
local xmlxd = xmlCreateFile("Bazy/Gang"..porr..".xml","config")
local ustx = xmlCreateChild(xmlxd, "Ustawienia")
local pojazdy = xmlCreateChild ( ustx, "Pojazdy" )
local pojazdymax = xmlCreateChild ( ustx, "MaxPojazdow" )
local poziombazy = xmlCreateChild ( ustx, "PoziomBazy" )
local gng = xmlCreateChild ( ustx, "Gang" )
local lid = xmlCreateChild ( ustx, "Lider" )
local wartoscpoj = xmlNodeSetValue ( pojazdy, "0" )
    local wartoscpojmax = xmlNodeSetValue ( pojazdymax, "20" )
local wartoscgang = xmlNodeSetValue ( gng, gangx )
    local wartosclider = xmlNodeSetValue ( lid, liderx )
local poziomek = xmlNodeSetValue ( poziombazy, "3" )
local posx = xmlCreateChild ( ustx, "POSX" )
local posy = xmlCreateChild ( ustx, "POSY" )
local posz = xmlCreateChild ( ustx, "POSZ" )
local p = xmlCreateChild ( ustx, "Zaparkowane" )
iloscx = getElementData(source,"PP")
setElementData(source,"PP",iloscx - 200)
pan(source)
outputChatBox ( "Kupiłeś/aś dużą bazę! -200PP!", source, 0, 255, 0, true )
zy = 3000
yy = 0 + (ilosc-50) * 100
xy = 0 + 500
    local wartposx = xmlNodeSetValue ( posx, tostring(xy) )
local wartposy = xmlNodeSetValue ( posy, tostring(yy) )
local wartposz = xmlNodeSetValue ( posz, tostring(zy) )
createObject ( 3964, xy, yy+20, zy-2, 0, 0, 0 )
xmlSaveFile(xml)
xmlUnloadFile(xml)
xmlSaveFile(xmlxd)
xmlUnloadFile(xmlxd)
end
else
outputChatBox ( "Nie stać Cię!", source, 255, 0, 0, true )
end
else
outputChatBox ( "Nie możesz kupić!", source, 255, 0, 0, true )
end
end
addEvent("StworzBazeee", true)
addEventHandler("StworzBazeee", getRootElement(), infooo)
 
function fyjdz (source)
local x,y,z = getElementPosition( source )
if z >= 2500 then
if isPedInVehicle ( source ) then
idbazy = getElementData(source, "bazaID")
local xml = xmlLoadFile("Bazy/"..idbazy..".xml")
ust = xmlFindChild ( xml, "Ustawienia", 0 )
local poj = xmlFindChild( ust, "Pojazdy", 0 )
local maxp = xmlFindChild( ust, "MaxPojazdow", 0 )
pojj = xmlNodeGetValue(poj)
maxpoj = xmlNodeGetValue(maxp)
xxdd = pojj - 1
local ilbaz = xmlNodeSetValue ( poj, tostring(xxdd) )
outputChatBox ( "Wyjechałeś/aś pojazdem! Aktualna ilość pojazdów w bazie to:" .. xxdd .."/"..maxpoj.."!", source, 0,255, 0, true )
xmlSaveFile(xml)
xmlUnloadFile(xml)
local pojazd = getPedOccupiedVehicle(source)
setElementPosition ( pojazd, 2511, -1670.7, 14.8 )
else
randomA = math.random(0,10)
randomB = math.random(0,10)
setElementPosition ( source, -49.0615234375+randomA,-313.9140625+randomB,5.4296875 )
end
end
end
addCommandHandler ( "wyjdz", fyjdz  )
 
function onPlayerQuit ( )
      local playeraccount = getPlayerAccount ( source )
      if ( playeraccount ) then
            bazaIDx = getElementData(source,"bazaID")
            setAccountData ( playeraccount, "bazaIDx", bazaIDx )
bazaIDxx = getElementData(source,"PP")
            setAccountData ( playeraccount, "PPx", bazaIDxx )
      end
end
 
function onPlayerLogin ( )
      local playeraccount = getPlayerAccount ( source )
      if ( playeraccount ) then
            local lol = getAccountData ( playeraccount, "bazaIDx" )
local lollol = getAccountData ( playeraccount, "PPx" )
            if ( lol ) then
            setElementData ( source, "bazaID", lol )
setElementData ( source, "PP", lollol )
      end
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
 
function money_func(player,cmd,playername,money)
accountname = getAccountName(getPlayerAccount(player))
if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then
    if playername and money then
      local player2 = getPlayerFromName(playername)
      if player2 then
  setElementData(player2,"PP",tonumber(money))
  outputChatBox ( "Otrzymałeś/aś: " .. money.. " punktów PP!", player2, 0,255, 0, true )
  outputChatBox ( "Gracz: " ..getPlayerName(player2) .." otrzymał: " .. money.. " punktów PP!", player, 0,255, 0, true )
  end
end
else
outputChatBox("Nie masz praw!",player)
end
end
addCommandHandler("dajpp",money_func)
 
 
local hillArea = createColRectangle ( -374.513671875,-573.9697265625, 550, 550 )
local hillRadar = createRadarArea ( -374.513671875,-573.9697265625, 550, 550, 0, 255, 0, 175 )
 
function hill_Enter ( thePlayer, matchingDimension )
    if (getElementType(thePlayer) == "player") then
outputChatBox( "Wchodzisz do bezpiecznej strefy!", thePlayer, 255, 255, 109 )
toggleControl (thePlayer, "aim_weapon", false)
setElementData(thePlayer, "greenzone", "TAK" )
end
end
addEventHandler ( "onColShapeHit", hillArea, hill_Enter )
 
function hill_Exit ( thePlayer, matchingDimension )
if (getElementType(thePlayer) == "player") then
outputChatBox ( "Wychodzisz z bezpiecznej strefy!", thePlayer, 255, 255, 109 )
toggleControl (thePlayer, "aim_weapon", true)
setElementData(thePlayer, "greenzone", "NIE" )
setElementData(thePlayer, "blood", 999999 )
end
end
addEventHandler ( "onColShapeLeave", hillArea, hill_Exit )
 
 
 function allPlayersPayDay()
  local allPlayers = getElementsByType("player")
  for index,value in ipairs(allPlayers) do 
    if getElementData(value, "greenzone") == "TAK" then
setElementData(value, "blood", 999999 )
setElementData(value, "bleeding", 0)
setElementData(value, "brokenbone", false)
setElementData(value, "pain", false)
setElementData(value, "greenzone", "TAK" )
 
if isPlayerInVehicle ( value ) then
local veh = getPedOccupiedVehicle(value)
fixVehicle ( veh )
end
else
setElementData(value, "greenzone", "NIE" )
end
end
end
 
function onResourceStart(thisResource)
  setTimer ( allPlayersPayDay, 250, 0 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart )
 
function check ( player, seat, jacked )
if getElementData(source, "private") then
if getElementData(source, "owner") == getAccountName(getPlayerAccount(player)) or getElementData(player,"greenzone") == "NIE" or getElementData(source, "gangpojazdu") == getElementData(player, "gang")  then
else
cancelEvent()
outputChatBox("Ten pojazd nalezy do gangu: ".. getElementData(source, "gangpojazdu").." !", player)
end
end
end
addEventHandler ( "onVehicleStartEnter", getRootElement(), check )
 
function setcar( veh, seat )
local pojazd = getPedOccupiedVehicle(source)
setElementData(pojazd, "private", true)
setElementData(pojazd, "owner", getAccountName(getPlayerAccount(source)))
setElementData(pojazd, "gangpojazdu", getElmarker = createMarker(-160,-260.021484375,2, "cylinder" , 3, 0, 180, 247, 150 )
markeraaaa = createMarker(-160,-275.595703125,2, "cylinder" , 3, 0, 180, 247, 150 )
markeraaa = createMarker(-160,-291.1708984375,2, "cylinder" , 3, 0, 180, 247, 150 )
 
marke = createMarker(-231.0625, -235.61033630371,3, "cylinder" , 5, 0, 180, 247, 150 )
markee = createMarker(-4.0894527435303,-375.76797485352,7, "cylinder" , 5, 0, 180, 247, 150 )
markeee = createMarker(-175.0654296875, -218.435546875,0, "cylinder" , 5, 0, 180, 247, 150 )
markeeeeee = createMarker(-95.583984375,-380.857421875,0, "cylinder" , 5, 0, 180, 247, 150 )
 
markeeeeeee = createMarker(-103.7431640625, -561.6748046875,0,"cylinder" , 5, 0, 180, 247, 150 )
 
function pan (hitElement)
local vehicle = getPedOccupiedVehicle( hitElement )
if vehicle then
triggerClientEvent ( "ppanel", hitElement )
setElementVelocity ( vehicle, 0, 0, 0 )
else
triggerClientEvent ( "ppanel", hitElement )
end
end
 
addEventHandler ("onMarkerHit",marke,pan)
addEventHandler ("onMarkerHit",markee,pan)
addEventHandler ("onMarkerHit",markeee,pan)
addEventHandler ("onMarkerHit",markeeee,pan)
addEventHandler ("onMarkerHit",markeeeee,pan)
addEventHandler ("onMarkerHit",markeeeeee,pan)
addEventHandler ("onMarkerHit",markeeeeeee,pan)
 
addEventHandler ("onMarkerHit",marker,pan)
addEventHandler ("onMarkerHit",markera,pan)
addEventHandler ("onMarkerHit",markeraa,pan)
addEventHandler ("onMarkerHit",markeraaa,pan)
addEventHandler ("onMarkerHit",markeraaaa,pan)
 
addEventHandler ("onMarkerHit",markerx,pan)
addEventHandler ("onMarkerHit",markerax,pan)
addEventHandler ("onMarkerHit",markeraax,pan)
addEventHandler ("onMarkerHit",markeraaax,pan)
addEventHandler ("onMarkerHit",markeraaaax,pan)
vehicleAddonsInfo = {
  {
  496,
  4,
  1,
  1,
15
  },
  {
  531,
  4,
  1,
  1,
20
  },
  {
  602,
  4,
  1,
  1,
20
  },
  {
  587,
  4,
  1,
  1,
20
  },
  {
  415,
  4,
  1,
  1,
20
  },
  {
  527,
  4,
  1,
  1,
20
  },
  {
    461,
    2,
    1,
    1,
25
  },
  {
    462,
    2,
    1,
    1,
25
  },
  {
    463,
    2,
    1,
    1,
25
  },
  
  {
    448,
    2,
    1,
    1,
25
  },
  {
    445,
    4,
    1,
    1,
25
  },
  {
    495,
    4,
    2,
    1,
25
  },
  {
    562,
    4,
    2,
    1,
25
  },
  {
    424,
    4,
    1,
    1,
25
  },
  {
    402,
    4,
    2,
    1,
25
  },
  {
    541,
    4,
    2,
    1,
25
  },
  {
    605,
    4,
    1,
    1,
25
  },
  {
    601,
    4,
    1,
    1,
25
  },
  {
    511,
    3,
    2,
    1,
25
  },
  {
    417,
    3,
    2,
    1,
1000
  },
  {
    460,
    0,
    1,
    0,
25
  },
  {
    521,
    2,
    1,
    1,
25
  },
  {
    463,
    2,
    1,
    1,
25
  },
  {
    593,
    0,
    1,
    1,
20
  },
  {
    568,
    4,
    1,
    1,
10
  },
  {
    490,
    4,
    1,
    1,
35
  },
  {
    549,
    4,
    1,
    1,
15
  },
  {
    500,
    4,
    1,
    1,
20
  },
  {
    400,
    4,
    1,
    1,
30
  },
  {
    471,
    4,
    1,
    1,
10
  },
  {
    422,
    4,
    1,
    1,
20
  },
  {
    470,
    4,
    1,
    1,
38
  },
  {
    468,
    2,
    1,
    1,
6
  },
  {
    433,
    6,
    1,
    1,
64
  },
  {
    437,
    6,
    1,
    1,
56
  },
  {
    509,
    0,
    0,
    0,
0
  },
  {
    487,
    0,
    1,
    1,
10
  },
  {
    497,
    0,
    1,
    1,
10
  },
  {
428,
4,
1,
1,
1000
},
{
542,
4,
1,
1,
30
},
  {
    453,
    0,
    1,
    1,
10
  }
}
function getVehicleAddonInfos(id)
  for i, veh in ipairs(vehicleAddonsInfo) do
    if veh[1] == id then
      return veh[2], veh[3], veh[4], veh[5]
    end
  end
end
function wyprowadz (gang, lider, x,y,z, poj, maxpoj, id, poziom, wybranypojazd, nazwa)
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("Bazy/" ..id..".xml")
ust = xmlFindChild ( xml, "Ustawienia", 0 )
local poj = xmlFindChild( ust, "Pojazdy", 0 )
local maxp = xmlFindChild( ust, "MaxPojazdow", 0 )
gangx = getElementData(source, "gang")
if gang == gangx then
pojj = xmlNodeGetValue(poj)
maxpoj = xmlNodeGetValue(maxp)
xxdd = pojj - 1
de = 0
setElementData ( source, "bazaID", id )
local pojx = xmlFindChild( ust, "Zaparkowane", 0 )
local listapojazdow = xmlNodeGetChildren(pojx)
for i,node in ipairs(listapojazdow) do
local Pojazd = xmlFindChild( node, "Pojazd", 0 )
local Dostepny = xmlFindChild( node, "Jest", 0 )
Pojazd = xmlNodeGetValue(Pojazd)
Dostepnyx = xmlNodeGetValue(Dostepny)
if de == 0 and Pojazd == wybranypojazd and Dostepnyx == "TAK" then
de = 1
xmlNodeSetValue ( Dostepny, "NIE" )
local ilbaz = xmlNodeSetValue ( poj, tostring(xxdd) )
outputChatBox ( "Wyprowadziles pojazd: "..nazwa..", aktualna ilosc pojazdow w bazie:" .. xxdd .."/"..maxpoj.."!", source, 0,255, 0, true )
 local x,y,z = getElementPosition(source)
 local veh = createVehicle(getVehicleModelFromName (nazwa), x * 55, y * 55, z, getElementRotation(source))
 vehCol = createColSphere(x * 55, y * 55, z, 2.5)
 attachElements(vehCol, veh, 0, 0, 0)
 setElementData(vehCol, "parent", veh)
 setElementData(veh, "parent", vehCol)
 setElementData(veh, "spawnedViaPanel", true)
 setElementData(vehCol, "vehicle", true)
 local tires, engine, parts, sloty = getVehicleAddonInfos(getElementModel(veh))
 setElementData(vehCol, "Tire_inVehicle", tires)
 setElementData(vehCol, "Engine_inVehicle", engine)
 if sloty then
 setElementData(vehCol, "MAX_Slots", sloty)
 else
 setElementData(vehCol, "MAX_Slots", 25)
 end
 setElementData(vehCol, "fuel", 16)
 setElementData(veh, "spawner", source)
 setTimer(setElementPosition, 200, 1, veh, x, y, z)
 setTimer(warpPedIntoVehicle, 200, 1, source, veh)
 addEventHandler("onVehicleExplode", veh, function()
setTimer(destroyElement, 5000, 1, veh)
setTimer(destroyElement, 5000, 1, vehCol)
end)
end
end
xmlSaveFile(xml)
xmlUnloadFile(xml)
end
end
end
addEvent("wyprowadz", true)
addEventHandler("wyprowadz", getRootElement(), wyprowadz)
 
function nowyplik()
local xml = xmlCreateFile("config.xml","config")
local iloscbaz = xmlCreateChild ( xml, "IloscBaz" )
local ilbaz = xmlNodeSetValue ( iloscbaz, "0" )
local bazy = xmlCreateChild ( xml, "Bazy" )
xmlSaveFile(xml)
xmlUnloadFile(xml)
end
 
addCommandHandler("ff212x", nowyplik)
 
function aktualizuj ()
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("config.xml")
bazy = xmlFindChild ( xml, "Bazy", 0 )
    local bazylista = xmlNodeGetChildren(bazy)
    for i,node in ipairs(bazylista) do
proxy = xmlNodeGetValue(node)
local bazzax = xmlLoadFile("Bazy/"..proxy..".xml")
local nodeustx = xmlFindChild( bazzax, "Ustawienia", 0 )
local pozxx = xmlFindChild( nodeustx, "POSX", 0 )
local pozyx = xmlFindChild( nodeustx, "POSY", 0 )
local pozzx = xmlFindChild( nodeustx, "POSZ", 0 )
local pojazdyx = xmlFindChild( nodeustx, "Pojazdy", 0 )
local maxpojx = xmlFindChild( nodeustx, "MaxPojazdow", 0 )
local gangx = xmlFindChild( nodeustx, "Gang", 0 )
local liderx = xmlFindChild( nodeustx, "Lider", 0 )
local poziom = xmlFindChild( nodeustx, "PoziomBazy", 0 )
posx = xmlNodeGetValue(pozxx)
posy = xmlNodeGetValue(pozyx)
posz = xmlNodeGetValue(pozzx)
pojazd = xmlNodeGetValue(pojazdyx)
maxpoj = xmlNodeGetValue(maxpojx)
gang = xmlNodeGetValue(gangx)
lider = xmlNodeGetValue(liderx)
poziomek = xmlNodeGetValue(poziom)
xmlUnloadFile(bazzax)
triggerClientEvent(source, "Zaktualizuj",root, gang, lider, posx,posy,posz,pojazd,maxpoj,proxy,poziomek)
end
        xmlUnloadFile(xml)
    end
end
addEvent("Aktualizuj", true)
addEventHandler("Aktualizuj", getRootElement(), aktualizuj)
 
function aktualizujbx ()
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("config.xml")
bazy = xmlFindChild ( xml, "Bazy", 0 )
    local bazylista = xmlNodeGetChildren(bazy)
    for i,node in ipairs(bazylista) do
proxy = xmlNodeGetValue(node)
local bazzax = xmlLoadFile("Bazy/"..proxy..".xml")
local nodeustx = xmlFindChild( bazzax, "Ustawienia", 0 )
local pozxx = xmlFindChild( nodeustx, "POSX", 0 )
local pozyx = xmlFindChild( nodeustx, "POSY", 0 )
local pozzx = xmlFindChild( nodeustx, "POSZ", 0 )
local pojazdyx = xmlFindChild( nodeustx, "Pojazdy", 0 )
local maxpojx = xmlFindChild( nodeustx, "MaxPojazdow", 0 )
local gangx = xmlFindChild( nodeustx, "Gang", 0 )
local liderx = xmlFindChild( nodeustx, "Lider", 0 )
local poziom = xmlFindChild( nodeustx, "PoziomBazy", 0 )
posx = xmlNodeGetValue(pozxx)
posy = xmlNodeGetValue(pozyx)
posz = xmlNodeGetValue(pozzx)
pojazd = xmlNodeGetValue(pojazdyx)
maxpoj = xmlNodeGetValue(maxpojx)
gang = xmlNodeGetValue(gangx)
lider = xmlNodeGetValue(liderx)
poziomek = xmlNodeGetValue(poziom)
xmlUnloadFile(bazzax)
gangx = getElementData(source,"gang")
if gang == gangx then
triggerClientEvent(source, "Zaktualizuj",root, gang, lider, posx,posy,posz,pojazd,maxpoj,proxy,poziomek)
end
end
        xmlUnloadFile(xml)
    end
end
addEvent("Aktualizujb", true)
addEventHandler("Aktualizujb", getRootElement(), aktualizujbx)
 
function Sprawdzpojazdy (gang, lider, x,y,z, poj, maxpoj, id, poziom)
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("Bazy/"..id..".xml")
local ust = xmlFindChild( xml, "Ustawienia", 0 )
local zaparko = xmlFindChild( ust, "Zaparkowane", 0 )
local lol = xmlNodeGetChildren(zaparko)
    for i,node in ipairs(lol) do
local pojazd = xmlFindChild( node, "Pojazd", 0 )
local Parkowal = xmlFindChild( node, "Parkowal", 0 )
local DataParkowania = xmlFindChild( node, "DataParkowania", 0 )
local Dostepny = xmlFindChild( node, "Jest", 0 )
Jest = xmlNodeGetValue(Dostepny)
if Jest == "TAK" then
pojazd = xmlNodeGetValue(pojazd)
park = xmlNodeGetValue(Parkowal)
Data = xmlNodeGetValue(DataParkowania)
triggerClientEvent(source, "Pojazdyx",root, pojazd,park,data)
end
end
        xmlUnloadFile(xml)
    end
end
addEvent("Sprawdzpojazdy", true)
addEventHandler("Sprawdzpojazdy", getRootElement(), Sprawdzpojazdy)
 
function zaladujbazy()
local xml = xmlLoadFile("config.xml")
bazy = xmlFindChild ( xml, "Bazy", 0 )
    local bazylista = xmlNodeGetChildren(bazy)
    for i,node in ipairs(bazylista) do
proxy = xmlNodeGetValue(node)
local bazzax = xmlLoadFile("Bazy/"..proxy..".xml")
local nodeustx = xmlFindChild( bazzax, "Ustawienia", 0 )
local pozxx = xmlFindChild( nodeustx, "POSX", 0 )
local pozyx = xmlFindChild( nodeustx, "POSY", 0 )
local pozzx = xmlFindChild( nodeustx, "POSZ", 0 )
local po = xmlFindChild( nodeustx, "PoziomBazy", 0 )
posx = xmlNodeGetValue(pozxx)
posy = xmlNodeGetValue(pozyx)
posz = xmlNodeGetValue(pozzx)
poziomek = xmlNodeGetValue(po)
if poziomek == "1" then
baza = createObject ( 3965, tonumber(posx), tonumber(posy), tonumber(posz-2), 0, 0, 0 )
xmlUnloadFile(bazzax)
elseif poziomek == "2" then
baza = createObject ( 3966, tonumber(posx), tonumber(posy), tonumber(posz-2), 0, 0, 0 )
xmlUnloadFile(bazzax)
elseif poziomek == "3" then
baza = createObject ( 3964, tonumber(posx), tonumber(posy+20), tonumber(posz-2), 0, 0, 0 )
xmlUnloadFile(bazzax)
end
    end
        xmlUnloadFile(xml)
end
addEventHandler ( "onResourceStart", getRootElement(), zaladujbazy )
 
function wejdz (gang, lider,x,y,z,poj, maxpoj, id)
if not isGuestAccount(getPlayerAccount(source)) then
gangx = getElementData(source, "gang")
if gangx == gang then
setElementPosition ( source, tonumber(x), tonumber(y), tonumber(z) )
outputChatBox ( "Wpisz: /wyjdz, aby wyjść z bazy!", source, 0,255, 0, true )
else
outputChatBox ( "Nie możesz wejść do tej bazy!", source, 255,0, 0, true )
end
    end
end
addEvent("Wejdz", true)
addEventHandler("Wejdz", getRootElement(), wejdz)
 
function wejdzx (gang, lider, pojazd,x,y,z,poj, maxpoj, id,nazwapojazdu)
if not isGuestAccount(getPlayerAccount(source)) then
local xml = xmlLoadFile("Bazy/" ..id..".xml")
ust = xmlFindChild ( xml, "Ustawienia", 0 )
local poj = xmlFindChild( ust, "Pojazdy", 0 )
local maxp = xmlFindChild( ust, "MaxPojazdow", 0 )
gangx = getElementData(source, "gang")
if gang == gangx then
pojj = xmlNodeGetValue(poj)
maxpoj = xmlNodeGetValue(maxp)
if pojj == maxpoj then
outputChatBox ( "Osiągnięto limit pojazdów w bazie!", source, 0,255, 0, true )
else
destroyElement(getElementData(pojazd, "parent"))
destroyElement(pojazd)
xxdd = pojj + 1
local ilbaz = xmlNodeSetValue ( poj, tostring(xxdd) )
--outputChatBox ( "Wpisz: /wyjdz, aby wyjść z bazy!", source, 0,255, 0, true )
outputChatBox ( "Zaparkowałeś/aś pojazd! Aktualna ilość pojazdów to:" .. xxdd .."/"..maxpoj.."!", source, 0,255, 0, true )
setElementData ( source, "bazaID", id )
local pojx = xmlFindChild( ust, "Zaparkowane", 0 )
local poj = xmlCreateChild(pojx, "Poj")
local time = getRealTime()
local hours = time.hour
local minutes = time.minute
local monthday = time.monthday
local month = time.month 
parkowal = getPlayerName(source)
xmlNodeSetValue (xmlCreateChild ( poj, "Pojazd"), tostring(nazwapojazdu) )
xmlNodeSetValue (xmlCreateChild ( poj, "Nazwa"), tostring(nazwapojazdu) )
xmlNodeSetValue (xmlCreateChild ( poj, "Parkowal"), tostring(parkowal) )
xmlNodeSetValue (xmlCreateChild ( poj, "DataParkowania"), tostring(month).."miesiac,"..tostring(monthday).."dzien,godzina:"..tostring(hours)..":"..tostring(minutes).."" )
xmlNodeSetValue (xmlCreateChild ( poj, "Jest"), "TAK" )
xmlSaveFile(xml)
end
xmlUnloadFile(xml)
end
end
end
addEvent("Wejdzzpojazdem", true)
addEventHandler("Wejdzzpojazdem", getRootElement(), wejdzx)
 
function info ()
if not isGuestAccount(getPlayerAccount(source)) then
pp = getElementData(source, "PP")
if pp >= tonumber(50) then
xml = xmlLoadFile ( "config.xml" )
if xml then
local node = xmlFindChild( xml, "IloscBaz", 0 )
local ilosc = xmlNodeGetValue ( node )
local gangx = getElementData(source,"gang")
porr = ilosc + 1
local ilbaz = xmlNodeSetValue ( node, tostring(porr) )
local nodelol = xmlFindChild( xml, "Bazy", 0 )
local baz = xmlCreateChild(nodelol, "Baza")
local ilbaz = xmlNodeSetValue ( baz, "Gang"..tostring(porr).."" )
liderx = getAccountName(getPlayerAccount(source))
local x,y,z = getElementPosition( source )
local xmlxd = xmlCreateFile("Bazy/Gang"..porr..".xml","config")
local ustx = xmlCreateChild(xmlxd, "Ustawienia")
local pojazdy = xmlCreateChild ( ustx, "Pojazdy" )
local pojazdymax = xmlCreateChild ( ustx, "MaxPojazdow" )
local poziombazy = xmlCreateChild ( ustx, "PoziomBazy" )
local gng = xmlCreateChild ( ustx, "Gang" )
local lid = xmlCreateChild ( ustx, "Lider" )
local wartoscpoj = xmlNodeSetValue ( pojazdy, "0" )
local wartoscpojmax = xmlNodeSetValue ( pojazdymax, "5" )
local wartoscgang = xmlNodeSetValue ( gng, gangx )
local wartosclider = xmlNodeSetValue ( lid, liderx )
local poziomek = xmlNodeSetValue ( poziombazy, "1" )
local posx = xmlCreateChild ( ustx, "POSX" )
local posy = xmlCreateChild ( ustx, "POSY" )
local posz = xmlCreateChild ( ustx, "POSZ" )
local p = xmlCreateChild ( ustx, "Zaparkowane" )
iloscx = getElementData(source,"PP")
setElementData(source,"PP",iloscx - 50)
pan(source)
outputChatBox ( "Kupiłeś/aś małą bazę! -50PP!", source, 0, 255, 0, true )
zy = 3000
yy = 0 + (ilosc-50) * 100
xy = 0 + 500
local wartposx = xmlNodeSetValue ( posx, tostring(xy) )
local wartposy = xmlNodeSetValue ( posy, tostring(yy) )
local wartposz = xmlNodeSetValue ( posz, tostring(zy) )
createObject ( 3965, xy, yy, zy-2, 0, 0, 0 )
xmlSaveFile(xml)
xmlUnloadFile(xml)
xmlSaveFile(xmlxd)
xmlUnloadFile(xmlxd)
end
else
outputChatBox ( "Nie stać Cię!", source, 255, 0, 0, true )
end
else
outputChatBox ( "Nie możesz kupić!", source, 255, 0, 0, true )
end
end
addEvent("StworzBaze", true)
addEventHandler("StworzBaze", getRootElement(), info)
 
function infoo ()
if not isGuestAccount(getPlayerAccount(source)) then
pp = getElementData(source, "PP")
if pp >= tonumber(100) then
xml = xmlLoadFile ( "config.xml" )
if xml then
local node = xmlFindChild( xml, "IloscBaz", 0 )
local ilosc = xmlNodeGetValue ( node )
local gangx = getElementData(source,"gang")
porr = ilosc + 1
local ilbaz = xmlNodeSetValue ( node, tostring(porr) )
local nodelol = xmlFindChild( xml, "Bazy", 0 )
local baz = xmlCreateChild(nodelol, "Baza")
local ilbaz = xmlNodeSetValue ( baz, "Gang"..tostring(porr).."" )
liderx = getAccountName(getPlayerAccount(source))
local x,y,z = getElementPosition( source )
local xmlxd = xmlCreateFile("Bazy/Gang"..porr..".xml","config")
local ustx = xmlCreateChild(xmlxd, "Ustawienia")
local pojazdy = xmlCreateChild ( ustx, "Pojazdy" )
local pojazdymax = xmlCreateChild ( ustx, "MaxPojazdow" )
local poziombazy = xmlCreateChild ( ustx, "PoziomBazy" )
local gng = xmlCreateChild ( ustx, "Gang" )
local lid = xmlCreateChild ( ustx, "Lider" )
local wartoscpoj = xmlNodeSetValue ( pojazdy, "0" )
    local wartoscpojmax = xmlNodeSetValue ( pojazdymax, "10" )
local wartoscgang = xmlNodeSetValue ( gng, gangx )
    local wartosclider = xmlNodeSetValue ( lid, liderx )
local poziomek = xmlNodeSetValue ( poziombazy, "2" )
local posx = xmlCreateChild ( ustx, "POSX" )
local posy = xmlCreateChild ( ustx, "POSY" )
local posz = xmlCreateChild ( ustx, "POSZ" )
local p = xmlCreateChild ( ustx, "Zaparkowane" )
iloscx = getElementData(source,"PP")
setElementData(source,"PP",iloscx - 100)
pan(source)
outputChatBox ( "Kupiłeś/aś średnią bazę! -100PP!", source, 0, 255, 0, true )
zy = 3000
yy = 0 + (ilosc-50) * 100
xy = 0 + 500
    local wartposx = xmlNodeSetValue ( posx, tostring(xy) )
local wartposy = xmlNodeSetValue ( posy, tostring(yy) )
local wartposz = xmlNodeSetValue ( posz, tostring(zy) )
createObject ( 3966, xy, yy, zy-2, 0, 0, 0 )
xmlSaveFile(xml)
xmlUnloadFile(xml)
xmlSaveFile(xmlxd)
xmlUnloadFile(xmlxd)
end
else
outputChatBox ( "Nie stać Cię!", source, 255, 0, 0, true )
end
else
outputChatBox ( "Nie możesz kupić!", source, 255, 0, 0, true )
end
end
addEvent("StworzBazee", true)
addEventHandler("StworzBazee", getRootElement(), infoo)
 
function infooo ()
if not isGuestAccount(getPlayerAccount(source)) then
pp = getElementData(source, "PP")
if pp >= tonumber(200) then
xml = xmlLoadFile ( "config.xml" )
if xml then
local node = xmlFindChild( xml, "IloscBaz", 0 )
local ilosc = xmlNodeGetValue ( node )
local gangx = getElementData(source,"gang")
porr = ilosc + 1
local ilbaz = xmlNodeSetValue ( node, tostring(porr) )
local nodelol = xmlFindChild( xml, "Bazy", 0 )
local baz = xmlCreateChild(nodelol, "Baza")
local ilbaz = xmlNodeSetValue ( baz, "Gang"..tostring(porr).."" )
liderx = getAccountName(getPlayerAccount(source))
local x,y,z = getElementPosition( source )
local xmlxd = xmlCreateFile("Bazy/Gang"..porr..".xml","config")
local ustx = xmlCreateChild(xmlxd, "Ustawienia")
local pojazdy = xmlCreateChild ( ustx, "Pojazdy" )
local pojazdymax = xmlCreateChild ( ustx, "MaxPojazdow" )
local poziombazy = xmlCreateChild ( ustx, "PoziomBazy" )
local gng = xmlCreateChild ( ustx, "Gang" )
local lid = xmlCreateChild ( ustx, "Lider" )
local wartoscpoj = xmlNodeSetValue ( pojazdy, "0" )
    local wartoscpojmax = xmlNodeSetValue ( pojazdymax, "20" )
local wartoscgang = xmlNodeSetValue ( gng, gangx )
    local wartosclider = xmlNodeSetValue ( lid, liderx )
local poziomek = xmlNodeSetValue ( poziombazy, "3" )
local posx = xmlCreateChild ( ustx, "POSX" )
local posy = xmlCreateChild ( ustx, "POSY" )
local posz = xmlCreateChild ( ustx, "POSZ" )
local p = xmlCreateChild ( ustx, "Zaparkowane" )
iloscx = getElementData(source,"PP")
setElementData(source,"PP",iloscx - 200)
pan(source)
outputChatBox ( "Kupiłeś/aś dużą bazę! -200PP!", source, 0, 255, 0, true )
zy = 3000
yy = 0 + (ilosc-50) * 100
xy = 0 + 500
    local wartposx = xmlNodeSetValue ( posx, tostring(xy) )
local wartposy = xmlNodeSetValue ( posy, tostring(yy) )
local wartposz = xmlNodeSetValue ( posz, tostring(zy) )
createObject ( 3964, xy, yy+20, zy-2, 0, 0, 0 )
xmlSaveFile(xml)
xmlUnloadFile(xml)
xmlSaveFile(xmlxd)
xmlUnloadFile(xmlxd)
end
else
outputChatBox ( "Nie stać Cię!", source, 255, 0, 0, true )
end
else
outputChatBox ( "Nie możesz kupić!", source, 255, 0, 0, true )
end
end
addEvent("StworzBazeee", true)
addEventHandler("StworzBazeee", getRootElement(), infooo)
 
function fyjdz (source)
local x,y,z = getElementPosition( source )
if z >= 2500 then
if isPedInVehicle ( source ) then
idbazy = getElementData(source, "bazaID")
local xml = xmlLoadFile("Bazy/"..idbazy..".xml")
ust = xmlFindChild ( xml, "Ustawienia", 0 )
local poj = xmlFindChild( ust, "Pojazdy", 0 )
local maxp = xmlFindChild( ust, "MaxPojazdow", 0 )
pojj = xmlNodeGetValue(poj)
maxpoj = xmlNodeGetValue(maxp)
xxdd = pojj - 1
local ilbaz = xmlNodeSetValue ( poj, tostring(xxdd) )
outputChatBox ( "Wyjechałeś/aś pojazdem! Aktualna ilość pojazdów w bazie to:" .. xxdd .."/"..maxpoj.."!", source, 0,255, 0, true )
xmlSaveFile(xml)
xmlUnloadFile(xml)
local pojazd = getPedOccupiedVehicle(source)
setElementPosition ( pojazd, 2511, -1670.7, 14.8 )
else
randomA = math.random(0,10)
randomB = math.random(0,10)
setElementPosition ( source, -49.0615234375+randomA,-313.9140625+randomB,5.4296875 )
end
end
end
addCommandHandler ( "wyjdz", fyjdz  )
 
function onPlayerQuit ( )
      local playeraccount = getPlayerAccount ( source )
      if ( playeraccount ) then
            bazaIDx = getElementData(source,"bazaID")
            setAccountData ( playeraccount, "bazaIDx", bazaIDx )
bazaIDxx = getElementData(source,"PP")
            setAccountData ( playeraccount, "PPx", bazaIDxx )
      end
end
 
function onPlayerLogin ( )
      local playeraccount = getPlayerAccount ( source )
      if ( playeraccount ) then
            local lol = getAccountData ( playeraccount, "bazaIDx" )
local lollol = getAccountData ( playeraccount, "PPx" )
            if ( lol ) then
            setElementData ( source, "bazaID", lol )
setElementData ( source, "PP", lollol )
      end
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
 
function money_func(player,cmd,playername,money)
accountname = getAccountName(getPlayerAccount(player))
if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then
    if playername and money then
      local player2 = getPlayerFromName(playername)
      if player2 then
  setElementData(player2,"PP",tonumber(money))
  outputChatBox ( "Otrzymałeś/aś: " .. money.. " punktów PP!", player2, 0,255, 0, true )
  outputChatBox ( "Gracz: " ..getPlayerName(player2) .." otrzymał: " .. money.. " punktów PP!", player, 0,255, 0, true )
  end
end
else
outputChatBox("Nie masz praw!",player)
end
end
addCommandHandler("dajpp",money_func)
 
 
local hillArea = createColRectangle ( -374.513671875,-573.9697265625, 550, 550 )
local hillRadar = createRadarArea ( -374.513671875,-573.9697265625, 550, 550, 0, 255, 0, 175 )
 
function hill_Enter ( thePlayer, matchingDimension )
    if (getElementType(thePlayer) == "player") then
outputChatBox( "Wchodzisz do bezpiecznej strefy!", thePlayer, 255, 255, 109 )
toggleControl (thePlayer, "aim_weapon", false)
setElementData(thePlayer, "greenzone", "TAK" )
end
end
addEventHandler ( "onColShapeHit", hillArea, hill_Enter )
 
function hill_Exit ( thePlayer, matchingDimension )
if (getElementType(thePlayer) == "player") then
outputChatBox ( "Wychodzisz z bezpiecznej strefy!", thePlayer, 255, 255, 109 )
toggleControl (thePlayer, "aim_weapon", true)
setElementData(thePlayer, "greenzone", "NIE" )
setElementData(thePlayer, "blood", 999999 )
end
end
addEventHandler ( "onColShapeLeave", hillArea, hill_Exit )
 
 
 function allPlayersPayDay()
  local allPlayers = getElementsByType("player")
  for index,value in ipairs(allPlayers) do 
    if getElementData(value, "greenzone") == "TAK" then
setElementData(value, "blood", 999999 )
setElementData(value, "bleeding", 0)
setElementData(value, "brokenbone", false)
setElementData(value, "pain", false)
setElementData(value, "greenzone", "TAK" )
 
if isPlayerInVehicle ( value ) then
local veh = getPedOccupiedVehicle(value)
fixVehicle ( veh )
end
else
setElementData(value, "greenzone", "NIE" )
end
end
end
 
function onResourceStart(thisResource)
  setTimer ( allPlayersPayDay, 250, 0 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart )
 
function check ( player, seat, jacked )
if getElementData(source, "private") then
if getElementData(source, "owner") == getAccountName(getPlayerAccount(player)) or getElementData(player,"greenzone") == "NIE" or getElementData(source, "gangpojazdu") == getElementData(player, "gang")  then
else
cancelEvent()
outputChatBox("Ten pojazd nalezy do gangu: ".. getElementData(source, "gangpojazdu").." !", player)
end
end
end
addEventHandler ( "onVehicleStartEnter", getRootElement(), check )
 
function setcar( veh, seat )
local pojazd = getPedOccupiedVehicle(source)
setElementData(pojazd, "private", true)
setElementData(pojazd, "owner", getAccountName(getPlayerAccount(source)))
setElementData(pojazd, "gangpojazdu", getElementData(source,"gang"))
setVehicleFrozen ( pojazd, false )
end
addEventHandler("onPlayerVehicleEnter", getRootElement(), setcar)
 
function removeHelmetOnExit ( theVehicle, seat, jacked )
    if getElementData(source,"greenzone") == "TAK" then
        setVehicleFrozen ( theVehicle, true )
    end
end
addEventHandler ( "onPlayerVehicleExit", getRootElement(), removeHelmetOnExit )ementData(source,"gang"))
setVehicleFrozen ( pojazd, false )
end
addEventHandler("onPlayerVehicleEnter", getRootElement(), setcar)
 
function removeHelmetOnExit ( theVehicle, seat, jacked )
    if getElementData(source,"greenzone") == "TAK" then
        setVehicleFrozen ( theVehicle, true )
    end
end
addEventHandler ( "onPlayerVehicleExit", getRootElement(), removeHelmetOnExit )
 

...................\/...................
...................\/...................
...................\/...................

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...