Wysłany: 2016-07-08, 18:21
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
local function playerChat ( message , messageType )
if messageType == 0 then
cancelEvent ()
local red , green , blue = 255 , 255 , 255
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 )< 35 ) then
local int = getElementInterior ( source )
local dim = getElementDimension ( source )
local int2 = getElementInterior ( gracze )
local dim2 = getElementDimension ( gracze )
local id = getElementData ( source , "id" )
if ( int == int2 and dim == dim2 ) then
if getElementData ( source , "ekipa" ) == 4 then
outputChatBox ( "#4060E0 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 3 then
outputChatBox ( "#990000 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 2 then
outputChatBox ( "#FF0000 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 1 then
outputChatBox ( "#009900 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
else
outputChatBox ( "#777777 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
end
local desc = string . format ( "CZAT LOKALNY >> " .. getPlayerName ( source ).. " (" .. getElementData ( source , "id" ).. ") tre??: " .. message ): gsub ( "#%x%x%x%x%x%x" , "" )
triggerClientEvent ( root , "admin:addText" , root , desc )
triggerClientEvent ( root , "onDebugMessage" , resourceRoot , desc : gsub ( "#%x%x%x%x%x%x" , "" ), 1 , "CZAT" )
end
end
end
Wysy?a wiadomo?? 2 razy, gdy jestem obok innego u?ytkownika. Gdy jestem od niego daleko, to wy?wietla 1 raz. Co mo?e by? nie tak?
Wysłany: 2016-07-08, 19:58
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
Je?eli jeste? obok jednego u?ytkownika i wiadomo?? wy?wietla si? dwa razy to spr?buj podej?? do wi?kszej ilo?ci graczy i zobacz czy te? wiadomo?? wy?wietli si? te? dwa razy.
Podpis
"amited" napisał/a :
Wysłany: 2016-07-08, 20:06
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
Nie mog? tego sprawdzi? poniewa? serwer jest zamkni?ty i tylko 2 osoby maja dost?p.
i na czacie wy?wietla si? 1 wiadomo??, jezeli jestem kolo uzytkownika, ale w logach juz 2 wiadomosci.
Wysłany: 2016-07-08, 21:43
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
Kto? pomo?e? ^ wiadomo?? w stylu: nie wiem to si? wypowiem... wysy?am wiadomo?? w obr?bie gracza, i jest ona wysy?ana w logach po 2 razy, a na czacie 1. jak jestem daleko od tego gracza, to na czacie jedna wiadomo?? i w logach te? jedna.
Wysłany: 2016-07-08, 21:48
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Masz czat lokalny, tak? Poka? jak on jest zbudowany, by? mo?e zas?b pobiera outputchatbox'y od os?b z obr?bie tego czatu lokalnego i dlatego wysy?a po kilka razy.
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
[you]
! 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 .
Wysłany: 2016-07-08, 21:58
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
local function playerChat ( message , messageType )
if messageType == 0 then
cancelEvent ()
local red , green , blue = 255 , 255 , 255
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 )< 35 ) then
local int = getElementInterior ( source )
local dim = getElementDimension ( source )
local int2 = getElementInterior ( gracze )
local dim2 = getElementDimension ( gracze )
local id = getElementData ( source , "id" )
if ( int == int2 and dim == dim2 ) then
if getElementData ( source , "ekipa" ) == 4 then
outputChatBox ( "#4060E0 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 3 then
outputChatBox ( "#990000 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 2 then
outputChatBox ( "#FF0000 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 1 then
outputChatBox ( "#009900 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
else
outputChatBox ( "#777777 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
end
local desc = string . format ( "CZAT LOKALNY >> " .. getPlayerName ( source ).. " (" .. getElementData ( source , "id" ).. ") tre??: " .. message ): gsub ( "#%x%x%x%x%x%x" , "" )
triggerClientEvent ( root , "admin:addText" , root , desc )
triggerClientEvent ( root , "onDebugMessage" , resourceRoot , desc : gsub ( "#%x%x%x%x%x%x" , "" ), 1 , "CZAT" )
end
end
end
Wysłany: 2016-07-08, 22:52
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<35) then przeczytaj dok?adnie kod ...
Wysłany: 2016-07-08, 23:50
kubak14
Wiek: 24 Na forum: 5205 dni Posty: 119
Nick w MP: Heavy
Piwa : 149
Wszystko dlatego ?e jest to w p?tli... Ile osob na serwerze tyle razy ci to wysle poniewa? jest to w P?TLI
poprawiony kod: (powinno dzia?a?)
local function playerChat ( message , messageType )
if messageType == 0 then
cancelEvent ()
local red , green , blue = 255 , 255 , 255
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 )< 35 ) then
local int = getElementInterior ( source )
local dim = getElementDimension ( source )
local int2 = getElementInterior ( gracze )
local dim2 = getElementDimension ( gracze )
local id = getElementData ( source , "id" )
if ( int == int2 and dim == dim2 ) then
if getElementData ( source , "ekipa" ) == 4 then
outputChatBox ( "#4060E0 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 3 then
outputChatBox ( "#990000 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 2 then
outputChatBox ( "#FF0000 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
elseif getElementData ( source , "ekipa" ) == 1 then
outputChatBox ( "#009900 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
else
outputChatBox ( "#777777 (" .. getElementData ( source , "id" ).. ")#ffffff " .. getPlayerName ( source ).. ": #FFFFFF" .. message , gracze , red , green , blue , true )
end
end
local desc = string . format ( "CZAT LOKALNY >> " .. getPlayerName ( source ).. " (" .. getElementData ( source , "id" ).. ") tre??: " .. message ): gsub ( "#%x%x%x%x%x%x" , "" )
triggerClientEvent ( root , "admin:addText" , root , desc )
triggerClientEvent ( root , "onDebugMessage" , resourceRoot , desc : gsub ( "#%x%x%x%x%x%x" , "" ), 1 , "CZAT" )
end
end
Polecam przeczyta?: http://www.gtao.pl/wstep-...tle-vt89684.htm
Wysłany: 2016-07-10, 11:30
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
Kubak, nic to nie da?o....
[ Dodano : 2016-07-10, 16:35 ]
Kto? pomo?e?
[ Dodano : 2016-08-01, 15:47 ]
kto? pomo?e?
Tagi: wyświetla :: wiadomość :: razy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: