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

Wysłany: 2015-08-10, 18:14


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Witam, mam kod na TAXI lecz przerobi?em go. Gdy wchodz? do taxi nie pokazuje mi napisu ?e zosta?em tax?wkarzem. dam kod:

local allow_vehs={
    [420]=true,
}

function wchodziplrseatjacked )
if seat == 0 then
    if not isObjectInACLGroup "user." .. getAccountName(getPlayerAccount(plr)), aclGetGroup "TSA" ) ) and getElementData source"pojazd:TAXI" then 
        cancelEvent()
        outputChatBox "Nie jestes zatrudniony w Frakcji Transport of San Andreas!"plr )
end
end
end
addEventHandler "onVehicleStartEnter"rootwchodzi )


local vehs = { 
{420116.29980468751446.40039062510.43011093139600, -90}, --taxi

{420116.29980468751451.510.43011093139600, -90}, --taxi

{420116.2998046875145610.43011093139600, -90}, --taxi

{420116.29980468751461.599975585910.43011093139600, -90}, --taxi

{420116.29980468751466.699951171910.43011093139600, -90}, --taxi

{420116.29980468751471.510.43011093139600, -90}, --taxi

{420116.29980468751476.510.43011093139600, -90}, --taxi

{420116.29980468751481.699951171910.43011093139600, -90} --taxi
} 

for kv in ipairs(vehs) do
veh createVehicle(unpack(v)) 
setElementData(veh"pojazd:TAXI"true)
setElementData(veh"pojazd_paliwo"100)
end

taxi={}

for k,v in ipairs(vehs)do
    taxi[k]=createVehicle(420,v[1],v[2],v[3])
    setElementData(taxi[k],"vehicle:taxi",true)
end

addEventHandler("onPlayerVehicleEnter",root,function(veh,seat)
    if seat==0 then
        if allow_vehs[getElementModel(veh)] then
            if getElementData(veh,"vehicle:taxi"then
                outputChatBox("*Zosta?e?(a?) taks?wkarzem. Dostaniesz informacj? o po?o?eniu klienta po wezwaniu us?ugi.",source,255,255,255)
                setElementData(source,"player:taxi",true)
            end
        end
    end
    if allow_vehs[getElementModel(veh)] then
        if getElementData(veh,"vehicle:taxi"then
            setElementData(source,"taxi",false)
        end
    end
end)

addEventHandler("onPlayerVehicleExit",root,function(veh,seat)
    if seat==0 then
        if allow_vehs[getElementModel(veh)] then
            if getElementData(veh,"vehicle:taxi"then
                respawnVehicle(veh)
                setElementData(source,"player:taxi",false)
            end
        end
    end
end)



addCommandHandler("wezwtaxi",function(plr)
    if getElementData(plr,"taxi"then
        return outputChatBox("*Zam?wi?e?(a?) ju? us?ug?. Poczekaj cierpliwie na taks?wk?",plr,255,255,0)
    end
    count={}
    for _,v in ipairs(getElementsByType("player"))do
        if getPedOccupiedVehicle(vthen
            if getElementData(getPedOccupiedVehicle(v),"vehicle:taxi"then
                if allow_vehs[getElementModel(getPedOccupiedVehicle(v))] then
                    table.insert(count,v)
                end
            end
        end
    end
    if #count==0 then
        return outputChatBox("*Brak taks?wkarzy na s?u?bie.",plr,255,255,0)
    end
    local x,y,z=getElementPosition(plr)
    for _,v in ipairs(getElementsByType("player"))do
        if getPedOccupiedVehicle(vthen
            if getElementData(getPedOccupiedVehicle(v),"vehicle:taxi"then
                if allow_vehs[getElementModel(getPedOccupiedVehicle(v))] then
                    outputChatBox("--NOWE ZLECENIE--",v,255,255,0)
                    outputChatBox("*Gracz "..getPlayerName(plr).." zam?wi?(a) us?ug? taxi.",v,255,255,0)
                    local miasto=getZoneName(x,y,z)
                    local strefa=getZoneName(x,y,z,true)
                    outputChatBox("*Po?o?enie : "..miasto..", "..strefa,v,255,255,0)
                end
            end
        end
    end
    outputChatBox("*Zam?wi?e?(a?) us?ug? taxi. Czekaj cierpliwie w tym miejscu, taks?wkarz nie b?dzie cie szuka?.",plr,255,255,0)
    setElementData(plr,"taxi",true)
end)


addCommandHandler("oplata",function(plr,cmd,gracz,ilosc)
    if getElementData(plr,"player:taxi"then
        local cel=getPlayerFromName(gracz)
        if cel then
            setElementData(cel,"TaxiInfo",{plr,ilosc})
            outputChatBox("*Gracz "..getPlayerName(plr).." poda?(a) Ci kwitek do zap?aty "..ilosc.." Euro. Aby podpisa? wpisz /akceptuj",cel,255,255,255)
            outputChatBox("*Poda?e?(a?) kwitek klientowi do zap?aty.",plr,255,255,255)
        end
    end
end)

addCommandHandler("akceptuj",function(plr)
    if getElementData(plr,"TaxiInfo"then
        local taksowkarz,ilosc=unpack(getElementData(plr,"TaxiInfo"))
        local taksowkarz=getPlayerFromName(getPlayerName(taksowkarz))
        if not taksowkarz then
            return outputChatBox("*Taks?wkarz nie jest ju? online",plr,255,255,255)
        end
        if tonumber(getPlayerMoney(plr))<tonumber(iloscthen
            return outputChatBox("*Nie posiadasz pieni?dzy aby podpisa? kwitek z kwot? "..ilosc.." Euro",plr,255,255,255)
        end
        givePlayerMoney(taksowkarz,tonumber(ilosc))
        takePlayerMoney(plr,tonumber(ilosc))
        outputChatBox("*Podpisa?e? kwitek. Zabrano Ci "..ilosc.." Euro",plr,255,255,255)
        outputChatBox("*Gracz "..getPlayerName(plr).." podpisa? kwitek. Otrzymujesz "..ilosc.." Euro",taksowkarz,255,255,255)
    end
end)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 18:42


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

DB3

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 18:55


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

barcioo, brak

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 18:59


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%

setElementData(veh"pojazd:TAXI"true)



if getElementData(veh,"vehicle:taxi"then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 19:07


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

DestroY, zamieni? to ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 19:10


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Nadajesz jedn? elementDate, sprawdzasz drug?... Wyci?gnij sobie z tego wnioski.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 19:12


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

DestroY, Nie rozumiem :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 19:16


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
DATA1 MUSI BY? TYM SAMYM CO DATA2
Date 1 nadajesz w tym pierwszym... A date2 sprawdzasz w tym drugim....

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 19:25


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

DestroY, kt?ra to data 1 i data 2 ?

[ Dodano: 2015-08-10, 19:29 ]
DestroY, dobra dzia?a znalaz?em :)
do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: czemu :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » czemu nie działa 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