Wysłany: 2015-11-21, 12:20
ironmaiden666
Voight...
Wiek: 30 Na forum: 4020 dni Posty: 125
Nick w MP: Irons
Piwa : 2941
Cze??, kolejna pro?ba dotycz?ca skryptu pana prezesa
http://hostuje.net/file.p...69b94a1ae77887a
Aby zablokowa? cene np. -999999 ? Pr?bowa?em co? takiego:
Kod: function onSprzedazClickSprzedaj()
local cena = guiGetText(guig[16])
if #cena >= 100 then
local cena = tonumber(cena)
if type(cena) == "number" then
if cena >= 100 then
showCursor(false)
guiSetVisible(guig[13], false)
--
triggerServerEvent("zaproponujKupnoPojazdu", localPlayer, savePLAYER, saveVEHICLE, cena)
else
outputChatBox("Wpisz cen? za jak? chcesz sprzeda? sw?j pojazd.", 255, 255, 255, true)
end
end
end
end
jednak teraz jak klikam "Sprzedaj" nic sie nie dzieje nic w DS3 tez nie ma
Prosz? o pomoc nagradzam tym co zawsze czyli piwkiem oraz respektem
Podpis
Intelligence gonna get you..
Wysłany: 2015-11-21, 14:07
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4049 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
local sprzedaz = createMarker ( x , y , z , "cylinder" , 2 , 255 , 0 , 0 , 100 )
-- setElementInterior ( sprzedaz , 3 )
-- setElementDimension ( sprzedaz , 1 )
function onSprzedazHit ( hitElement , dim )
if getElementType ( hitElement ) == "player" then
local players = getElementsInMarker ( sprzedaz )
triggerClientEvent ( hitElement , "pokazGUISprzedazy" , root , players )
end
end
addEventHandler ( "onMarkerHit" , sprzedaz , onSprzedazHit )
function getElementsInMarker ( marker )
elements = {}
for i , v in pairs ( getElementsByType ( "player" )) do
if isElementWithinMarker ( v , marker ) then
table . insert ( elements , v )
end
end
return elements
end
addEvent ( "pobierzListePojazdow" , true )
addEventHandler ( "pobierzListePojazdow" , getRootElement (),
function()
local account = getPlayerAccount ( source )
if account then
local wlasciciel = getAccountName ( account )
local query = dbQuery ( handler , "SELECT * FROM pojazdy WHERE wlasciciel='" .. wlasciciel .. "'" )
local result , num_rows , errormsg = dbPoll ( query , - 1 )
triggerClientEvent ( source , "pokazListePojazdow" , root , result )
end
end )
ofertyKupna = {}
addEvent ( "zaproponujKupnoPojazdu" , true )
addEventHandler ( "zaproponujKupnoPojazdu" , getRootElement (),
function( gracz , id , cena )
if not ofertyKupna [ gracz ] then
ofertyKupna [ gracz ] = {}
ofertyKupna [ gracz ] = { gracz , source , id , cena }
if cena < 1 then
outputChatBox ( "*Wpisa?e? niepoprawn? cen? sprzeda?y!" , source , 255 , 0 , 0 )
else
local query = dbQuery ( handler , "SELECT model,przebieg FROM pojazdy WHERE id='" .. id .. "'" )
local result , num_rows , errormsg = dbPoll ( query , - 1 )
local pojazd = result [ 1 ]. model
local pojazd = getVehicleNameFromModel ( pojazd )
local przebieg = result [ 1 ]. przebieg
triggerClientEvent ( gracz , "pokazOferteKupnaPojazdu" , root , source , pojazd , cena , przebieg )
else
outputChatBox ( "Ten gracz w tym momencie ma otwart? inn? ofert? kupna pojazdu..." , source , 255 , 255 , 255 , true )
end
end )
addEvent ( "odrzucOferteKupna" , true )
addEventHandler ( "odrzucOferteKupna" , getRootElement (),
function()
if ofertyKupna [ source ] then
local od_kogo_oferta = ofertyKupna [ source ][ 2 ]
if isElement ( od_kogo_oferta ) then
outputChatBox ( "Gracz " .. getPlayerName ( source ).. " odrzuci? Twoj? ofert? kupna pojazdu." , od_kogo_oferta , 255 , 255 , 255 , true )
end
ofertyKupna [ source ] = nil
end
end )
addEvent ( "przyjmijOferteKupna" , true )
addEventHandler ( "przyjmijOferteKupna" , getRootElement (),
function()
if ofertyKupna [ source ] then
local account = getPlayerAccount ( source )
if account then
local login = getAccountName ( account )
if 5 >= getYourVehicleCount ( login ) then
local od_kogo_oferta = ofertyKupna [ source ][ 2 ]
local veh = ofertyKupna [ source ][ 3 ] -- id pojazdu
local cena = ofertyKupna [ source ][ 4 ]
if isElement ( od_kogo_oferta ) then
local cena = tonumber ( cena )
if getPlayerMoney ( source ) >= cena then
takePlayerMoney ( source , cena )
givePlayerMoney ( od_kogo_oferta , cena )
-- nadpisanie danych
local vehicle = getVehicleByID ( veh )
ustawDanePojazdu ( vehicle , veh , login )
dbExec ( handler , "UPDATE pojazdy SET wlasciciel='" .. login .. "' WHERE id=" .. veh .. "" )
-- chat
local pojazd = getVehicleName ( vehicle )
outputChatBox ( "Gracz " .. getPlayerName ( source ).. " przyja? Twoj? ofert? i kupi? Tw?j pojazd " .. pojazd .. " za " .. cena .. "$." , od_kogo_oferta , 255 , 255 , 255 , true )
outputChatBox ( "Kupi?e? pojazd " .. pojazd .. " za " .. cena .. "$ od gracza " .. getPlayerName ( od_kogo_oferta ).. "." , source , 255 , 255 , 255 , true )
else
outputChatBox ( "Gracz " .. getPlayerName ( source ).. " nie ma wystarczaj?co pieni?dzy by kupi? Tw?j pojazd." , od_kogo_oferta , 255 , 255 , 255 , true )
outputChatBox ( "Nie masz wystarczaj?co pieni?dzy by kupi? ten pojazd." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "Gracz kt?ry sk?ada? Ci ofert? nie jest ju? online na serwerze." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "Mo?esz posiada? maksymalnie 5 pojazd?w." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "Nie jeste? zalogowany." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "Wyst?pi? b??d, nie mo?esz teraz kupi? pojazdu :|" , source , 255 , 255 , 255 , true )
end
ofertyKupna [ source ] = nil
end )
Zamie? sobie w pliku sprzedaz_s
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2015-11-21, 17:00
ironmaiden666
Voight...
Wiek: 30 Na forum: 4020 dni Posty: 125
Nick w MP: Irons
Piwa : 2941
Nie dzia?a, pokazuje ?e trzeba zamn?c funkcje w 52 czyli
Kod: addEvent("zaproponujKupnoPojazdu", true)
addEventHandler("zaproponujKupnoPojazdu", getRootElement(),
function(gracz, id, cena)
if not ofertyKupna[gracz] then
ofertyKupna[gracz] = {}
ofertyKupna[gracz] = {gracz, source, id, cena}
if cena < 1 then
outputChatBox ("*Wpisa?e? niepoprawn? cen? sprzeda?y!", source, 255, 0, 0)
else
local query = dbQuery(handler, "SELECT model,przebieg FROM pojazdy WHERE id='"..id.."'")
local result, num_rows, errormsg = dbPoll (query, -1)
local pojazd = result[1].model
local pojazd = getVehicleNameFromModel(pojazd)
local przebieg = result[1].przebieg
triggerClientEvent(gracz, "pokazOferteKupnaPojazdu", root, source, pojazd, cena, przebieg)
else
outputChatBox("Ten gracz w tym momencie ma otwart? inn? ofert? kupna pojazdu...", source, 255, 255, 255, true)
end
end)
dodaje na koncu jeszcze endy i nadal pisze ze trzeba zamnkac a juz nie ma co zamykac
Podpis
Intelligence gonna get you..
Wysłany: 2015-11-21, 17:03
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4049 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
U mnie wszytko dzia?a
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2015-11-21, 18:20
ironmaiden666
Voight...
Wiek: 30 Na forum: 4020 dni Posty: 125
Nick w MP: Irons
Piwa : 2941
U mnie nie
Podpis
Intelligence gonna get you..
Wysłany: 2015-11-21, 18:26
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4049 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
a ty _c zmieni?e? co?
?
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2015-11-21, 18:39
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
Mia?e? o jeden end za ma?o. Poprawi?em ci to.
addEvent ( "zaproponujKupnoPojazdu" , true )
addEventHandler ( "zaproponujKupnoPojazdu" , getRootElement (),function( gracz , id , cena )
if not ofertyKupna [ gracz ] then
ofertyKupna [ gracz ] = {}
ofertyKupna [ gracz ] = { gracz , source , id , cena }
if cena < 1 then
outputChatBox ( "*Wpisa?e? niepoprawn? cen? sprzeda?y!" , source , 255 , 0 , 0 )
else
local query = dbQuery ( handler , "SELECT model,przebieg FROM pojazdy WHERE id='" .. id .. "'" )
local result , num_rows , errormsg = dbPoll ( query , - 1 )
local pojazd = result [ 1 ]. model
local pojazd = getVehicleNameFromModel ( pojazd )
local przebieg = result [ 1 ]. przebieg
triggerClientEvent ( gracz , "pokazOferteKupnaPojazdu" , root , source , pojazd , cena , przebieg )
else
outputChatBox ( "Ten gracz w tym momencie ma otwart? inn? ofert? kupna pojazdu..." , source , 255 , 255 , 255 , true )
end
end
end )
Wysłany: 2015-11-21, 20:12
ironmaiden666
Voight...
Wiek: 30 Na forum: 4020 dni Posty: 125
Nick w MP: Irons
Piwa : 2941
Nadal nie dzia?a
Podpis
Intelligence gonna get you..
Wysłany: 2015-11-22, 11:36
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
"ironmaiden666" napisał/a :
To proponuj? ci moj? wersj? z kt?rej korzysta?em. Zmieni?em tu tylko kawa?ek kodu po stronie klienta.
sprzedaz_c.lua
--<< cena
function onSprzedazClickSprzedaj ()
local cena = guiGetText ( guig [ 16 ])
if #cena >= 1 then
local cena = tonumber ( cena )
if cena >= 1 then
if type ( cena ) == "number" then
showCursor ( false )
guiSetVisible ( guig [ 13 ], false )
--
triggerServerEvent ( "zaproponujKupnoPojazdu" , localPlayer , savePLAYER , saveVEHICLE , cena )
else
outputChatBox ( "Wpisz cen? za jak? chcesz sprzeda? sw?j pojazd." , 255 , 255 , 255 , true )
end
else
outputChatBox ( "Wpisz prawid?ow? cen?." , 255 , 255 , 255 , true )
end
end
end
Doda?em tutaj 2 linijki kodu i wszystko ?adnie dzia?a. sprzedaz_s.lua daj ze skryptu pana prezesa, nie to edytowane wy?ej.
Wysłany: 2015-11-24, 15:43
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4049 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
local sprzedaz = createMarker ( x , y , z , "cylinder" , 2 , 255 , 0 , 0 , 100 )
-- setElementInterior ( sprzedaz , 3 )
-- setElementDimension ( sprzedaz , 1 )
function onSprzedazHit ( hitElement , dim )
if getElementType ( hitElement ) == "player" then
local players = getElementsInMarker ( sprzedaz )
triggerClientEvent ( hitElement , "pokazGUISprzedazy" , root , players )
end
end
addEventHandler ( "onMarkerHit" , sprzedaz , onSprzedazHit )
function getElementsInMarker ( marker )
elements = {}
for i , v in pairs ( getElementsByType ( "player" )) do
if isElementWithinMarker ( v , marker ) then
table . insert ( elements , v )
end
end
return elements
end
addEvent ( "pobierzListePojazdow" , true )
addEventHandler ( "pobierzListePojazdow" , getRootElement (),
function()
local account = getPlayerAccount ( source )
if account then
local wlasciciel = getAccountName ( account )
local query = dbQuery ( handler , "SELECT * FROM pojazdy WHERE wlasciciel='" .. wlasciciel .. "'" )
local result , num_rows , errormsg = dbPoll ( query , - 1 )
triggerClientEvent ( source , "pokazListePojazdow" , root , result )
end
end )
ofertyKupna = {}
addEvent ( "zaproponujKupnoPojazdu" , true )
addEventHandler ( "zaproponujKupnoPojazdu" , getRootElement (),
function( gracz , id , cena )
if not ofertyKupna [ gracz ] then
ofertyKupna [ gracz ] = {}
ofertyKupna [ gracz ] = { gracz , source , id , cena }
if cena < 1 then
outputChatBox ( "*Wpisa?e? niepoprawn? cen? sprzeda?y!" , source , 255 , 0 , 0 )
else
local query = dbQuery ( handler , "SELECT model FROM pojazdy WHERE id='" .. id .. "'" )
local result , num_rows , errormsg = dbPoll ( query , - 1 )
local pojazd = result [ 1 ]. model
local pojazd = getVehicleNameFromModel ( pojazd )
local przebieg = result [ 1 ]. przebieg
triggerClientEvent ( gracz , "pokazOferteKupnaPojazdu" , root , source , pojazd , cena , przebieg )
end
else
outputChatBox ( "*Ten gracz w tym momencie ma otwart? inn? ofert? kupna pojazdu..." , source , 255 , 255 , 255 , true )
end
end )
addEvent ( "odrzucOferteKupna" , true )
addEventHandler ( "odrzucOferteKupna" , getRootElement (),
function()
if ofertyKupna [ source ] then
local od_kogo_oferta = ofertyKupna [ source ][ 2 ]
if isElement ( od_kogo_oferta ) then
outputChatBox ( "Gracz " .. getPlayerName ( source ).. " odrzuci? Twoj? ofert? kupna pojazdu." , od_kogo_oferta , 255 , 255 , 255 , true )
end
ofertyKupna [ source ] = nil
end
end )
addEvent ( "przyjmijOferteKupna" , true )
addEventHandler ( "przyjmijOferteKupna" , getRootElement (),
function()
if ofertyKupna [ source ] then
local account = getPlayerAccount ( source )
if account then
local login = getAccountName ( account )
if 25 >= getYourVehicleCount ( login ) then
local od_kogo_oferta = ofertyKupna [ source ][ 2 ]
local veh = ofertyKupna [ source ][ 3 ] -- id pojazdu
local cena = ofertyKupna [ source ][ 4 ]
if isElement ( od_kogo_oferta ) then
local cena = tonumber ( cena )
if getPlayerMoney ( source ) >= cena then
takePlayerMoney ( source , cena )
givePlayerMoney ( od_kogo_oferta , cena )
-- nadpisanie danych
local vehicle = getVehicleByID ( veh )
ustawDanePojazdu ( vehicle , veh , login )
dbExec ( handler , "UPDATE pojazdy SET wlasciciel='" .. login .. "' WHERE id=" .. veh .. "" )
-- chat
local pojazd = getVehicleName ( vehicle )
outputChatBox ( "Gracz " .. getPlayerName ( source ).. " przyja? Twoj? ofert? i kupi? Tw?j pojazd " .. pojazd .. " za " .. cena .. "$." , od_kogo_oferta , 255 , 255 , 255 , true )
outputChatBox ( "Kupi?e? pojazd " .. pojazd .. " za " .. cena .. "$ od gracza " .. getPlayerName ( od_kogo_oferta ).. "." , source , 255 , 255 , 255 , true )
else
outputChatBox ( "Gracz " .. getPlayerName ( source ).. " nie ma wystarczaj?co pieni?dzy by kupi? Tw?j pojazd." , od_kogo_oferta , 255 , 255 , 255 , true )
outputChatBox ( "*Nie masz wystarczaj?co pieni?dzy by kupi? ten pojazd." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "*Gracz kt?ry sk?ada? Ci ofert? nie jest ju? online na serwerze." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "*Mo?esz posiada? maksymalnie 25 pojazd?w." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "*Nie jeste? zalogowany." , source , 255 , 255 , 255 , true )
end
else
outputChatBox ( "*Wyst?pi? b??d, nie mo?esz teraz kupi? pojazdu :c" , source , 255 , 255 , 255 , true )
end
ofertyKupna [ source ] = nil
end )
Poprawi?em
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2015-11-24, 17:34
ironmaiden666
Voight...
Wiek: 30 Na forum: 4020 dni Posty: 125
Nick w MP: Irons
Piwa : 2941
Dzi?ki ka?dy ma po piwsku (do zamkniecia)
Podpis
Intelligence gonna get you..
Tagi: blokada :: ceny :: skrypcie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: