Wysłany: 2019-04-26, 21:17
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Dostajesz jakie? komunikaty na czacie?
Wy?lesz screenshota z bazy danych gdzie masz biznesy?
Wysłany: 2019-04-26, 21:42
NotRed
Wiek: 20 Na forum: 2629 dni Posty: 24
Nick w MP: KONTO NIE AKTYWNE
Piwa : 64
"Wilq" napisał/a :Dostajesz jakie? komunikaty na czacie?
Wy?lesz screenshota z bazy danych gdzie masz biznesy?
Prosz? o to screenshot z bazy danych z tabeli biznesy http://prntscr.com/nhcud5
Wysłany: 2019-04-26, 21:57
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Troszk? przerobi?em komend?, wklej now? funkcj? i podmie? obecn? komend?:
function isPlayerNearPickup ( theElement , thePickup )
if ( isElement ( theElement ) and getElementType ( thePickup ) == "pickup" ) then
local x , y , z = getElementPosition ( theElement )
local x2 , y2 , z2 = getElementPosition ( thePickup )
if ( getDistanceBetweenPoints3D ( x2 , y2 , z2 , x , y , z ) <= 1 ) then
return true
end
end
return false
end
function kupbiznes ( plr )
local isNearPickup = isPlayerNearPickup ( plr , pickup [ plr ])
if ( isNearPickup == true ) then
local biz2 = pickup [ plr ]
if getElementData ( biz2 , "z" ) == "t" then
outputChatBox ( "Ten biznes ma ju? w?a?ciciela!" , plr , 255 , 255 , 255 )
return
end
if getElementData ( biz2 , "z" ) == "n" then
local bkoszt = getElementData ( biz2 , "cost" )
local hajs = getPlayerMoney ( plr )
if tonumber ( getElementData ( plr , "player:reputation" )) < 750 then
outputChatBox ( "Aby zakupi? biznes musisz posiada? 750 RP!" , plr , 255 , 255 , 255 )
return
end
if tonumber ( bkoszt ) > tonumber ( hajs ) then
outputChatBox ( "Nie posiadasz " .. getElementData ( biz2 , "cost" ).. " PLN" , plr , 255 , 255 , 255 )
return
end
local limit = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM biznesy WHERE owner=?" , getElementData ( plr , "player:uid" ))
if #limit >= 1 then
outputChatBox ( "Posiadasz ju? jeden biznes!" , plr , 255 , 0 , 0 )
return
end
outputChatBox ( "Pomy?lnie zakupi?e? biznes o nazwie " .. getElementData ( biz2 , "name" ).. " za " .. getElementData ( biz2 , "cost" ).. " PLN na 7 dni. Pamietaj o przedluzeniu!" , plr , 255 , 255 , 255 )
takePlayerMoney ( plr , getElementData ( biz2 , "cost" ))
exports [ "pystories-db" ]: dbSet ( "UPDATE biznesy SET zajety=?, owner=?, saldo=?, data = NOW() + INTERVAL 7 day WHERE id=?" , "t" , getElementData ( plr , "player:uid" ), "0" , getElementData ( biz2 , "id" ))
restartResource ( getThisResource ())
end
end
end
addCommandHandler ( "biznes.kup" , kupbiznes )
Polecam doda? sobie event
?eby usun?? z danych pickup, w kt?rym gracz sta? a go opu?ci?.
Co? takiego:
addEventHandler ( "onPickupLeave" , getResourceRootElement (), function( theElement )
if pickup [ theElement ] then
pickup [ theElement ] = nil
end
end )
Wysłany: 2019-04-26, 22:07
NotRed
Wiek: 20 Na forum: 2629 dni Posty: 24
Nick w MP: KONTO NIE AKTYWNE
Piwa : 64
Powinno ju? ?miga???
[ Dodano : 2019-04-26, 22:13 ]
Nie dzia?a
Wysłany: 2019-04-26, 22:17
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Otrzymujesz jakie? komunikaty na czacie?
Widzisz pickupy na mapie normalnie?
Otwiera Ci si? okno po wej?ciu w pickup (zak?adam, ?e jest on wolny)?
Wysłany: 2019-06-11, 23:04
NotRed
Wiek: 20 Na forum: 2629 dni Posty: 24
Nick w MP: KONTO NIE AKTYWNE
Piwa : 64
{ [ "name" ] = "player:biznes" , [ "width" ] = 85 , [ "friendlyName" ] = "Biznes" , [ "priority" ] = 7 }, Zrobilem tak i na scorboardzie dziala ale jak stworze biznes i kupie go to nie ma jego nazwy pod tab
Wysłany: 2019-06-11, 23:10
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
ElementData ("player:biznes") si? zgadza?
Wysłany: 2019-06-11, 23:15
NotRed
Wiek: 20 Na forum: 2629 dni Posty: 24
Nick w MP: KONTO NIE AKTYWNE
Piwa : 64
Na tabie pojawia sie kolumna biznesy ale nie wyswietla nazwy biznesu
Wysłany: 2019-06-11, 23:44
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Dlatego pytam, czy w kodzie od biznes?w zgadza si? elementData, kt?r? wykorzystujesz to pobrania nazwy biznesu.
Tagi: scoreboard :: pys :: 3.0 :: biznesy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: