Wysłany: 2016-12-19, 20:04
OskarYT
Mapper MTA
Wiek: 26 Na forum: 4245 dni Posty: 267
Nick w MP: Kaczorek2306
Piwa : 1230
function globalMessage ( thePlayer , cmd , ...)
local message = table . concat ( { ... }, " " )
local name = getPlayerName ( thePlayer )
outputChatBox ( "#FFFFFF" .. name .. ": #aaaaaa" .. message , getRootElement (), 255 , 255 , 255 , true )
end
addCommandHandler ( "genel" , globalMessage )
function Tags ( mensaje , tipo )
local cuenta = getAccountName ( getPlayerAccount ( source ))
local nombre = getPlayerName ( source )
if isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "Admin" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[Admin] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[Admin] " .. nombre .. ": " .. mensaje )
elseif isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "SuperModerator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[SuperModerator] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[SuperModerator] " .. nombre .. ": " .. mensaje )
elseif isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "Moderator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[Moderator] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[Moderator] " .. nombre .. ": " .. mensaje )
end
end
addEventHandler ( "onPlayerChat" , getRootElement (), Tags )
Tutaj jest skrypt na chat globalny, ale nie dzia?a jestem ?wiadom ?e ten skrypt nie dzia?a ale nie mam poj?cia jak go naprawi? aby na globalu by?y tagi przed nickami prosz? o przerobienie tego skryptu jak to mo?liwe. Z g?ry dzi?kuje, za dobr? i szybko pomoc daje respekt i zimne piwko !
Wysłany: 2016-12-19, 20:18
Dexnes_
Tiger
Wiek: 26 Na forum: 4401 dni Posty: 620
Nick w MP: Dexnes
Piwa : 1394
Do przerobienia skrypt?w jest odpowiedni dzia? , zg?o? si? tam je?eli oczekujesz gotowy kod.
< KLIK >
Wysłany: 2016-12-19, 20:18
OskarYT
Mapper MTA
Wiek: 26 Na forum: 4245 dni Posty: 267
Nick w MP: Kaczorek2306
Piwa : 1230
BlackGamePL , Oczekuje na gotowy b?dz jak?? pomoc ..
Wysłany: 2016-12-19, 21:18
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
function Tags ( mensaje , tipo )
local cuenta = getAccountName ( getPlayerAccount ( source ))
local nombre = getPlayerName ( source )
local mensaje = table . concat ( { ... }, " " )
if isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "Admin" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[Admin] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[Admin] " .. nombre .. ": " .. mensaje )
elseif isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "SuperModerator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[SuperModerator] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[SuperModerator] " .. nombre .. ": " .. mensaje )
elseif isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "Moderator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[Moderator] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[Moderator] " .. nombre .. ": " .. mensaje )
end
end
addEventHandler ( "onPlayerChat" , getRootElement (), Tags )
Wysłany: 2016-12-19, 21:23
OskarYT
Mapper MTA
Wiek: 26 Na forum: 4245 dni Posty: 267
Nick w MP: Kaczorek2306
Piwa : 1230
marcin778 ,
Wyskakuje b??d :
Kod: server.lua:4: cannot use '...' outside a vararg function near '...'
Wysłany: 2016-12-19, 21:29
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
function Tags ( mensaje , tipo , ...)
local cuenta = getAccountName ( getPlayerAccount ( source ))
local nombre = getPlayerName ( source )
local mensaje = table . concat ( { ... }, " " )
if isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "Admin" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[Admin] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[Admin] " .. nombre .. ": " .. mensaje )
elseif isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "SuperModerator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[SuperModerator] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[SuperModerator] " .. nombre .. ": " .. mensaje )
elseif isObjectInACLGroup ( "user." .. cuenta , aclGetGroup ( "Moderator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#FF0000[Moderator] " .. nombre .. ": #00FF00" .. mensaje , getRootElement (), r , g , b , true )
outputServerLog ( "[Moderator] " .. nombre .. ": " .. mensaje )
end
end
addEventHandler ( "onPlayerChat" , getRootElement (), Tags )
Wysłany: 2016-12-19, 21:35
OskarYT
Mapper MTA
Wiek: 26 Na forum: 4245 dni Posty: 267
Nick w MP: Kaczorek2306
Piwa : 1230
marcin778 , Na tym kodzie co poda?e? powy?ej to ju? nie wyskakuje ERROR ale i tak czat globalny nie dzia?a .
To jest po stronie clienta
bindKey ( "x" , "down" , "chatbox" , "Global" )
a tu masz po stronie servera
function Tags ( wiadomosc , typ , ...)
local konto = getAccountName ( getPlayerAccount ( source ))
local nazwa = getPlayerName ( source )
local wiadomosc = table . concat ( { ... }, " " )
if isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Admin" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#757575[#FF0000Admin#757575] " .. nazwa .. ": #757575" .. wiadomosc , getRootElement (), r , g , b , true )
outputServerLog ( "[Admin] " .. nazwa .. ": " .. wiadomosc )
elseif isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "SuperModerator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#757575[#BB552ESuperModerator#757575] " .. nazwa .. ": #757575" .. wiadomosc , getRootElement (), r , g , b , true )
outputServerLog ( "[SuperModerator] " .. nazwa .. ": " .. wiadomosc )
elseif isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Moderator" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#757575[#2A9E2FModerator#757575] " .. nazwa .. ": #757575" .. wiadomosc , getRootElement (), r , g , b , true )
outputServerLog ( "[Moderator] " .. nazwa .. ": " .. wiadomosc )
elseif isObjectInACLGroup ( "user." .. konto , aclGetGroup ( "Everyone" )) then
cancelEvent ()
local r , g , b = getPlayerNametagColor ( source )
outputChatBox ( "#757575[#092FD4Gracz#757575] " .. nazwa .. ": #757575" .. wiadomosc , getRootElement (), r , g , b , true )
outputServerLog ( "[Gracz] " .. nazwa .. ": " .. wiadomosc )
end
end
addEventHandler ( "onPlayerChat" , getRootElement (), Tags )
NIC NIE WYSKAKUJE W DEBUGSCRIPT 3 ALE SKRYPT NIE DZIA?A
Wysłany: 2016-12-20, 15:51
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Nie potrzebnie podpinasz to pod event.
Wysłany: 2016-12-20, 16:29
OskarYT
Mapper MTA
Wiek: 26 Na forum: 4245 dni Posty: 267
Nick w MP: Kaczorek2306
Piwa : 1230
marcin778 , To nie mam poj?cia jak to naprawi? ...
Wysłany: 2016-12-20, 19:35
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Podpi?? to najlepiej pod commandhandler a nast?pnie zbindowa? commandHandler, nie bind klawisz tylko poprzez funkcje bindKey i komende w stringu
Wysłany: 2016-12-20, 19:43
OskarYT
Mapper MTA
Wiek: 26 Na forum: 4245 dni Posty: 267
Nick w MP: Kaczorek2306
Piwa : 1230
marcin778 , Dobra dzi?ki pozdrawiam prosz? o zamkni?cie.
Tagi: chat :: globalny
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: