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

Wysłany: 2016-01-09, 21:05


Shorn

Wariat lua






Wiek: 28
Na forum: 3884 dni
Posty: 41
Nick w MP: Szorn

Piwa: 537

Respekt: 0

Siemanko, gtaonline.pl pisa?em ostatnio skrypt na prywatne pojazdy, ale niestety wyskakuj? bug i nie wiem jak go naprawi?. Mianowicie chodzi o to, ?e gdy zarejestruj pojazd wy?wietla si? napis ka?demu graczowi "ZAREJESTROWANE", licze na wasz? pomoc ! :)
Kod:

function wsiadanie ( player, seat, jacked )
if seat == 0 then
kierowca = getVehicleOccupant ( source, 0 )
if getPlayerName (kierowca) ~= getPlayerName ( player ) then
cancelEvent() return end
local name = getPlayerName ( source )
if getElementData(source, "prywatne") then
local accName = getAccountName ( getPlayerAccount ( player ) )
if getElementData(source, "wlasciciel") == getAccountName(getPlayerAccount(player)) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Urzad" ) ) then
else
cancelEvent()
co = getPedOccupiedVehicle ( player )
nazwa = getVehicleName ( co )
owner2 = getElementData ( co, "wlasciciel" )
outputChatBox ("Nie posiadasz kluczy do tego pajazu.", player)
end
end
end
end
addEventHandler ( "onVehicleStartEnter", getRootElement(), wsiadanie )

function wlasciciel ( player, cmd, owner )
local accName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Urzad" ) ) then
local auto = getPedOccupiedVehicle ( player )
wlasciciel = partName ( plr, owner )
if wlasciciel then
name = getPlayerName ( wlasciciel )
setElementData(auto, "prywatne", true)
setElementData(auto, "wlasciciel", name)
outputChatBox ( "ZAREJESTROWANE", plr )
else
end
end
end
addCommandHandler("zarejestruj", wlasciciel )

function partName(plr,cel)
local target=nil
if (tonumber(cel) ~= nil) then
target=getPlayerID(cel)
else
for _,v in ipairs(getElementsByType("player")) do
if string.find(string.gsub(getPlayerName(v):lower(),"#%x%x%x%x%x%x", ""), cel:lower(), 1, true) then
if (target) then
outputChatBox ("Znaleziono wi?cej ni? jednego gracza o pasuj?cym nicku.\nPodaj wi?cej liter.", player)
return nil
end
target=v
end
end
end
return target
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 22:24


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

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


function wsiadanie playerseatjacked ) 
if seat == 0 then 
kierowca getVehicleOccupant source) 
if getPlayerName (kierowca) ~= getPlayerName player then 
cancelEvent() return end 
local name getPlayerName source ) 
if getElementData(source"prywatne"then 
local accName getAccountName getPlayerAccount player ) ) 
if getElementData(source"wlasciciel") == getAccountName(getPlayerAccount(player)) or isObjectInACLGroup ("user."..accNameaclGetGroup "Urzad" ) ) then 
else 
cancelEvent() 
co getPedOccupiedVehicle player nazwa getVehicleName co owner2 getElementData co"wlasciciel" outputChatBox ("Nie posiadasz kluczy do tego pajazu."playerend 
end 
end 
end 
addEventHandler "onVehicleStartEnter"getRootElement(), wsiadanie ) 

function wlasciciel playercmdowner local accName getAccountName getPlayerAccount player ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "Urzad" ) ) then 
local auto getPedOccupiedVehicle player wlasciciel partName plrowner ) 
if wlasciciel then 
name getPlayerName wlasciciel setElementData(auto"prywatne"truesetElementData(auto"wlasciciel"nameoutputChatBox "ZAREJESTROWANE"player ) 
else 
end 
end 
end 
addCommandHandler("zarejestruj"wlasciciel ) 

function partName(plr,cellocal target=nil 
if (tonumber(cel) ~= nilthen 
target=getPlayerID(cel) 
else 
for _,v in ipairs(getElementsByType("player")) do 
if string.find(string.gsub(getPlayerName(v):lower(),"#%x%x%x%x%x%x"""), cel:lower(), 1truethen 
if (targetthen 
outputChatBox ("Znaleziono wi?cej ni? jednego gracza o pasuj?cym nicku.\nPodaj wi?cej liter."player) 
return nil 
end 
target=v 
end 
end 
end 





testuj

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: 2016-01-09, 23:10


Shorn

Wariat lua






Wiek: 28
Na forum: 3884 dni
Posty: 41
Nick w MP: Szorn

Piwa: 537

Respekt: 0

Jurandovsky, SCRIPT ERROR: [RPG]/zaparkuj/rejestracja.lua:54: 'end' expected (to close 'function' at line 38) near '<eof>'
ERROR: Loading script failed: [RPG]/zaparkuj/rejestracja.lua:54: 'end' expected (to close 'function' at line 38) near '<eof>

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-10, 14:23


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Podmie? na t? funkcj? i powinno lata?:

function partName(plr,cellocal target=nil 
if (tonumber(cel) ~= nilthen 
target=getPlayerID(cel) 
else 
for _,v in ipairs(getElementsByType("player")) do 
if string.find(string.gsub(getPlayerName(v):lower(),"#%x%x%x%x%x%x"""), cel:lower(), 1truethen 
if (targetthen 
outputChatBox ("Znaleziono wi?cej ni? jednego gracza o pasuj?cym nicku.\nPodaj wi?cej liter."player) 
return nil 
end 
target=v 
end 
end 
end 
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-10, 15:56


Shorn

Wariat lua






Wiek: 28
Na forum: 3884 dni
Posty: 41
Nick w MP: Szorn

Piwa: 537

Respekt: 0

DestroY, Pokazuje, ?e skrypt dzia?a itp. Ale nie rejestruje.

Postaw piwo autorowi tego posta
 

 
Tagi: rejestracja :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Rejestracja pojazdu 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