Cze??. Dzisiaj napisa?em skrypt na do??czanie do teamu oraz na to aby bo wej?ciu zapisywa?o gracza w elementdacie i po wej?ciu na serwer automatycznie go dodawa?o do teamu je?eli wog?le wcze?niej wszed? w colshape.
function hitpoli (element, matchingDimension)
if getElementType ( element ) == "player" then
setPlayerTeam ( element, policja)
setPlayerSkin (element,284)
triggerClientEvent("welpol",element)
local nick = getPlayerName ( element )
setElementData ( element, "pol.dol", nick )
end
end
addEventHandler("onColShapeHit",policjacol,hitpoli)
function hitpoli (thePlayer, matchingDimension)
if getElementType ( thePlayer ) == "player" then
setPlayerTeam ( thePlayer, policja)
setElementModel (thePlayer,284)
triggerClientEvent("welpol",thePlayer)
local gracz = getPlayerAccount ( source )
if (gracz) then
local nick = getPlayerName (source)
setAccountData ( gracz, "pol.dol", nick )
end
end
end
addEventHandler("onColShapeHit",policjacol,hitpoli)
I
function polidol (thePlayer)
local gracz = getPlayerAccount(source)
if (gracz) then
local datapoli = getAccountData (gracz,"pol.dol")
if (datapoli) then
setPlayerTeam(gracz,policja)
outputChatBox("dziala",255,0,0,true)
end
end
end
addEventHandler("onPlayerJoin",getRootElement(),polidol)
Przy okazji. Mam b??d z outputChatBox
outputChatBox ("Do??czy?e? do pogotowia ratunkowego. Sw?j pojazd s?u?bowy mo?esz stworzy? pod F1.",localplayer,0,0,0,true)
function ex()
local team = getPlayerTeam ( source )
local konto = getPlayerAccount ( source )
if (konto) then
if (team) then
setAccountData(konto, "team", team)
end
end
end
addEventHandler("onPlayerQuit", getRootElement(), ex)
function joi()
local konto = getPlayerAccount( source )
if (konto) then
team = getAccountData(konto, "team")
if (team) then
setPlayerTeam(source, team)
end
end
end
addEventHandler("onPlayerLogin", getRootElement(),joi)
Ten powinien dzia?a? na takiej zasadzie. Jest kto? np w Policji i wyjdzie to zapisze mu do konta info, ?e jest w tej frakcji je?li nie to nie zapisze. A kiedy zaloguje si? wtedy go doda do teamu znowu. Jakby jaki? by? problem wklej loga z db3.
Kradus, wiem w czym chyba by? m?j b??d. Nie u?y?em onPlayerLogin a to chyba by?o zr?d?em rozwi?zania , nie u?y?em bo na serwer kt?ry to pisze gracze w wi?kszo?ci nie u?ywaj? komendy register
[ Dodano: 2016-04-17, 18:42 ]
No nic dalej nie dzia?a , chyba nie ma rady na to. Poczekam jeszcze do wtorku mo?e b?g ze?le mi kogo? z nieba
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