Wysłany: 2016-07-30, 13:23
mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
Witam mam problem chodzi mi oto ze mam Skrypt na Kasyno ale sie wygrywa za cz?sto wi?c chce zeby by?a 1/10 szansa na wygran? albo chociasz zeby sie nie wygrywa?o ca?y czas ze np. 10 razy przegrasz a tu 11 wygrywasz ale zeby nie by?o ze 10 pod z?d sie wygrywa,
M?cze sie z tym bo to prawie nei daje efektu co tu robie oto kod:
local maszyna = createObject ( 2640 , 2021.64 , 1015.24 , 10.82 )
setElementData ( maszyna , "message" , "Maszyna hazardowa" )
local marker = createMarker ( 2021.64 , 1015.24 , 10.82 , "cylinder" , 3 , 255 , 0 , 0 , 0 )
local active = false
local cash = 0
addEventHandler ( "onMarkerHit" , marker , function ( element )
outputChatBox ( "Dzia?anie : " , element , 255 , 255 , 255 )
outputChatBox ( "Przegrana : Kwota postawiona zostaje w maszynie. Na fundacje Komisu mixLoLmix oraz Patryko12" , element , 255 , 255 , 255 )
outputChatBox ( "Wygrana : Dostajesz zwrot zastawionej kwoty + 50% tej kwoty." , element , 255 , 255 , 255 )
outputChatBox ( "Wpisz /postaw <kwota>" , element , 255 , 255 , 255 )
end )
local function result ( plr , type )
if type == true then
wynik = cash + ( cash / 2 )
outputChatBox ( "Brawo! Maszyna wylosowa?a Twoje liczby - zgarniasz " .. string . format ( "EUR %0.2f" , wynik ).. "" , plr , 255 , 255 , 255 )
givePlayerMoney ( plr , wynik )
active = false
elseif type == false then
outputChatBox ( "Niestety, masz dzisiaj pecha. Maszyna wylosowa?a inne liczby. Ale bend? nowe auta :)" , plr , 255 , 255 , 255 )
active = false
end
end
addCommandHandler ( "postaw" , function ( plr , cmd , kwota )
if kwota then
if active == true then
return outputChatBox ( "Wyliczanie jeszcze trwa" , plr , 255 , 255 , 255 )
end
kwota = tonumber ( kwota )
cash = 0
rnd = nil
if type ( kwota ) == "number" then
if isElementWithinMarker ( plr , marker ) then
if kwota >= 0 then
if kwota > getPlayerMoney ( plr ) then
local price = string . format ( "EUR %0.2f" , kwota )
return outputChatBox ( "Nie posiadasz " .. price , plr , 255 , 255 , 255 )
end
rnd = math . random ( 1 , 8 )
outputChatBox ( "Losowanie wystartowa?o." , plr , 255 , 255 , 255 )
active = true
takePlayerMoney ( plr , kwota )
cash = kwota
if rnd == 1 or rnd == 3 or rnd == 4 or rnd == 5 or rnd == 6 or rnd == 7 or rnd == 8 then
setTimer ( result , 4000 , 1 , plr , true )
elseif rnd == 2 then
setTimer ( result , 4000 , 1 , plr , false )
end
end
end
end
end
end )
Skrypt z Gtao
Wysłany: 2016-07-30, 13:44
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Mo?esz doda? sobie taki "mechanizm"
local sznsa = 0
local s = math . random ( #szansa, 2)
i potem warunek if szansa == 1 then etc
Wysłany: 2016-07-30, 13:58
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
mixLoLmix2 , je?eli 1/10 ma by? to :
rnd = math . random ( 1 , 10 )
i
if rnd == 1 then
setTimer ( result , 4000 , 1 , plr , true )
else
setTimer ( result , 4000 , 1 , plr , false )
end
Wysłany: 2016-07-30, 14:16
mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
Dzieki zamykam po piwie
Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Tagi: randomowe :: liczby
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: