Wysłany: 2017-02-24, 21:47
saller123
Dopiero się ucze ;)
Wiek: 25 Na forum: 4679 dni Posty: 95
Nick w MP: Davitek
Piwa : 212
Witam, mam ma?y problem z wys?aniem wiadomosci poprzez funkcj? "outputChatBox".
Wywala mi b??d:
Cytat: ERROR: [SKRYPTY]\rpg_chat_lokalny\chat.lua:13: attempt to call a boolean value
server.lua
Kod: addEventHandler("onPlayerChat", root, function(tresc, msgtype)
if (msgtype == 0) then
cancelEvent()
local x,y,z = getElementPosition(source)
for key, gracze in ipairs(getElementsByType("player")) do
local x2,y2,z2 = getElementPosition(gracze)
if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<20) then
local int = getElementInterior(source)
local dim = getElementDimension(source)
local int2 = getElementInterior(gracze)
local dim2 = getElementDimension(gracze)
if (int == int2 and dim == dim2) then
outputChatBox("#808080" ..getElementData(source, "id") " #FFFFFF" ..getPlayerName(source) ": #808080" ..tresc, gracze, 255, 255, 255, true )
end
end
end
end
end)
Wysłany: 2017-02-24, 23:27
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
saller123 , ktos nie ma nadanej elementdaty zapewne
Wysłany: 2017-02-25, 01:26
saller123
Dopiero się ucze ;)
Wiek: 25 Na forum: 4679 dni Posty: 95
Nick w MP: Davitek
Piwa : 212
No w?a?nie problem w tym ?e ma
Np. w skrypcie "scoreboard" id si? normalnie wy?wietla?o
System id:
Kod: function updateid ()
for i,p in pairs (getElementsByType ('player') do
setElementData( p,'id', i )
end
end
addEventHandler ('onPlayerQuit',getRootElement(),updateid)
function myid()
local players = getElementsByType ('player')
local myID = #players + 1
setElementData (source,'id',myID)
end
addEventHandler ('onPlayerJoin',getRootElement(),myid)
Podpis
Jeżeli ci pomogłem, postaw piwerko
Tagi: wyświetlanie :: textu :: chacie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: