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

Wysłany: 2018-12-01, 19:07


AkossPL







Wiek: 25
Na forum: 4079 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Siema taj jak w temacie za pomoc stawiam :piwo:

local door1 createObject(3089, -50.099609375,30.900390625,980.90002441406,0,0,0)
local door2 createObject(3089, -60.669921875,13.5,980.90002441406,0,0,0)
setElementInterior(door12)
setElementInterior(door22)
local marker1 createMarker(-49.44,30.95,980.61-1"cylinder"1.82552552550)
setElementInterior(marker12)
local marker2 createMarker(-59.94,13.53,980.61-1"cylinder"1.82552552550)
setElementInterior(marker22)

function isPlayerInPoliceFaction(plr)
 local sid=getElementData(plr,'player:uid')
 if not sid then return end

 local result=exports['ogrpg-db']:dbGet('SELECT 1 FROM ogrpg_factions WHERE code=? AND sud=? LIMIT 1;'"SAPD"uid)
 if result[1then
  return true
 else
  return false
 end
end

addEventHandler("onMarkerHit"marker1, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    local pxpypz getElementPosition(door1)
    moveObject(door12000px+2pypz)
end)

addEventHandler("onMarkerLeave"marker1, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    moveObject(door12000, -50.09960937530.900390625980.90002441406)
end)

addEventHandler("onMarkerHit"marker2, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    local pxpypz getElementPosition(door2)
    moveObject(door22000px+2pypz)
end)

addEventHandler("onMarkerLeave"marker2, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    moveObject(door22000, -60.66992187513.5980.90002441406)
end)


local bramaSAPD createObject(971, -1572.0999755859661.299987792979.69999980926510090)
local bramaSAPDm createMarker(-1572.25,661.65,7.19-1"cylinder"82552552550)

addEventHandler("onMarkerHit"bramaSAPDm, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    local pxpypz getElementPosition(bramaSAPD)
    moveObject(bramaSAPD4000pxpypz-15)
end)

addEventHandler("onMarkerLeave"bramaSAPDm, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    moveObject(bramaSAPD4000, -1572.0999755859661.299987792979.6999998092651)
end)

local bramaSAPD2 createObject(971, -1701.18683.8624.820090)
local bramaSAPD2m createMarker(-1701.18683.8624.82-1"cylinder"82552552550)

addEventHandler("onMarkerHit"bramaSAPD2m, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    local pxpypz getElementPosition(bramaSAPD2)
    moveObject(bramaSAPD23000, -1701.18683.8624.82-10)
end)

addEventHandler("onMarkerLeave"bramaSAPD2m, function(el)
    if not isPlayerInPoliceFaction(elthen return end
    moveObject(bramaSAPD21000, -1701.18683.8624.82)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-01, 19:25


Query

SyndicateMTA






Wiek: 24
Na forum: 3072 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

Debugscript 3 ?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-01, 19:39


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Problem le?y w tej funkcji:

function isPlayerInPoliceFaction(plr)
 local sid=getElementData(plr,'player:uid')
 if not sid then return end

 local result=exports["ogrpg-db"]:dbGet("SELECT 1 FROM ogrpg_factions WHERE code=? AND sud=? LIMIT 1""SAPD"sid)
 if result[1then
  return true
 else
  return false
 end
end


Zmienna elementDaty 'player:uid' si? nie zgadza z t?, kt?r? sprawdzasz w MySQL.
Upewnij si?, czy w bazie 'ogrpg_factions' masz kolumny 'code' i 'sud'.

Spr?buj co? takiego:
function isPlayerInPoliceFaction(plr)
 local sid=getElementData(plr,'player:uid')
 if not sid then return end

 local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_factions WHERE code=? AND sud=? LIMIT 1""SAPD"sid)
 if result[1then
  return true
 else
  return false
 end
end


Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działa :: brama :: dla :: frakcji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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