Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-05-24, 20:10


flimbo123







Wiek: 33
Na forum: 5776 dni
Posty: 93
Nick w MP: Flimbo

Piwa: 190

Respekt: 60

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(clientthen return end
if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end
givePlayerMoney(client30)
if #busTable == tonumber(getElementData(client,"busData")) then
setElementData(client,"busData",1)
else
setElementData(client,"busData",tonumber(getElementData(client,"busData"))+1)
end
getNewBusLocation(clienttonumber(getElementData(client,"busData")))
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 22:05


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Urywek kodu :

rnd=math.random(1,5)
if rnd==2 then
daj punkty
end


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-24, 22:40


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

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
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-25, 02:27


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Tak, to b?dzie 20%, machnij sobie "1,20", wtedy b?dziesz mia? 5%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-26, 15:26


flimbo123







Wiek: 33
Na forum: 5776 dni
Posty: 93
Nick w MP: Flimbo

Piwa: 190

Respekt: 60

Droga armio skrypter?w, co? zrobi?em ?le w ostatniej linijce ;/

addEvent("bus_finish",true)
addEventHandler("bus_finish",rootElement,
function (client)
if not isPedInVehicle(clientthen return end
if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end
givePlayerMoney(client30)
rnd=math.random(1,5)
if rnd==2 then
(setElementData(getLocalPlayer(),"Score", +1)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-26, 15:30


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

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
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-26, 22:23


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

addEvent("bus_finish",true)
addEventHandler("bus_finish",rootElement,
function aeda(client)
if not isPedInVehicle(clientthen return end
    if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end
    givePlayerMoney(client30)
    rnd=math.random(1,5)
        if rnd==2 then
        setElementData(client"Score"getElementData(client"Score") + )
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-27, 15:42


flimbo123







Wiek: 33
Na forum: 5776 dni
Posty: 93
Nick w MP: Flimbo

Piwa: 190

Respekt: 60

luki123luki123, [2015-05-27 15] ERROR: Loading script failed: bus/bus.lua:39: '(' expected near 'aeda'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-27, 16:22


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130



addEvent("bus_finish",true)
addEventHandler("bus_finish",rootElement,function(client)
if not isPedInVehicle(clientthen return end
    if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end
    givePlayerMoney(client30)
    rnd=math.random(1,5)
        if rnd==2 then
        setElementData(client"Score"getElementData(client"Score") + )
end
end)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 10:48


flimbo123







Wiek: 33
Na forum: 5776 dni
Posty: 93
Nick w MP: Flimbo

Piwa: 190

Respekt: 60

Loop, nadal pud?o ;x podaje ca?y kod po kuracji waszymi sugestiami:

addEvent("bus_finish",true)
addEventHandler("bus_finish",rootElement,function(client)
if not isPedInVehicle(clientthen return end
    if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end
    givePlayerMoney(client30)
    rnd=math.random(1,5)
        if rnd==2 then
        setElementData(client"Score"getElementData(client"Score") + )
if #busTable == tonumber(getElementData(client,"busData")) then
setElementData(client,"busData",1)
else
setElementData(client,"busData",tonumber(getElementData(client,"busData"))+1)
end
getNewBusLocation(clienttonumber(getElementData(client,"busData")))
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-04, 17:36


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

wyskakuj? jakie? b??dy?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-04, 23:47


PolskiSebek12

Programista






Wiek: 28
Na forum: 4347 dni
Posty: 343
Nick w MP: CrosRoad95

Piwa: 3883

Respekt: 288,8
Respekt: 288,8Respekt: 288,8Respekt: 288,8

Ostrzeżeń: 100%
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

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: prawdopodobieństwo :: przyznania :: punktu :: quotscorequot
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku