Wysłany: 2019-04-30, 07:27
adisonboss
Wiek: 23 Na forum: 3332 dni Posty: 237
Piwa : 6
Witam mam problem ze skryptem. Ot?? napisa?em skrypt na czat mi?dzy frakcjami pod ACL, ale niestety co? nie dzia?a mimo ?e w DB3 nic nie pokazuje za pomoc oraz
& #65279;addCommandHandler("Radio",
function( plr , cmd , ...)
local msg = table . concat ({...}, " " )
if not msg then return end
for _ , v in ipairs ( getElementsByType ( "player" )) do
local accName = getAccountName ( getPlayerAccount ( v ))
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Policja" ) ) then
outputChatBox ( "#0033FF[Policja] #E0E0E0" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) then
outputChatBox ( "#FF0000[Pa?stwowa Stra? Po?arna] #FF0000" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "OSP" ) ) then
outputChatBox ( "#800000[Ochotnicza Stra? Po?arna] #800000" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PR" ) ) then
outputChatBox ( "#FFFFFF[Pa?stwowe Ratownictwo Medyczne] #FFFFFF" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PD" ) ) then return
outputChatBox ( "#FFFF00[Pomoc Drogowa] #FFFF00" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
end
end
end
end
end
end
end )
addEventHandler ( "onPlayerJoin" , root ,
function()
bindKey ( source , "o" , "down" , "chatbox" , "Radio" )
end )
Wysłany: 2019-04-30, 08:55
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3208 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
adisonboss , Powinno dzia?a?.
function factionchat ( plr , cmd , ...)
local msg = table . concat ( { ... }, " " )
if not msg then return end
local players = getElementsByType ( 'player' )
for i , v in pairs ( players ) do
local accName = getAccountName ( getPlayerAccount ( v ))
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Policja" ) ) then
outputChatBox ( "#0033FF[Policja] #E0E0E0" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) then
outputChatBox ( "#FF0000[Pa?stwowa Stra? Po?arna] #FF0000" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "OSP" ) ) then
outputChatBox ( "#800000[Ochotnicza Stra? Po?arna] #800000" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PR" ) ) then
outputChatBox ( "#FFFFFF[Pa?stwowe Ratownictwo Medyczne] #FFFFFF" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
elseif isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PD" ) ) then
outputChatBox ( "#FFFF00[Pomoc Drogowa] #FFFF00" .. getPlayerName ( plr ).. ": " .. msg , v , 255 , 255 , 255 , true )
end
end
end
addCommandHandler ( "Radio" , factionchat )
addEventHandler ( "onResourceStart" , root , function()
local players = getElementsByType ( 'player' )
for _ , p in pairs ( players ) do
bindKey ( p , "o" , "down" , "chatbox" , "Radio" )
end
end )
addEventHandler ( "onPlayerSpawn" , getRootElement (), function ( _ )
bindKey ( source , "o" , "down" , "chatbox" , "Radio" )
end )
Więcej szczegółów
Wystawiono 1 piw(a):adisonboss
Wysłany: 2019-04-30, 15:33
adisonboss
Wiek: 23 Na forum: 3332 dni Posty: 237
Piwa : 6
Tagi: czat :: frakcji
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: