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[1] then
return true
else
return false
end
end
addEventHandler("onMarkerHit", marker1, function(el)
if not isPlayerInPoliceFaction(el) then return end
local px, py, pz = getElementPosition(door1)
moveObject(door1, 2000, px+2, py, pz)
end)
addEventHandler("onMarkerLeave", marker1, function(el)
if not isPlayerInPoliceFaction(el) then return end
moveObject(door1, 2000, -50.099609375, 30.900390625, 980.90002441406)
end)
addEventHandler("onMarkerHit", marker2, function(el)
if not isPlayerInPoliceFaction(el) then return end
local px, py, pz = getElementPosition(door2)
moveObject(door2, 2000, px+2, py, pz)
end)
Witam,
mam problem mam gm pysa, i chcia?bym podlaczyc frakcje z Calm Life lecz cos nie dzia?a nie ma b??d?w w debugscript 3.
kod:
[lua]--[[
@Author: NeX (meta.xml->informacje)
@Copyright: NeX, 2015/2016/2017/[...]
@Pierwotne prawo do u?ytku tego skryptu ma TYLKO autor i serwery otrzymuj?ce zgod? na jego u?ytkowanie przez autora
@Obowi?zuje ca?kowity zakaz rozpowszechniania skrypt?w, zmiany autora, edycji skrypt?w bez zgody autora
@Obowi?zuje ca?kowity nakaz zachowania autora po uzyskaniu zgody na u?ywanie skryptu przez autora
@Nakazuje si? zastosowa? do regulaminu zawartego w licencji skryptu
--Skrypt zrobiony przez "NeX".
--Nie masz prawa u?ytkowa? tego skryptu bez mej zgody.
--Pierwotne prawo do u?ytkowania tego skryptu ma tylko i wy??cznie autor[NeX] oraz wydane zezwolenie: 4Life (4Life MTA,[www.mta4life.pl])
--Z?amanie powy?szych podpunkt?w wi??e si? z odpowiedzialno?ci? karn?, "Naruszenie praw autorskich".
Kontakt do zezwolenia na u?ytek skryptu:
E-Mail: [email protected]
]]
function findPlayer(plr,cel)
local target=nil
if (tonumber(cel) ~= nil) then
target=getElementByID("p"..cel)
else -- podano fragment nicku
for _,thePlayer in ipairs(getElementsByType("player")) do
if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), cel:lower(), 1, true) then
if (target) then
output...
Chodzi konkretnie o Frakcj? samc, mo?na si? zalogowa?, panel dzia?a i wszystko jest niby git, ale nie mo?na si? wylogowa? z frakcji, jedyny spos?b na wylogowanie si? z frakcji to reconnect, a to bez sensu, czy kto? by mi umia? pom?c? ;/
local t=createElement('text')
setElementData(t,'name','S?u?banSan Andreas Medical Centern[SAMC]')
setElementDimension(t, 0)
setElementInterior(t, 0)
setElementPosition(t,-2630.38,631.04,56.34)
local licz = {}
function isPlayerInFaction(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;', "SAMC", sid)
if result[1] then
return true
else
return false
end
end
addEventHandler('onMarkerHit', marker, function(el,md)
if isPlayerInFaction(el) then
if not getElementData(el,'player:duty') then
setElementModel(el,274)
exports['pystories-frakcja-ustawienia']:rozpocznijnaliczanie(el)
setElementData(el,'player:faction','SAMC')
local rank = exports['pystories-frakcja-ustawienia']:getPlayerFactionRank(el,'SAMC')
setElementData(el,"player:rank",rank)
else
exports['pystories...
local t=createElement('text')
setElementData(t,'name','Rozpocz?cie pracy')
setElementDimension(t, 0)
setElementInterior(t, 0)
setElementPosition(t,-2633.30,632.90,56.34)
local licz = {}
function isPlayerInFaction(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;', "SAMC", uid)
if result[1] then
return true
else
return false
end
end
addEventHandler('onMarkerHit', marker, function(el,md)
if isPlayerInFaction(el) then
if not getElementData(el,'player:duty') then
setElementModel(el,274)
exports['frakcja']:rozpocznijnaliczanie(el)
setElementData(el,'player:duty',"SAMC")
local rank = exports['frakcja']:getPlayerFactionRank(el,'SAMC')
setElementData(el,"player:rank",rank)
setElementData(el,"last:color",tostring(getPlayerNametagColor(el)))
...
Witam ot?? mam problem poniewa? do scoreboardu potrzebny jest elementdata frakcji i nie wiem jak go doda? kto? by zedytowa? ten kod i by mi doda? elemndate frakcja ? Dam zimne I respekt! [code]Administracja = createTeam ( "Administracja", 255, 0, 0 )
function AdminiXD ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then
setPlayerTeam ( thePlayer, Administracja )
else
outputChatBox( "Nie jestes administratorem!", thePlayer, 255, 0, 0, false)
end
end
addCommandHandler ( "dutyadmin", AdminiXD )
Support = createTeam ( "Support", 0, 255, 0 )
function SapkiXD ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Moderator" ) ) then
setPlayerTeam ( thePlayer, Support )
else
outputChatBox( "Nie jestes Supportem!", thePlayer, 255, 0, 0, false)
end
end
addCommandHandler ( "dutysupport", SapkiXD )
PSP = createTeam ( "PSP", 255, 0, 0 )
function PSPXD ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "PSP" ) ) then
setPlayerTeam ( thePlayer, PSP )
else
outputChatBox( "Nie jestes w PSP!", thePlayer, 255, 0, 0, false)
...
Jak zrobi?, aby po zalogowaniu na s?u?b? (na przyk?ad trigger) osobom kt?re posiadaj? dat? SAPD mia?y niebieski blip no i na odwr?t kto? jest na s?u?bie widzi m?j blip niebieski?
Jak zastosowa? setTimer czy czym innym?
Witam
Mam ot?? problem poniewa? chc? stworzy? system wezwa? dla frakcji. Problem m?j polega na tym ?e nie wiem jak zrobi? jak wpisz? komend? np: /997 Wypadek
I chc? aby pojawia?o si? to w panelu na komisariacie na grid li?cie ?e gracz: xJakob Cel: Wypadek Lokalizacja : i tutaj chc? aby pobra?o lokalizacj? osoby sk?d wys?a?a to zg?oszenie. I przyciski przyj?te. Odrzucone i wtedy jak si? przyjmie to znika ju? z panelu a jak odrzucone to tak samo znika z panelu.
Od razu m?wi? nie jest to ?aden ogrpg tylko pisz? autorski gm na bazie xyzzyrp
Chc? aby te? zapisywa?o to w mysql
jak w temacie i opisie mam problem z GM IYW ( It's Your World)
Nie wiem jak dac komus lidera frakcji jestem w?ascicielem serwa i nie wiem jak ktos umie to ok na MysQl jak co zrobie co bede musia? tylko prosze wszystko szczeg??owo napisa? a nie np : ...........> uzupe?nij
tylko co mam uzupe?nic co wpisac itp Og?lnie jak co za pomoc daje zimne
i
Chcia? bym skrypt na pojazdy dla frakcji np przez map editora zrespie wozy PSP to ?eby p??niej doda? je do frakcji SAFD mysql nie przez skin tylko przez duty
Hej, mam problem. Wgra?em skrypt na frakcje, wszystko pi?knie dzia?a, lecz nie moglem wejsc na sluzbe wiec Doda?em nawet mnie do grupy za pomoc? ACL na serwerze i nagle boom.. nie dzia?a, a gorzej to nie mog? wej?? na s?u?by, why not?
Elo .Mam problem z wyplatami
[lua]
--[[
Autor: Malentas
Dla: .sunnyRPG
NIE MASZ PRAWA DO U?YWANIA KODU BEZ MOJEJ ZGODY!!!!!!
]]
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
function roundedRectangle(x, y, w, h, color)
exports["nm-blur"]:dxDrawBluredRectangle(x, y, w, h, tocolor(255,255,255), false)
exports["nm-blur"]:dxDrawBluredRectangle(x + 2, y - 1, w - 4, 1, tocolor(255,255,255), false)
exports["nm-blur"]:dxDrawBluredRectangle(x + 2, y + h, w - 4, 1, tocolor(255,255,255), false)
exports["nm-blur"]:dxDrawBluredRectangle(x - 1, y + 2, 1, h - 4, tocolor(255,255,255), false)
exports["nm-blur"]:dxDrawBluredRectangle(x + w, y + 2, 1, h - 4, tocolor(255,255,255), false)
dxDrawRectangle(x, y, w, h, color, false)
dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end
function shadowText(text, x, y, w, h, color, size, font, xx, yy)
dxDrawText(text, x+1, y+1, w+1, h+1, tocolor(0,0,0), ...
[lua]
function findPlayer(plr, cel)
local target = nil
if (tonumber(cel) ~= nil) then
target = getElementByID("p"..cel)
else
for _,thePlayer in ipairs(getElementsByType("player")) do
if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), cel:lower(), 1, true) then
if (target) then
outputChatBox("Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter.", plr)
return nil
end
target=thePlayer
end
end
end
return target
end
kaj = {}
function zalozkaj(plr, cmd, target)
local gracz = findPlayer(plr, target)
if getElementData(plr, "kajdanki") == false then
local gracz = getPlayerName(gracz)
local gracz = getPlayerFromName(gracz)
local x2,y2,z2 = getElementPosition(gracz)
local x,y,z = getElementPosition(plr)
if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<20) then
toggleControl(gracz, "enter_exit", false)
toggleControl(gracz, "enter_passenger", false)
attachElements(gracz, plr, 0,0.4,0)
setElementPosition(gracz, x,y,z)
local graczz = getPlayerName(gracz)
kaj[plr] = {}
kaj[plr] = {graczz}
setElementData(plr,"kajdanki", true)
setPedAnimation ( gracz, "zmeczony", "IDLE_tired", -1, true, false )
outputChatBox(""..getPlayerName(plr).." zakuwa ci? w kajdanki.",gracz, ...
Witam. Pisz? do Was z pro?b? o par? wskaz?wek przy tworzeniu w/w systemu. Chodzi mi bardziej o funkcje z wiki:mta, ktore musialbym uzyc. Do samego podpiecia sql i odczytania danych z tabeli to wiem. Na poczatku chcialbym same przypisanie goscia do danej frakcji, zapisanie tego po wyj?ciu z serwera, a po zalogowaniu czy tam dolaczeniu, odczytywanie tego. Czyli mysle ze tabela powinna miec takie wartosci jak login, nickgracza, idfrakcji, nazwafrakcji, czlonkowiefrakcji, rangifrakcji. I teraz jak mialaby wygladac funkcje ktore mialaby by to pobierac? Tak jak np byloby z kasa ze getplayermoney a pozniej setplayermoney.
[center]Witam mam taki problem i? nie mog? wzi??? skin?w NP z SAFD b??d w db3: [color=red]ERROR: rpg_frakcje-skiny/s.lua:39: attempt to compare boolean with number[/color]
Witam mam taki problem bo jak wchodz? w marker skinow dla frakcji to mi go nie daje a jestem we frakcji umia? by kto? pom?c w tym kodzie? by? bym bardzo wdzi?czny
doda?em si? do frakcji mam lidera 99 ale napotka?em kolejny problem gdy? nie mog? zak?ada? skin?w frakcji a pojazdami frakcji normalnie mog? je?dzi? tu podaje link do kodu prosz? o szybk? odpowied? wklej.org/id/3010578
Zn?w mam problem bo zapomnialem jak sie robi brame dla frakcji. Chc? mie? full automat bram?, kt?ra otwiera si? jak dany gracz jest w policji (nawet jak nie jest na skinie) wystarczy ze jest w policji i brama sie mu otwiera, a jak nie jest to nie otwiera.
Witam wszystkich. Moze mi kto? powiedzie? jak dodac si? do frakcji ogrpg? Wgralem wszystkie tabele w mysql i nie wiem jak dac sobie lidera. Prosze o pomoc wynagradzam
jak zrobi?
zamiast
if isPlayerInTeam( getLocalPlayer(), "Policja" ) then
na
if getElementData(el, 'player:duty')=='SMSA' then
dodam ze jak zmieniam to nie dzia?a.
[lua]local resourceRoot = getResourceRootElement(getThisResource())
local screenWidth, screenHeight = guiGetScreenSize ()
vehicle=nil
najwyzsza=0
dop="n/a"
rejstrator=false
moznamierzyc=true
function seter()
moznamierzyc=true
tekst="Oczekuje na pomiar..."
end
function isPlayerInTeam( thePlayer, teamName )
local pTeam = getPlayerTeam( thePlayer )
if ( pTeam ) and ( fTeam ) then
if ( pTeam == fTeam ) then
return true
end
end
end
function targetingActivated ( target )
local wep=getPedWeapon(getLocalPlayer())
if wep==32 then
if isPlayerInTeam( getLocalPlayer(), "Policja" ) then
if getPedControlState ( getLocalPlayer(), "aim_weapon" ) then
if isPedDucked ( getLocalPlayer() ) then
sx, sy, sz = getElementVelocity ( getLocalPlayer() )
if math.floor((sx^2 + sy^2 + sz^2)^(0.5) * 180)<3 then
if target then
if getElementType(target)=="vehicle" then
if vehicle~=target then najwyzsza=0 end
vehicle=...
Witam mam problem bo nie jestem za dobry w tym a chcialbym wiedziec jak dodac siebie do frakcji lub dac sobie range np.RCON, support,admin,moderator moglby ktos pomoc? tutaj napisac albo mozemy pogadac na mumble, ts3 jakby ktos chcial za pomoc daj? zimne piwko!