Witam, nie tworzy mi markeru do budynku prawa jazdy, czy wszystko tu jest dobrze napisane? Jezeli tak to jaki mo?e by? pow?d?
////////////////////////////////////////////////
[Lua]
createBlip(1112.52, -1835.87, 16.60, 36,2,0,0,0,0,0,275)
local text=createElement("text")
setElementPosition(text,1112.52, -1835.87, 16.60+0.8)
setElementData(m, "text","Wej?cie Prawo jazdynLos Santos")
local text=createElement("text")
setElementPosition(text,-2026.88, -103.60, 1035.18+0.8)
setElementData(text,"name","Wyj?cie z prawa jazdy nLos Santos")
setElementInterior(text, 3)
setElementDimension(text, 1)
addEventHandler("onMarkerHit", wejscie, function(el, md)
if getElementType(el) ~= "player" then return end
if isPedInVehicle(el) then return end
setElementInterior(el, 3)
setElementDimension(el, 1)
setElementPosition(el, -2029.72, -106.90, 1035.17)
end)
addEventHandler("onMarkerHit", wyjscie2, function(el, md)
if isPedInVehicle(el) then return end
setElementInterior(el, 0)
setElementDimension(el, 0)
...
Tak jak w tytule, po zdaniu prawa jazdy (testowa?em kat B). Gdy zdamy i wsi?dziemy do auta to mo?emy je?dzi? bo mamy prawko, ale po reconnec'tcie ju? usuwa nam prawko. Miesza?em w kodzie z tego prawka bo wklei?em du?? cz??? z innego skryptu prawka (te? z ogrpg-office) z ogrpg tak samo, i mo?liwe ?e oni mieli inny wygl?d kodu i np te PjA to u nich Pj albo katA czy jakos tak, dlatego pisze do was bo nie mam poj?cia jak naprawi? to
Kody w bazie danych kt?re zapisuje prawko:
PjA
PjB
PjC
PjL
Jest to domy?lny skrypt z ogrpg w ogrpg-office
s_zdawanie:
[lua]
local wolneMiejsce=createColSphere(-1978.88, 461.45, 28.68,4)
local wolneMiejsce2=createColSphere(-1306.51, 73.28, 14.54,10)
Witam! Mam pewien k?opot z oddaniem prawa jazdy za pomoc? komendy na paczce pystories. Ot?? gdy zabieram prawo jazdy jest wszystko okej, gracz nie mo?e wej?? do pojazdu, ale gdy pr?buj? odda? prawo jazdy wy?wietla mi si? "* Gracz Bloodas nie posiada zabranego prawka!"
Pr?bowa?em zamienia? pystories-db z DB2 i na odwr?t.
Kod
[lua]function getVehicleKey(plr,veh)
if plr and veh then
local uid=getElementData(plr,"player:uid")
if not uid then return end
if getElementData(plr,"player:admin") or uid == getElementData(veh,"vehicle:ownedPlayer") then
return true
else
return false
end
end
end
local categoryL={[592] = true,[553] = true,[577] = true,[488] = true,[511] = true,[497] = true,[548] = true,[563] = true,[512] = true,[476] = true,[593] = true,[447] = true,[425] = true,[519] = true,[520] = true,[460] = true,[417] = true,[469] = true,[487] = true,[513] = true}
addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if getElementHealth(source) < 302 then
setElementHealth(source,302)
end
end)
function jestwtabeli(***,truj)
for k,v in pairs(***) do
if v == truj then
return true
end
end
return false
end
addCommandHandler("share",function(plr,cmd,target)
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("#bf0101(✖) #FFFFFFNie siedzisz w aucie!",plr,255,255,255, true) return end
if getElementData(veh,"vehicle:ownedPlayer") ~= getElementData(plr,"player:uid") then outputChatBox("* Ten pojazd nie nale?y od ciebie!",plr...
cze?? s?uchajcie ja ju? nie wiem w czym tkwi problem wszystko jest podpi?te pod mysql do acl doda?em offices core i dutyadmin oraz vechices a nadal gdy zabior? prawo jady to mo?na nadal wsiada? do pojazdu zna kto? na to rozwi?zanie?
Napisa?em co? takiego ale jak kto? nie ma prawa jazdy i tak mo?e wej?? do pojazdu co jest nie tak ? dzi?kuj? za pomoc
if getElementData(el,"player:license:pjB") ~= 1 then
outputChatBox("Nie posiadasz prawa jazdy KAT: C lub zosta?o ono wstrzymane !",el,255,0,0,true)
return
end
addEventHandler("onClientVehicleExit",root,function (plr,seat)
if plr == localPlayer and seat == 0 and getElementData(source,"zapelnienie") then
-- triggerServerEvent("cancelJob",resourceRoot,source)
setElementData(plr,"player:job",nil)
for i,v in ipairs(getElementsByType("marker")) do
if getElementData(v,"wlasnosc") == getPlayerName(plr) then
destroyBlipsAttachedTo(v)
destroyElement(v)
end
end
end
end)
Wchodz? w marker i nic nie dzia?a dlatego ,?e doda?em ,?e jak kto? ma zabrane prawko nie mo?e prowadzi? a tu skrypt si? zepsu? marker wszystko jest ale jak wchodz? nic si? nie dzieje
addEvent("mower:stopJOB", true)
addEventHandler("mower:stopJOB", root, function(veh)
if not veh then return end
destroyElement(veh)
end)
local zone = createColSphere(-2465.28,-322.64,41.93, 5, 4.5, 2)
addEventHandler("onMarkerHit", m, function(el,md)
if getElementData(plr,"player:license:pj"..type.."") ~= 1 then
outputChatBox("* Nie posiadasz prawa jazdy kategorii "..type..", zdaj je w urz?dzie miasta", plr, 255, 0, 0)
return true
end
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_punish WHERE serial=? AND type=? AND active=1 AND time>NOW()", getPlayerSerial(plr), tostring(type))
if result and #result > 0 then
v=result[1]
outputChatBox("* Posia...
Mam taki ma?y problem mam skrypty na zabieranie prawka po??czone z mysql
Problem le?y w 2 rzeczach 1. Gdy jestem "nowym" graczem moge odrazu do wszystkiego wsiada?.Problem 2 to jest ?e gdy mam zawieszony prawa jazdy nadal moge wsiadac a w db 3 nic nie pisze o bledzie
Daje wam linijki Kod?w oraz ss myqsl
Komenda admina na zabierania Prawka
[lua]
addCommandHandler("zpj", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
outputChatBox("* U??ycie: /zpj <nick/ID> <czas> <jednostka: m/h/y/w> <pow?d>", plr)
return
end
local target=exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
result=pobierzDate(type,time)
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target).."("..getElementData(target,"id")..") otrzyma?/a zakaz prowadzenia pojazd?w kat(ABC) od "..getPlayerName(plr)..": "..reason.."("..time .. type ..")")
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSeri...
[lua]function zabierzprawko ( policjant, commandName, gracz )
local accName = getAccountName ( getPlayerAccount ( policjant) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
local gracz1 = getPlayerFromName ( gracz )
local konto = getPlayerAccount ( gracz1 )
local nickgracza = getPlayerName ( gracz1 )
local nickpolicjanta = getPlayerName ( policjant )
if not getAccountData(konto, "prawojazdy") then
outputChatBox("Gracz "..nickgracza.." nie posiada prawa jazdy", policjant)
else
setAccountData(konto, "prawojazdy", false)
end
else
outputChatBox("Nie jeste? Administratorem!", policjant)
end
end
addCommandHandler("zabierz.prawko", zabierzprawko )
addEventHandler("onVehicleStartEnter", getRootElement(), function(plr, seat, jacker)
local acc = getPlayerAccount(plr)
if katb[getElementModel(source)] then
if seat == 0 then
if getAccountData(acc,"licences:Prawojazdy:B") == false then
cancelEvent()
outputChatBox("#33CCCC[Informacja]#FFCC99Nie posiadasz prawa jazdy kategorii #FF0000B #FFCC9aby prowadzi? ten pojazd.", plr, 255, 255, 255, true)
end
end
end
end)
[/lua]
Witam, mam problem z tym, ?e gdy kto? chcia?by otworzy? jaki? samoch?d to poprostu zmienia nick na nick w?a?ciciela. Chcia?bym ukr?ci? te procedery i poprostu nada? prawa do operowania samochodem osobie kt?ra jest zalogowana na konto w?a?ciciela auta.
[code]
function enterVehicle ( source, seat, jacked )
local playercar = getPedOccupiedVehicle ( source )
if(seat == 0) then
if (getElementData ( playercar, "owner" )) then
if(getElementData ( playercar, "owner" ) ~= "Nobody" ) then
if(getElementData ( playercar, "owner" ) == getPlayerName ( source )) then
outputChatBox ("To twoj pojazd!",source, 255,255,127 )
else
outputChatBox ("Ten pojazd jest wlasnoscia: "..getElementData ( playercar, "owner" ).."",source, 255,255,127 )
end
else
local price = getElementData ( playercar, "price" )
triggerClientEvent ( source, "showBuyCar", source, price)
toggleAllControls ( source, false, true, false )
return true
end
end
end
end
1.Zrobi?em sobie Frakcje, ale jak dodam kogo? do frakcji i gracz wyjdzie wejdzie na serwer to ju? nie jest w tej Frakcji.
2.Prosz? o pomoc w rozdaniu praw, ?eby tylko Policja mog?a u?ywa? komend
/jail /mandat. Oraz jak naci?nie "P" to ?eby mia?a tylko jedn? zak?adk? "Players".
A reszt? zablokowane. Oraz ?eby tylko Policja mog?a nosi? skiny Policji oraz wsiada? do radiowoz?w policyjnych .