! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
local marker = createMarker( 245.54, -1867.79, 10, "cylinder", 1.0, 255, 255, 255)
setElementDimension(marker, 2)
function skin(thePlayer)
if source == marker then
if (getElementData(thePlayer, "SFPD") == true) then
setElementModel(thePlayer, 280)
else return outputChatBox("* Nie jeste? policjantem lub nie jeste? na s?u?bie", thePlayer) end
else return end
end
addEventHandler ("onMarkerHit", getRootElement(), skin)
Je?li nie zadzia?a, to poka? mi kod odpowiedzialny za wchodzenie na s?u?b?.
! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
masz wchodzenie na s?u?b? poniewa? to co przed chwil? da?e? to co? te? nie dzia?a
s_duty.lua
local marker=createMarker(265.78, -1861.70, 10.84-0.8, 'corona', 1, 0, 0, 255,255)
setElementDimension(marker, 2)
setElementInterior(marker, 0)
local licz = {}
local t=createElement('text')
setElementData(t,'name','San Fierro Police Departament\nSFPD\nRozpocz?cie S?u?by')
setElementDimension(t, 2)
setElementInterior(t, 0)
setElementPosition(t,265.78, -1861.70, 10.84)
function isPlayerInPoliceFaction(plr)
local uid=getElementData(plr,'player:uid')
if not uid then return end
local result=exports['ogrpg-db']:dbGet('SELECT 1 FROM ogrpg_factions WHERE code=? AND uid=? LIMIT 1;', "SFPD", uid)
if result[1] then
return true
else
return false
end
end
addEventHandler('onMarkerHit', marker, function(el,md)
if isPlayerInPoliceFaction(el) then
if not getElementData(el,'player:duty') then
setElementModel(el,71)
--setPlayerNametagColor(el,0,0,255)
outputChatBox ("✰ ✰ Rozpoczo?e?(a?) s?u?b? ✰ ✰", el, 0,255,17)
exports['frakcja']:rozpocznijnaliczanie(el)
setElementData(el,'player:duty','SFPD')
local rank = exports['frakcja']:getPlayerFactionRank(el,'SFPD')
setElementData(el,"player:rank",rank)
giveWeapon(el,23,9999)
giveWeapon(el,3,9999)
setPlayerName(el,"#0000CD"..getPlayerName(el):gsub("#%x%x%x%x%x%x",""))
--setPlayerNametagColor(el,0,191,255)
executeCommandHandler("setblipcolor",el,0,0,205)
local uid=getElementData(el,'player:uid')
exports['ogrpg-db']:dbSet('UPDATE ogrpg_factions set actived=NOW() WHERE code=? AND uid=? LIMIT 1;', "SFPD", uid)
else
takeWeapon(el,23)
exports['frakcja']:zatrzymajnaliczanie(el)
setElementData(el, 'player:duty', false)
setElementData(el,"player:rank",false)
local skin=getElementData(el,"player:skin")
outputChatBox ("✰ ✰ Zako?czy?e?(a?) s?u?b? ✰ ✰", el, 255,0,0)
setElementModel(el, skin)
local uid=getElementData(el,'player:uid')
setPlayerName(el,getPlayerName(el):gsub("#%x%x%x%x%x%x",""))
takeAllWeapons(el)
executeCommandHandler("setblipcolor",el,255,255,255)
end
else
outputChatBox('* Nie jeste? zatrudniony jako SFPD.', el, 255, 0, 0)
end
end)
function naliczanie(el)
if isElement(el) then
local x = getElementData(el,"player:workinjob") or 0
setElementData(el,"player:workinjob",x+1)
else
if isTimer(licz[el]) then
killTimer(licz[el])
licz[el] = nil
end
end
end
local bronie2 = createMarker ( 251.38, -1864.04, 10.84-0.90, "cylinder", 1.0, 0, 255, 0, 255 )
setElementDimension(bronie2, 2)
setElementInterior(bronie2, 0)
local t=createElement("text")
setElementData(t,"name", "Wyposa?enie S.F.P.D")
setElementPosition(t,251.38,-1864.04,-10.84+1.3)
setElementDimension(t, 2)
setElementInterior(t, 0)
function bronie11(hitElement, matchingDimension)
if source == bronie2 then
if getElementData(hitElement,"player:duty") == "SFPD" then
if getElementData(hitElement,'player:rank') <= 9 then hitElement:outputChat("Jeste? aktualnie podczas akademii, nie przys?uguje Ci wyposa?enie!") return end
outputChatBox("Wzia?e? wyposa?enie S.F.P.D!", hitElement)
giveWeapon(hitElement, 31, 100000)
else
outputChatBox ("* Nie jeste? zatrudniony, lub nie jeste? na s?uzbi?!", hitElement)
end
end
end
addEventHandler ("onMarkerHit", bronie2, bronie11)
local marker = createMarker( 245.54, -1867.79, 10, "cylinder", 1.0, 255, 255, 255)
setElementDimension(marker, 2)
function skin(thePlayer)
if source == marker then
if getElementData(thePlayer,"player:duty") == "SFPD" then
setElementModel(thePlayer, 280)
else return outputChatBox("* Nie jeste? policjantem lub nie jeste? na s?u?bie", thePlayer) end
else return end
end
addEventHandler ("onMarkerHit", getRootElement(), skin)
By?a ca?kiem inna elementdata, dlatego nie dzia?a?o... Sprawdzaj
! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
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