Wysłany: 2015-05-24, 20:10
flimbo123
Wiek: 33 Na forum: 5776 dni Posty: 93
Nick w MP: Flimbo
Piwa : 190
Witam, chcia?bym aby co przystanek opr?cz dawania 30$ by?a szansa 5% na punkt score dla kierowcy.
addEvent ( "bus_finish" , true )
addEventHandler ( "bus_finish" , rootElement ,
function ( client )
if not isPedInVehicle ( client ) then return end
if not busses [ getElementModel ( getPedOccupiedVehicle ( client ))] then return end
givePlayerMoney ( client , 30 )
if #busTable == tonumber(getElementData(client,"busData")) then
setElementData ( client , "busData" , 1 )
else
setElementData ( client , "busData" , tonumber ( getElementData ( client , "busData" ))+ 1 )
end
getNewBusLocation ( client , tonumber ( getElementData ( client , "busData" )))
end )
Wysłany: 2015-05-24, 22:05
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Urywek kodu :
rnd = math . random ( 1 , 5 )
if rnd == 2 then
daj punkty
end
Wysłany: 2015-05-24, 22:40
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
ale math.random 1,5 to chyba bedzie 20% szansy, czyz nie?
Podpis
Jedyny kontakt ze mną to PW forum
Kod:
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Wysłany: 2015-05-25, 02:27
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
Tak, to b?dzie 20%, machnij sobie "1,20", wtedy b?dziesz mia? 5%
Wysłany: 2015-05-26, 15:26
flimbo123
Wiek: 33 Na forum: 5776 dni Posty: 93
Nick w MP: Flimbo
Piwa : 190
Droga armio skrypter?w, co? zrobi?em ?le w ostatniej linijce ;/
addEvent ( "bus_finish" , true )
addEventHandler ( "bus_finish" , rootElement ,
function ( client )
if not isPedInVehicle ( client ) then return end
if not busses [ getElementModel ( getPedOccupiedVehicle ( client ))] then return end
givePlayerMoney ( client , 30 )
rnd = math . random ( 1 , 5 )
if rnd == 2 then
( setElementData ( getLocalPlayer (), "Score" , + 1 )
Wysłany: 2015-05-26, 15:30
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
setElementData(localPlayer, "Score", getElementData(localPlayer, "Score") + 1 )
Sprobuj to zrobic tak... Usun te ostatnia linijke i wklej to co Ci dalem
Podpis
Jedyny kontakt ze mną to PW forum
Kod:
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Wysłany: 2015-05-26, 22:23
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
addEvent ( "bus_finish" , true )
addEventHandler ( "bus_finish" , rootElement ,
function aeda ( client )
if not isPedInVehicle ( client ) then return end
if not busses [ getElementModel ( getPedOccupiedVehicle ( client ))] then return end
givePlayerMoney ( client , 30 )
rnd = math . random ( 1 , 5 )
if rnd == 2 then
setElementData ( client , "Score" , getElementData ( client , "Score" ) + 1 )
end
end )
Wysłany: 2015-05-27, 15:42
flimbo123
Wiek: 33 Na forum: 5776 dni Posty: 93
Nick w MP: Flimbo
Piwa : 190
luki123luki123 , [2015-05-27 15] ERROR: Loading script failed: bus/bus.lua:39: '(' expected near 'aeda'
Wysłany: 2015-05-27, 16:22
Loop
Inspektor
Wiek: 27 Na forum: 4289 dni Posty: 311
Nick w MP: Inspektor
Piwa : 201
addEvent ( "bus_finish" , true )
addEventHandler ( "bus_finish" , rootElement ,function( client )
if not isPedInVehicle ( client ) then return end
if not busses [ getElementModel ( getPedOccupiedVehicle ( client ))] then return end
givePlayerMoney ( client , 30 )
rnd = math . random ( 1 , 5 )
if rnd == 2 then
setElementData ( client , "Score" , getElementData ( client , "Score" ) + 1 )
end
end )
Wysłany: 2015-05-30, 10:48
flimbo123
Wiek: 33 Na forum: 5776 dni Posty: 93
Nick w MP: Flimbo
Piwa : 190
Loop , nadal pud?o podaje ca?y kod po kuracji waszymi sugestiami:
addEvent ( "bus_finish" , true )
addEventHandler ( "bus_finish" , rootElement ,function( client )
if not isPedInVehicle ( client ) then return end
if not busses [ getElementModel ( getPedOccupiedVehicle ( client ))] then return end
givePlayerMoney ( client , 30 )
rnd = math . random ( 1 , 5 )
if rnd == 2 then
setElementData ( client , "Score" , getElementData ( client , "Score" ) + 1 )
if #busTable == tonumber(getElementData(client,"busData")) then
setElementData ( client , "busData" , 1 )
else
setElementData ( client , "busData" , tonumber ( getElementData ( client , "busData" ))+ 1 )
end
getNewBusLocation ( client , tonumber ( getElementData ( client , "busData" )))
end )
Wysłany: 2015-06-04, 17:36
Loop
Inspektor
Wiek: 27 Na forum: 4289 dni Posty: 311
Nick w MP: Inspektor
Piwa : 201
Wysłany: 2015-06-04, 23:47
PolskiSebek12
Programista
Wiek: 28 Na forum: 4346 dni Posty: 343
Nick w MP: CrosRoad95
Piwa : 3883
jakim cudem tyle post?w odno?nie 1 rzeczy ?
rand = math.random(1,100)
if rand < 6 then
setElementData(getLocalPlayer(),"Score", getElementData(getLocalPlayer(),"Score") or 0+1)
end
dodajesz co? takiego i dzia?a
Tagi: prawdopodobieństwo :: przyznania :: punktu :: quotscorequot
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: