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

Wysłany: 2013-03-22, 11:40


twitter89







Wiek: 29
Na forum: 5032 dni
Posty: 23



Respekt: 50

Jak mam dorobi? do tego mete pomocy!


oto kod:



local x,y = guiGetScreenSize()
local marker = getElementByID("Rej_Aut")
local marker1 = getElementByID("Spawn")
local marker2 = getElementByID("SzpitalSF")
local marker3 = getElementByID("Bank")
local marker4 = getElementByID("PrivGaraz")
local blip = createBlipAttachedTo ( marker, 34 )
local blip1 = createBlipAttachedTo ( marker1, 38 )
local blip2 = createBlipAttachedTo ( marker2, 22 )
local blip3 = createBlipAttachedTo ( marker3, 52 )
local blip4 = createBlipAttachedTo ( marker4, 25 )
setElementData(blip,"BlipText","Rejestracja")
setElementData(blip1,"BlipText","Spawn")
setElementData(blip2,"BlipText","Szpital SF")
setElementData(blip3,"BlipText","Bank")
setElementData(blip4,"BlipText","Garaze")
local koszt = 100000
local wymscore = 100
local localPlayer = getLocalPlayer()

gui =
{
window = {};
button = {};
grid = {};
column = {};
label = {};
}

gui.window[1] = guiCreateLabel(x/2-300,y/2-150,600,300,"",false)
gui.grid[1] = guiCreateGridList(15,50,570,200,false,gui.window[1])
gui.column[1] = guiGridListAddColumn(gui.grid[1], "Nazwa", 0.5 )
gui.column[2] = guiGridListAddColumn(gui.grid[1], "Warto??", 0.3 )
gui.button[1] = guiCreateButton(15,270,100,20,"Zamknij",false,gui.window[1])
gui.button[2] = guiCreateButton(485,270,100,20,"Zarejestruj",false,gui.window[1])
gui.label[1] = guiCreateLabel(15,250,200,20,"Mo?liwo?? zarejestrowania: Nie",false,gui.window[1])
guiLabelSetColor(gui.label[1],255,0,0,255)
guiSetVisible(gui.window[1],false)

function getVehicleDataForRegister()
local tabl = {}
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
local health = math.floor(math.max(getElementHealth(vehicle) - 250, 0)/75 * 10)
local handling = getVehicleHandling (vehicle)
table.insert(tabl,{"Nazwa pojazdu",getVehicleName(vehicle)})
table.insert(tabl,{"Tablica rejestracyjna",getVehiclePlateText(vehicle)})
table.insert(tabl,{"Masa",handling['mass'],"--"})
table.insert(tabl,{"Maksymalna pr?dko??",handling['maxVelocity']})
table.insert(tabl,{"Nap?d",handling['driveType']})
table.insert(tabl,{"Typ silnika",handling['engineType']})
table.insert(tabl,{"Stan og?lny pojazdu",health.."%"})
local canRegister = health == 100 and true or false
for i=0, 6 do
local status = getVehiclePanelState (vehicle, i )
local stan = 100 - status*33
if status > 0 then
canRegister = false
end
return tabl,canRegister
end
end
end

function showOkienkoRegiterCar(hitElement)
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
if hitElement == getLocalPlayer() then
local tablet,canRegister = getVehicleDataForRegister()
guiGridListClear(gui.grid[1])
for k,v in ipairs(tablet) do
local row = guiGridListAddRow (gui.grid[1])
guiGridListSetItemText (gui.grid[1], row, gui.column[1], tostring(v[1]), false, false)
guiGridListSetItemText (gui.grid[1], row, gui.column[2], tostring(v[2]), false, false)
end
if getPlayerScore(localPlayer) < wymscore then
canRegister = false
end
guiSetText(gui.label[1],"Mo?liwo?? zarejestrowania: ".. (canRegister and "Tak" or "Nie"))
guiSetEnabled(gui.button[2],canRegister)
guiSetVisible(gui.window[1],true)
setVehicleFrozen(vehicle, true)
setTimer(setVehicleFrozen, 500, 1, vehicle, false)
showCursor(true)
if getPlayerMoney(localPlayer) < koszt then
guiSetEnabled(gui.button[2],false)
end
if getPlayerScore(localPlayer) < wymscore then
guiSetEnabled(gui.button[2],false)
end
end
end
end

function getPlayerScore(player)
if isElement(player) then
local score = getElementData(player,"Score")
if tonumber(score) then
return tonumber(score)
end
end
return tonumber(0)
end

function closeOkienkoRegiterCar()
showCursor(false)
guiSetVisible(gui.window[1],false)
end

function closeOkienkoRegiterCars()
showCursor(false)
guiSetVisible(gui.window[1],false)
end

function onClick()
if source == gui.button[1] then
showCursor(false)
guiSetVisible(gui.window[1],false)
elseif source == gui.button[2] then
local _,canRegister = getVehicleDataForRegister()
if canRegister then
if getPlayerScore(localPlayer) < wymscore then
else
triggerServerEvent("registerCar",getLocalPlayer(),localPlayer,getPedOccupiedVehicle(localPlayer))
end
end
end
end

function outputChatBox(error)
triggerEvent("createcustom",localPlayer,error)
end

addEvent("auta:client:closeOkienkoRegisterCars",true)
addEventHandler("auta:client:closeOkienkoRegisterCars",getRootElement(),closeOkienkoRegiterCars)
addEventHandler("onClientMarkerHit",marker,showOkienkoRegiterCar)
addEventHandler("onClientGUIClick",getResourceRootElement(getThisResource()),onClick)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-22, 12:53


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

<meta>
<script src="Nazwa.lua" type="client" />
</meta>

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-22, 13:43


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

twitter89, kod wstawiaj w [lua.][/lua.] (usu? kropki)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-22, 15:07


twitter89







Wiek: 29
Na forum: 5032 dni
Posty: 23



Respekt: 50

A wie mo?e kto? jak si? u?ywa tej rejestracji aut bo ja dosta?em kod od kolegi.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-22, 15:19


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

To zapytaj kolegi.
W kradzie?y skrypt?w nie pomagamy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-22, 16:18


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

[clo]

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Tagi: rejestracja :: aut
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Rejestracja aut 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