Wysłany: 2016-01-18, 18:09
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
Witam mam taki blad w systemie pojazdow:
bad argument #2 to 'format' (number expected, got boolean)
o to kod :
Kod: setElementData ( auto, "message", "W?a?ciciel : "..getPlayerName(source).."\nModel : "..getVehicleName(auto).."\nPrzebieg : "..string.format("%0.0f",getElementData(auto, "przebieg")).."\nCena : "..cena.." euro")
Prubowalem sam to zrobic ale niestety nie udalo mi sie.
Jak ktos pomorze przy skrypcie to dam piwko .
Wysłany: 2016-01-18, 18:16
THEGizmo
Modeler/Uczeń Lua
Wiek: 27 Na forum: 4141 dni Posty: 255
Nick w MP: THEGizmo
Piwa : 3072
Spr?buj tera
Kod: setElementData(auto,"message","W?a?ciciel : "..getPlayerName(source).."\nModel : "..getVehicleName(auto).."\nPrzebieg : "..getElementData(auto, "przebieg").."\nCena : "..cena.." euro")
Podpis
Modeler Corporation Sp. Z.O.O
Wysłany: 2016-01-18, 18:52
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
Tera :
attempt to concatenate a boolean value
Wysłany: 2016-01-18, 19:00
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Ustawi?e? swoj? element dat?? Na przebieg itd.
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-01-18, 19:04
THEGizmo
Modeler/Uczeń Lua
Wiek: 27 Na forum: 4141 dni Posty: 255
Nick w MP: THEGizmo
Piwa : 3072
pomaza , wes daj ca?y kod bo nie mo?liwe ze nie dzia?a
Podpis
Modeler Corporation Sp. Z.O.O
Wysłany: 2016-01-18, 19:47
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
Calego nie dam ale moge dac to "
Kod: function wystaw ( source,cmd,cena )
local auto = getPedOccupiedVehicle ( source )
if isElementWithinMarker ( source, gielda ) and cena and auto then
if getElementData ( auto, "prywatne" ) then
setElementData(auto,"message","W?a?ciciel : "..getPlayerName(source).."\nModel : "..getVehicleName(auto).."\nPrzebieg : "..getElementData(auto, "przebieg").."\nCena : "..cena.." euro")
outputChatBox("Aby usun?? z szyby kartk? z informacj? o sprzeda?y wpisz /kusun", source,255,255,255 )
end
end
end
addCommandHandler("wystaw", wystaw )
function kusun (source)
local auto = getPedOccupiedVehicle ( source )
if auto then
local accName = getAccountName ( getPlayerAccount ( source))
if getElementData(auto, "wlasciciel") == getAccountName(getPlayerAccount(source)) then
outputChatBox("Wiadomo?? o sprzeda?y zosta?a usuni?ta.", source,255,255,255 )
setElementData ( auto, "message", false )
end
end
end
addCommandHandler("kusun", kusun )
function sprzedaj ( source, cmd,id, kwota )
if tonumber ( kwota ) > tonumber ( 0 ) then
local auto = getPedOccupiedVehicle ( source )
if auto and id and kwota then
if getElementData ( auto, "wlasciciel" ) == getPlayerName ( source) then
if not getElementData ( auto, "juzsprzedawane" ) then
for k,v in ipairs ( getElementsByType ( "player" ) ) do
if getElementData(v, "id") == tonumber(id ) then
if v then
if not getElementData ( v, "ofertasprzedazypojazdu" ) then
local nick = getPlayerName ( source )
local nick2 = getPlayerName ( v )
outputChatBox("Oferta zosta?a ws?ana do gracza "..nick2.." ( "..kwota.." euro )", source,255, 255, 255)
outputChatBox("Dosta?e? oferte kupna pojazdu od gracza "..nick.." ( "..kwota.." euro )", v,255, 255, 255)
local model = getVehicleName ( auto )
local przebieg = getElementData ( auto, "przebieg" )
outputChatBox("Aby akceptowa? kupno pojazdu wpisz /akceptuj", v,255, 255, 255)
outputChatBox("Za 10 sekund oferta zostanie automatycznie anulowana", v,255, 255, 255)
outputChatBox("Za 10 sekund oferta zostanie automatycznie anulowana", source,255, 255, 255)
setTimer (setElementData, 10000,1, v, "ofertasprzedazypojazdu", false)
setTimer (setElementData, 10000,1, auto,"juzsprzedawane", false)
setTimer( outputChatBox, 10000,1,"Dla zapewnienia bezpiecze?stwa, oferta zostanie automatycznie anulowana", source,255, 255, 255)
setTimer( outputChatBox, 10000,1,"Dla zapewnienia bezpiecze?stwa, oferta zostanie automatycznie anulowana", v,255, 255, 255)
setElementData ( auto, "juzsprzedawane", true )
setElementData ( v, "ofertasprzedazypojazdu", true )
setElementData ( v, "sprzedajacy", nick )
setElementData ( v, "sprzedawanypojazd", auto )
setElementData ( v, "cenasprzedawanegopojazdu", kwota )
end
end
end
end
end
end
end
end
end
addCommandHandler("sprzedaj", sprzedaj )
[ Dodano : 2016-01-19, 12:54 ]
Pomorze kto? ?
Wysłany: 2016-01-19, 14:55
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
setElementData ( auto , "message" , "W?a?ciciel : " .. getPlayerName ( source ).. "\nModel : " .. getVehicleName ( auto ).. "\nPrzebieg : " .. getElementData ( auto , "przebieg" ).. "\nCena : " .. cena .. " euro" )
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-01-19, 16:58
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
ten sam b??d co u g?ry
Wysłany: 2016-01-19, 17:06
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
function wystaw ( source , cmd , cena )
local auto = getPedOccupiedVehicle ( source )
if isElementWithinMarker ( source , gielda ) and cena and auto then
if getElementData ( auto , "prywatne" ) then
setElementData ( auto , "message" , "W?a?ciciel : " .. getPlayerName ( source ).. "\nModel : " .. getVehicleName ( auto ).. "\nPrzebieg : " .. tonumber ( getElementData ( auto , "przebieg" )).. "\nCena : " .. cena .. " euro" )
outputChatBox ( "Aby usun?? z szyby kartk? z informacj? o sprzeda?y wpisz /kusun" , source , 255 , 255 , 255 )
end
end
end
addCommandHandler ( "wystaw" , wystaw )
Powinno lata?.
Wysłany: 2016-01-19, 17:27
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
niestety dalej to samo
[ Dodano : 2016-01-19, 17:28 ]
ale pokazuje warning Bad argument @ 'GetPedOccupiedVehicle' [Expected ped at argument 1, got vehcile]
Wysłany: 2016-01-20, 16:13
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Pr?buj
function wystaw ( source , cmd , cena , plr )
local auto = getPedOccupiedVehicle ( plr )
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-01-20, 18:19
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
a po co plr ?
[ Dodano : 2016-01-20, 18:26 ]
nigdzie w skrypcie nie ma plr to jak to ma dziala? ?
Wysłany: 2016-01-20, 18:28
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
'plr' definiuje gracza, doda?em Ci w funkcji "plr".
Skrypt prawdopodobnie ?le odczytywa? 'getPedOccupiedVehicle'>
Mo?esz te? u?y? localPlayer, czy player.
Wklej te dwie linijki zamiast starych. Zdaj relacje.
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-01-20, 18:47
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
Prosz? to wi?ksza cz??ci kodu :
Kod: function wejscie ( player, seat, jacked )
if seat == 0 then
local accName = getAccountName ( getPlayerAccount ( player))
if getElementData(source, "prywatne") then
if getElementData(source, "wlasciciel") == getAccountName(getPlayerAccount(player)) then
else
cancelEvent()
outputChatBox("Nie posiadasz kluczyk?w do tego pojazdu.", player,255, 255, 255)
end
end
end
end
addEventHandler ( "onVehicleStartEnter", getRootElement(), wejscie )
function spawnauta ( source, cmd, marka, koszt )
local accName = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
if marka and koszt then
local nazwaauta = getVehicleNameFromID ( marka )
local x,y,z = getElementPosition ( source )
local auto = createVehicle ( marka, x,y,z )
setVehicleColor ( auto, 255,255,255 )
setElementPosition ( source, x,y,z+2 )
setElementData ( auto, "cena", koszt)
setElementData ( auto, "prywatne", true )
setElementData ( auto, "wlasciciel", "lol")
setElementData ( auto, "message", ""..nazwaauta.."\nCena : "..koszt.." \n Aby kupi? wsi?d? jako pasa?er" )
setElementFrozen ( auto, true )
end
end
end
addCommandHandler("stworz",spawnauta)
function infoprzywsiadaniu ( vehicle, seat )
if getElementData ( vehicle, "cena" ) then
local nazwa = getVehicleName ( vehicle )
local cenapojazdu = getElementData ( vehicle, "cena" )
outputChatBox("Aby kupi? pojazd "..nazwa.." za "..cenapojazdu.." euro wpisz /kup", source, 255, 255, 255 )
end
end
addEventHandler("onPlayerVehicleEnter",getRootElement(), infoprzywsiadaniu )
function kup ( source )
local auto = getPedOccupiedVehicle ( source )
if auto then
if getElementData ( auto, "cena" ) then
local cenapojazdu = getElementData ( auto, "cena" )
local kasa = getPlayerMoney ( source )
if tonumber( kasa ) >= tonumber( cenapojazdu ) then
outputChatBox("Pojazd zakupiony, gratulujemy zakupu ", source,255,255,255 )
local konto = getPlayerAccount ( source )
local nazwakonta = getAccountName ( konto )
setElementData ( auto, "wlasciciel", nazwakonta )
setElementData ( auto, "cena", false)
setElementData ( auto, "message", false )
takePlayerMoney ( source, cenapojazdu )
else
outputChatBox("Nie posiadasz wystarczaj?cej ilo?ci got?wki.", source,255,255,255 )
end
end
end
end
addCommandHandler("kup", kup )
local gielda = createMarker (2475.91284, -1670.67554, 12.33353, "cylinder", 4.5, 0, 255, 0, 40)
function info (source, auto)
local auto = getPedOccupiedVehicle ( source)
if auto then
if getElementData ( auto, "prywatne" ) then
outputChatBox("Aby wystawi? auto na gie?d? wpisz /wystaw cena", source,255,255,255 )
end
end
end
addEventHandler("onMarkerHit", gielda, info )
function wystaw ( source,cmd,cena )
local auto = getPedOccupiedVehicle ( source )
if isElementWithinMarker ( source, gielda ) and cena and auto then
if getElementData ( auto, "prywatne" ) then
setElementData ( auto, "message", "W?a?ciciel : "..getPlayerName(source).."\nModel : "..getVehicleName(auto).."\nPrzebieg : "..string.format("%0.0f",getElementData(auto, "przebieg")).."\nCena : "..cena.." euro")
outputChatBox("Aby usun?? z szyby kartk? z informacj? o sprzeda?y wpisz /kusun", source,255,255,255 )
end
end
end
addCommandHandler("wystaw", wystaw )
function kusun (source)
local auto = getPedOccupiedVehicle ( source )
if auto then
local accName = getAccountName ( getPlayerAccount ( source))
if getElementData(auto, "wlasciciel") == getAccountName(getPlayerAccount(source)) then
outputChatBox("Wiadomo?? o sprzeda?y zosta?a usuni?ta.", source,255,255,255 )
setElementData ( auto, "message", false )
end
end
end
addCommandHandler("kusun", kusun )
function sprzedaj ( source, cmd,id, kwota )
if tonumber ( kwota ) > tonumber ( 0 ) then
local auto = getPedOccupiedVehicle ( source )
if auto and id and kwota then
if getElementData ( auto, "wlasciciel" ) == getPlayerName ( source) then
if not getElementData ( auto, "juzsprzedawane" ) then
for k,v in ipairs ( getElementsByType ( "player" ) ) do
if getElementData(v, "id") == tonumber(id ) then
if v then
if not getElementData ( v, "ofertasprzedazypojazdu" ) then
local nick = getPlayerName ( source )
local nick2 = getPlayerName ( v )
outputChatBox("Oferta zosta?a ws?ana do gracza "..nick2.." ( "..kwota.." euro )", source,255, 255, 255)
outputChatBox("Dosta?e? oferte kupna pojazdu od gracza "..nick.." ( "..kwota.." euro )", v,255, 255, 255)
local model = getVehicleName ( auto )
local przebieg = getElementData ( auto, "przebieg" )
outputChatBox("Aby akceptowa? kupno pojazdu wpisz /akceptuj", v,255, 255, 255)
outputChatBox("Za 10 sekund oferta zostanie automatycznie anulowana", v,255, 255, 255)
outputChatBox("Za 10 sekund oferta zostanie automatycznie anulowana", source,255, 255, 255)
setTimer (setElementData, 10000,1, v, "ofertasprzedazypojazdu", false)
setTimer (setElementData, 10000,1, auto,"juzsprzedawane", false)
setTimer( outputChatBox, 10000,1,"Dla zapewnienia bezpiecze?stwa, oferta zostanie automatycznie anulowana", source,255, 255, 255)
setTimer( outputChatBox, 10000,1,"Dla zapewnienia bezpiecze?stwa, oferta zostanie automatycznie anulowana", v,255, 255, 255)
setElementData ( auto, "juzsprzedawane", true )
setElementData ( v, "ofertasprzedazypojazdu", true )
setElementData ( v, "sprzedajacy", nick )
setElementData ( v, "sprzedawanypojazd", auto )
setElementData ( v, "cenasprzedawanegopojazdu", kwota )
end
end
end
end
end
end
end
end
end
addCommandHandler("sprzedaj", sprzedaj )
function kupujemy ( source )
local kasa = getPlayerMoney ( source )
local nickkupujacego = getPlayerName ( source )
if getElementData ( source,"ofertasprzedazypojazdu" ) then
local koszt = getElementData ( source, "cenasprzedawanegopojazdu" )
if kasa >= tonumber( koszt ) then
local sprzedajacy = getElementData ( source, "sprzedajacy" )
local sprzedajacyzdefiniowane = getPlayerFromName ( sprzedajacy )
if sprzedajacyzdefiniowane then
if sprzedajacy then
local konto= getPlayerAccount(source)
if konto then
local sprzedawanypojazd = getElementData ( source, "sprzedawanypojazd")
outputChatBox("Akceptowales oferte sprzeda?y pojazdu od "..sprzedajacy.." ( "..koszt.." euro )", source,255, 255, 255)
outputChatBox(""..nickkupujacego .." akceptowa? twoj? oferte sprzeda?y pojazdu ( "..koszt.." euro )", sprzedajacyzdefiniowane ,255, 255, 255)
setElementData ( source, "ofertasprzedazypojazdu", false)
setElementData ( sprzedawanypojazd , "juzsprzedawane", false)
setElementData ( sprzedawanypojazd, "wlasciciel", nickkupujacego )
setElementData ( sprzedawanypojazd, "kluczyki", false )
takePlayerMoney ( source, koszt )
givePlayerMoney ( sprzedajacyzdefiniowane, koszt )
end
end
end
else
outputChatBox("Nie posiadasz odpowiedniej ilo?ci got?wki aby akceptowa? ofert? ( " ..koszt.." euro )", source,255, 255, 255)
end
else
outputChatBox("Nikt nie oferowa? Ci oferty sprzeda?y pojazdu", source,255, 255, 255)
end
end
addCommandHandler("akceptuj", kupujemy )
Tagi: system :: pojazdow
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: