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

Wysłany: 2018-08-22, 01:01


AsterBonzo

Otwórz ogień






Wiek: 21
Na forum: 3110 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 61

Respekt: 35,8

No wracaj?c do tego to jak robi? 2 marker to go nie pokazuje tylko daje skina w tym miejscu co jest marker i tego markera nie wida? jest pustka tylko daje skin tak jakby z d*py

kodzik

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) 

local marker2 = createMarker( 250.75, -1867.95, 10.84, "cylinder", 1.0, 255, 255, 255) 
setElementDimension(marker, 2) 

function skin2(thePlayer) 
if source == marker2 then
if getElementData(thePlayer,"player:duty") == "SFPD" then
setElementModel(thePlayer, 281) 
else return outputChatBox("#FF0000* #00FF99Nie jeste? policjantem lub nie jeste? na s?u?bie", thePlayer) 
end
else return end
end 
addEventHandler ("onMarkerHit", getRootElement(), skin2) 




na samym dole

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 01:03


Emm

***** ***






Wiek: 32
Na forum: 4022 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6171

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
To:
local marker2 = createMarker( 250.75, -1867.95, 10.84, "cylinder", 1.0, 255, 255, 255) 
setElementDimension(marker, 2) 

Popraw na:
local marker2 = createMarker( 250.75, -1867.95, 10.84, "cylinder", 1.0, 255, 255, 255) 
setElementDimension(marker2, 2) 


Marker by? w wymiarze domy?lnym (0), a nie 2. Ma?e niedopatrzenie przy dodawaniu drugiego markera. :P

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! 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.
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
AsterBonzo
Tagi: wracając :: tamtego :: tematu :: pt. :: skiny :: dla :: policji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Wracając do tamtego tematu pt. SKINY DLA POLICJI 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