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

Wysłany: 2016-02-16, 14:59


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4044 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

czemu tez skrypt nie dzia?a nawet z dat? http://www.speedyshare.com/TmgpG/gielda.zip

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 15:01


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Wstaw kod i napisz co Ci nie dzia?a.

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 15:03


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4044 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

Kod:


local marker = createMarker(-2153.8, -749.9, 31.0, "cylinder", 3.0, 255, 0, 0, 125) -- marker sprzeda??y
local marker_b = createMarker(-2153.3, -743.4, 31.0, "cylinder", 5.0, 0, 150, 0, 125) -- marker kupna


local function searchVehFromID ( id ) -- Uzupelnic sobie swoimi element datami
for _,v in ipairs ( getElementsByType ( "vehicle" ) ) do
if getElementData ( v, "id" ) == tonumber ( id ) then
return v
end
end
return false
end

local function isOwner ( auto, plr )
if getElementData ( veh, "owner" ) == getPlayerName ( plr ) then
return true
end
return false
end

timer = {}

local function sendOffer ( gracz, pojazd, plr, cena )
name = getVehicleName ( pojazd )
id = getElementData ( pojazd, "id" ) or "Brak"
setElementData ( gracz, "Oferta", true )
setElementData ( gracz, "Pojazd", name )
setElementData ( gracz, "ID", id )
setElementData ( gracz, "Oferujacy", getPlayerName ( plr ) )
setElementData ( gracz, "Cena", cena )
outputChatBox ( "Gracz "..getElementData ( gracz, "Oferujacy" ).." wysla?‚ Ci ofert?™ sprzeda??y pojazdu "..name.." ( ID "..id.." ) w cenie "..string.format ( "%0.2f", cena ).." z?‚", gracz, 255, 255, 255 )
outputChatBox ( "Wpisz /przyjmij, aby kupi?‡. Masz 15 sek na reakcj?™.", gracz, 255, 255, 255 )
timer[1] = setTimer ( setElementData, 15000, 1, gracz, "Oferta", false )
timer[2] = setTimer ( setElementData, 15000, 1, gracz, "Pojazd", false )
timer[3] = setTimer ( setElementData, 15000, 1, gracz, "ID", false )
timer[4] = setTimer ( setElementData, 15000, 1, gracz, "Oferujacy", false )
timer[5] = setTimer ( setElementData, 15000, 1, gracz, "Cena", false )
timer[6] = setTimer ( outputChatBox, 15000, 1, "Oferta wygas?‚a.", gracz, 255, 255, 255 )
timer[7] = setTimer ( outputChatBox, 15000, 1, "Oferta wygas?‚a.", plr, 255, 255, 255 )
end


addCommandHandler ( "przyjmij", function ( plr, cmd )
if not isElementWithinMarker(plr, marker_b) then return end
if not getElementData ( plr, "Oferta" ) then
return outputChatBox ( "Nie dosta?‚e?› oferty kupna pojazdu b?…d?? oferta wygas?‚a", plr, 255, 255, 255 ) end
id = tonumber ( getElementData ( plr, "ID" ) )
name = getElementData ( plr, "Pojazd" )
oferujacy = getElementData ( plr, "Oferujacy" )
cena = tonumber ( getElementData ( plr, "Cena" ) )
pojazd = searchVehFromID ( id )
if not pojazd then
return outputChatBox ( "Nie znaleziono pojazdu o ID "..id.."", plr, 255, 255, 255 ) end
if tonumber ( getPlayerMoney ( plr ) ) < cena *100 then
return outputChatBox ( "Nie posiadasz "..string.format ( "%0.2f", cena ).." z?‚ na zakup tego pojazdu", plr, 255, 255, 255 ) end
setElementData ( pojazd, "wlasciciel", getPlayerName ( plr ) )
outputChatBox ( "Kupi?‚e?› pojazd "..name.." ( ID "..id.." ) od gracza "..oferujacy.."", plr, 0, 255, 0 )
outputChatBox ( "Gracz "..getPlayerName ( plr ).." przyj?…?‚ ofert?™ kupna pojazdu!", getPlayerFromName ( oferujacy ), 0, 255, 0 )
setElementData ( plr, "Oferta", false )
setElementData ( plr, "Pojazd", false )
setElementData ( plr, "ID", false )
setElementData ( plr, "Oferujacy", false )
setElementData ( plr, "Cena", false )
takePlayerMoney ( plr, cena*100 )
for k,_ in ipairs ( timer ) do
if isTimer ( timer[k] ) then
killTimer ( timer[k] )
end
end
end)



addCommandHandler ( "auto.sprzedaj", function ( plr, cmd, id, gracz, cena )
if not isElementWithinMarker(plr, marker) or not isElementWithinMarker(gracz, marker_b) then return end
if not id or not gracz or not cena or id == nil or gracz == nil or cena == nil then
return outputChatBox ( "[U??ycie] /auto.sprzedaj [ID_Pojazdu] [Cz?™?›?‡_Nicku_Gracza] [Cena]", plr, 255, 255, 255 ) end
id = tonumber ( id )
auto = searchVehFromID ( id )
if not auto then
return outputChatBox ( "Nie znaleziono pojazdu o ID "..id.."", plr ) end
if not isOwner ( auto, plr ) then
return outputChatBox ( "Pojazd "..getVehicleName ( auto ).." nie jest Tw??j", plr ) end
kupujacy = exports["GTAO_Gamemode"]:partNick ( plr, gracz ) -- Przerobcie sobie pod swoja funkcje od ID graczy lub po prostu getPlayerFromName powinno zadzialac
if not kupujacy then return end
sendOffer ( kupujacy, auto, plr, cena )
outputChatBox ( "Wys?‚ano ofert?™ sprzeda??y pojazdy do gracza "..getPlayerName ( kupujacy ).."!", plr, 255, 255, 255 )
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 16:44


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Aidis, dodaj w [lua.][/lua.] bez kropek oczywi?cie ;D
I napisz co dok?adnie nie dzia?a, my nie jeste?my jasnowidzami.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 16:48


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4044 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

no niedzia?a nic sie nie pojawia

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-17, 08:12


mlodasnygo







Wiek: 16
Na forum: 3972 dni
Posty: 205

Piwa: 518

Respekt: 161,8
Respekt: 161,8Respekt: 161,8

Wpisz tak jak Ci powiedzia? luki123luki123, wgl odpal to na serwerze, wpisz /debugscript 3 i podaj co tam masz. :)

Podpis
600 dni - 10 marca 2017
:piwo: 500 piw :piwo: - 10 marca 2017
Postaw piwo autorowi tego posta
 

 
Tagi: czemu :: niedziała
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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