Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-03-13, 19:11


EseJax







Wiek: 31
Na forum: 4227 dni
Posty: 67
Nick w MP: Toffy.

Piwa: 983

Respekt: 55,3

Ostrzeżeń: 100%
Dzie? dobry, przesiedzia?em godzink? na pisaniu kodu na z?om, no i bez ?adnych test?w doko?czy?em go, ale gdy spr?bowa?em odpali?.. patrze, b??d, wbijam w skrypt, szukam b??du ale nie ma bata, nic nie znajduje, dlatego zwracam si? o pomoc..
Skrypt by? pisany tylko po stronie serwera.
local markery={
    -- Opis nad markerem, x,y,z, int, dim
    {"PREMIUM\nZ?omowanie pojazd?w\nAby zez?omowa? pojazd wpisz: /zezlomuj\nAby sprawdzi? ile dostaniesz pieni?dzy wpisz /iledostane", -1852.20, -1698.82, 40.87},
}


for i,v in pairs(markery) do
    zlomik=createMarker(v[2], v[3], v[4]-0.90, "cylinder", 8, 255, 11, 11, 125)
    setElementDimension(zlomik, v[6] or 0)
    setElementInterior(zlomik, v[5] or 0)
    
    mzlom=zlomik
    
    local t=createElement("text")
    setElementData(t,"name",v[1])
    setElementPosition(t,v[2],v[3],v[4])
    setElementDimension(t, v[6] or 0)
    setElementInterior(t, v[5] or 0)
end

-- nazwa, model, cena, x,y,z,rx,ry,rz, sprzeda?
local zlom = {
    {'Manana', 410, 2000},
    {'Perennial', 404, 1700},
    {'Moonbeam', 418, 1500},
    {'Walton', 478, 800},
    {'Sabre', 475, 16000},
    {'Stallion', 439, 14000},
    {'Glendale', 466, 9500},
    {'Tampa', 549, 7000},
    {'Clover', 542, 9000},
    {'Tahoma', 566, 7500},
    {'Vincent', 540, 5000},
    {'Blista Compact', 496, 6000},
    {'Premier' , 426, 10000},
    {'Sunrise' , 550, 11000},
    {'Fortune' , 526, 7000},
    {'Virgo' , 491, 6000},
    {'Stratum' , 561, 16000},
    {'Bullet', getVehicleModelFromName('Bullet'), 190000},
    {'Zr-350', getVehicleModelFromName('ZR-350'), 115000},
    {'Comet', getVehicleModelFromName('Comet'), 100000},
    {'Cheetah', getVehicleModelFromName('Cheetah'), 130000},
    {'Banshee', getVehicleModelFromName('Banshee'), 175000},
    {'Sultan', getVehicleModelFromName('Sultan'), 100000},
    {'Elegy', getVehicleModelFromName('Elegy'), 110000},
    {'Buffalo', getVehicleModelFromName('Buffalo'), 48000},
    {'Infernus', getVehicleModelFromName('Infernus'), 500000},
    {'Turismo', getVehicleModelFromName('Turismo'), 420000},
}

function komenda(plr)
for i,pozycja in pairs(zlom) do
end
local vehicle = getPedOccupiedVehicle ( plr )
if not getElementData(plr,"player:uid") then return end
if not getElementData(vehicle,"vehicle:id") then return end
if not vehicle then outputChatBox("Nie jeste? w ?adnym poje?dzie", plr, 255, 255, 255) return end
if isElementWithinMarker(plr,mzlom) then
if not getElementData(plr,"player:premium") == true then outputChatBox("Musisz posiada? status premium by z?omowa? pojazdy", plr, 255, 255, 255)
if tonumber(getElementData(vehicle,"vehicle:ownedPlayer")) ~= tonumber(getElementData(plr,"player:uid")) then outputChatBox("* Nie jeste? w?a?cicielem pojazdu.", plr, 255, 0, 0) return end
if not getElementModel ( vehicle ) == pozycja[2] then outputChatBox("Nie obs?ugujemy tego typu pojazd?w!", plr, 255, 255, 255)
outputChatBox("Z?omowanie pojazdu o nazwie "..getVehicleName ( vehicle ).." oraz ID: "..getElementData(vehicle,"vehicle:id").."", plr, 255, 255, 255)
local matematyka = pozycja[3]/3
givePlayerMoney ( plr, matematyka )
outputChatBox("Otrzymujesz "..matematyka.." PLN, dzi?kujemy za skorzystanie z naszych us?ug!", plr, 255, 255, 255)
setElementData(vehicle,"vehicle:ownedPlayer",math.random(1,2))
removePedFromVehicle ( plr ) 
setElementPosition ( vehicle, -963.31, -516.21, 25.95 )
setElementPosition ( plr, -1853.42, -1691.15, 41.50 )
end
end
addCommandHandler ( "zezlomuj", komenda )

addEventHandler("onMarkerHit", mzlom, function(el,md)
    outputChatBox("* Wpisz /zezlomuj aby zez?omowa? pojazd", el)
end)

function iledostanehajsu(plr)
for i,hajs in pairs(zlom) do
end
local vehicle = getPedOccupiedVehicle ( plr )
if not getElementData(vehicle,"vehicle:id") then return end
if not getElementData(plr,"player:uid") then return end
if not vehicle then outputChatBox("Nie jeste? w ?adnym poje?dzie", plr, 255, 255, 255) return end
if isElementWithinMarker(plr,mzlom) then 
if tonumber(getElementData(vehicle,"vehicle:ownedPlayer")) ~= tonumber(getElementData(plr,"player:uid")) then outputChatBox("* Nie jeste? w?a?cicielem pojazdu.", plr, 255, 0, 0) return end
local matma = hajs[3]/3
outputChatBox("Za pojazd "..getVehicleName ( vehicle ).." mo?esz otrzyma? "..matma.."PLN", plr, 255, 255, 255)
end
end
addCommandHandler ( "iledostane", iledostanehajsu )

B??d (DB3): 92: 'end' expected (to close 'if' at line 59) near '<eof>'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-13, 19:14


AteX







Wiek: 27
Na forum: 4157 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

funkcja komenda ma o 2 endy za ma?o

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Tagi: złom :: endy..
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Złom, endy.. Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku