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

Wysłany: 2020-12-11, 10:06


_Dlek_

vifon'ik






Wiek: 18
Na forum: 2329 dni
Posty: 57
Nick w MP: vifon'ik

Piwa: 1967

Respekt: 60

Witam mam pytanko do was robi? frakcje SWAT i chc? zrobi? aby po wej?ciu do markera nadawa?o skina ale nie wiem jak to zrobi? poni?ej dam skrypt i pytanko do was jak to zrobi? i gdzie wklei? tekst z nadawniem skina


Cytat:

local marker=createMarker(1146.30, -2062.24, 69.27, 'cylinder', 1.5, 0, 0, 255, 150)
setElementDimension(marker, 0)
setElementInterior(marker, 0)


local licz = {}
local t=createElement('text')
setElementData(t,'name','S?u?ba\nAmeryka?ska Wyspecjalizowana Jednostka Policji\n[S.W.A.T]')
setElementDimension(t, 0)
setElementInterior(t, 0)
setElementPosition(t,1146.30, -2062.24, 69.27)



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

local result=exports['pystories-db']:dbGet('SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;', "SWAT", sid)
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:faction') then
exports['ustawienia-all-frakcji']:rozpocznijnaliczanie(el)
setElementData(el,'player:faction','SWAT')
local rank = exports['ustawienia-all-frakcji']:getPlayerFactionRank(el,'SWAT')
setElementData(el,"player:rank",rank)
--giveWeapon(el,23,9999)
--giveWeapon(el,22,9999)
setElementData(el,"last:nick",getPlayerName(el))
setElementData(el,"last:color",tostring(getPlayerNametagColor(el)))
setPlayerName(el,"#000000"..getPlayerName(el):gsub("#%x%x%x%x%x%x",""))
outputChatBox("* Rozpocz??e?(a?) s?u?be w S.W.A.T, zmie? swojego skina i we? wyposa?enie", el)
else
takeWeapon(el,23)
takeWeapon(el,3)
takeWeapon(el,25)
takeWeapon(el,29)
takeWeapon(el,30)
takeWeapon(el,22)
exports['psrpg-frakcja-ustawienia']:zatrzymajnaliczanie(el)
setPedSkin (localPlayer,269)
setElementData(el, 'player:faction', false)
setElementData(el,"player:rank",false)
local skin=getElementData(el,"player:skin")
setElementModel(el, skin)
setPlayerName(el,getElementData(el,"last:nick"))
outputChatBox("* Zako?czy?e?(a?) s?u?be w S.W.A.T.", el)
end
else
outputChatBox('* Nie jeste? zatrudniony(a) jako S.W.A.T.', 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 (1155.11, -2062.13, 69.27, "cylinder", 1.5, 0, 255, 0, 255 )
setElementDimension(bronie2, 0)
setElementInterior(bronie2, 0)
local t=createElement("text")
setElementData(t,"name", "Wyposa?enie Ameryka?ska Wyspecjalizowana Jednostka Policji")
setElementPosition(t,1155.11, -2062.13, 69.27)
setElementDimension(t, 0)
setElementInterior(t, 0)


function bronie11(hitElement, matchingDimension)
if source == bronie2 then
if getElementData(hitElement,"player:faction") == "SWAT" then
--if getElementData(hitElement,'player:rank') <= 4 then hitElement:outputChat("* Jeste? aktualnie podczas akademii, nie przys?uguje Ci wyposa?enie!") return end
outputChatBox("* Wzi??e?(a?) swoje wyposa?enie!", hitElement)
giveWeapon(hitElement, 23, 100000)
giveWeapon(hitElement, 3, 100000)
giveWeapon(hitElement, 25, 100000)
giveWeapon(hitElement, 29, 100000)
giveWeapon(hitElement, 30, 100000)
else
outputChatBox ("* Nie jeste? na s?u?bie, lub nie pracujesz w S.W.A.T", hitElement)
end
end
end
addEventHandler ("onMarkerHit", bronie2, bronie11
)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-11, 10:08


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3099 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

_Dlek_, masz
setPedSkin (localPlayer,269


setPedSkin zmie? na


Więcej informacji znajdziesz w Wikipedii MTA:

setElementModel



setElementModel (el,IDSKINA)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KosteQ010
Tagi: swat
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » SWAT Odpowiedz do tematu

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