Wysłany: 2016-03-01, 18:05
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Witam, tym razem z czatem frakcyjnym kt?ry pr?buj? zrobi?.
function message ( thePlayer , cmd ,...)
if not getPlayerAccount ( thePlayer ) then return end
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if not accName then return end
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" ) ) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" ) ) then
for k , v in ipairs ( getElementsByType ( "player" )) do
if getPlayerAccount ( v ) then
accName = getAccountName ( getPlayerAccount ( v ))
if accName then
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "PSP" ) ) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAPD" ) ) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "SAMC" ) ) then
outputChatBox ( "#ff0000" .. getPlayerName ( thePlayer ).. "#ffffff**#1D9DE6Frakcyjny:#ffffff**#49AC4C " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
end
addCommandHandler ( "u" , message )
addEventHandler ( "onPlayerJoin" , getRootElement (),
function ()
bindKey ( source , "u" , "down" , "chatbox" , "Frakcyjny" )
end )
addEventHandler ( "onResourceStart" , getResourceRootElement ( getThisResource ()),
function ()
for index , player in pairs ( getElementsByType ( "player" )) do
bindKey ( player , "u" , "down" , "chatbox" , "Frakcyjny" )
end
end )
end
Mianowicie po wci?ni?ciu danego bindu w tym przypadku 'u' Nic si? nie dzieje a db3 nic nie pokazuje.
Wysłany: 2016-03-01, 18:07
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 , poniewa? jako mend? poda?e? "Frakcyjny"a komenda w twoim przypadku to jest poprostu u.
Wysłany: 2016-03-01, 18:12
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Czyl te pierwsze 'u' to Pisze na chacie ? u: jakis tekst
Wysłany: 2016-03-01, 18:20
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 , function isPlayerInACL ( player , acl )
local account = getPlayerAccount ( player )
if ( isGuestAccount ( account ) ) then
return false
end
return isObjectInACLGroup ( "user." .. getAccountName ( account ), aclGetGroup ( acl ) )
end
function frakcyjny ( plr , cmd , ... )
local plr_account = getPlayerAccount ( plr )
if not isGuestAccount ( plr_account ) then
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
for k , v in ipairs ( getElementsByType ( "player" )) do
local v_account = getPlayerAccount ( v )
if v_account then
if not isGuestAccount ( v_account ) then
if isPlayerInACL ( v_account , "PSP" ) or isPlayerInACL ( v_account , "SAPD" ) or isPlayerInACL ( v_account , "SAMC" ) then
outputChatBox ( "#ff0000" .. getPlayerName ( plr ).. "#ffffff**#1D9DE6Frakcyjny:#ffffff**#49AC4C " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
else
outputChatBox ( "Nie jeste? zalogowany. Nie mo?esz u?ywa? tej funkcji !" )
end
end
addCommandHandler ( "frakcyjny" , frakcyjny )
addEventHandler ( "onPlayerJoin" , getRootElement (),
function ()
bindKey ( source , "u" , "down" , "chatbox" , "frakcyjny" )
end )
addEventHandler ( "onResourceStart" , getResourceRootElement ( getThisResource ()),
function onStartResource ()
for index , player in pairs ( getElementsByType ( "player" )) do
bindKey ( player , "u" , "down" , "chatbox" , "frakcyjny" )
end
end )
Sprawd? m?j kod jest bardzo przejrzysty na pewno zobaczysz swoje b??dy.
Wysłany: 2016-03-01, 18:20
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Zmieni?em i bez poprawy addEventHandler ( "onPlayerJoin" , getRootElement (),
function ()
bindKey ( source , "u" , "down" , "chatbox" , "u" )
end )
addEventHandler ( "onResourceStart" , getResourceRootElement ( getThisResource ()),
function ()
for index , player in pairs ( getElementsByType ( "player" )) do
bindKey ( player , "u" , "down" , "chatbox" , "u" )
end
end )
end
Wysłany: 2016-03-01, 18:32
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 , function isPlayerInACL ( player , acl )
local account = getPlayerAccount ( player )
if ( isGuestAccount ( account ) ) then
return false
end
return isObjectInACLGroup ( "user." .. getAccountName ( account ), aclGetGroup ( acl ) )
end
function frakcyjny ( plr , cmd , ... )
local plr_account = getPlayerAccount ( plr )
if not isGuestAccount ( plr_account ) then
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
for k , v in ipairs ( getElementsByType ( "player" )) do
local v_account = getPlayerAccount ( v )
if v_account then
if not isGuestAccount ( v_account ) then
if isPlayerInACL ( v_account , "PSP" ) or isPlayerInACL ( v_account , "SAPD" ) or isPlayerInACL ( v_account , "SAMC" ) then
outputChatBox ( "#ff0000" .. getPlayerName ( plr ).. "#ffffff**#1D9DE6Frakcyjny:#ffffff**#49AC4C " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
else
outputChatBox ( "Nie jeste? zalogowany. Nie mo?esz u?ywa? tej funkcji !" )
end
end
addCommandHandler ( "frakcyjny" , frakcyjny )
addEventHandler ( "onPlayerJoin" , getRootElement (),
function ()
bindKey ( source , "u" , "down" , "chatbox" , "frakcyjny" )
end )
addEventHandler ( "onResourceStart" , getResourceRootElement ( getThisResource ()),
function()
for index , player in pairs ( getElementsByType ( "player" )) do
bindKey ( player , "u" , "down" , "chatbox" , "frakcyjny" )
end
end )
Teraz zobacz. Nic nie zmieniaj .
[ Dodano : 2016-03-01, 18:32 ]
Tutaj masz m?j poradnik http://gtao.pl/poczatki-lua-vt89971.htm
Wysłany: 2016-03-01, 18:38
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Wypr?bowa?em tw?j kod i owszem bind dzia?a ale po naci?ni?ciu go jest napisz Frakcyjny: ale nie widac tego co napisze :.
[ Dodano : 2016-03-01, 18:42 ]
Ale tym razem db wysypa?o.
[2016-03-01 18:41] frakcyjne restarted successfully
[2016-03-01 18:41] WARNING: frakcyjne/script.lua:2: Bad argument @ 'getPlayerAccount' [Expected element at argument 1]
[2016-03-01 18:41] WARNING: frakcyjne/script.lua:3: Bad argument @ 'isGuestAccount' [Expected account at argument 1, got boolean]
[2016-03-01 18:41] WARNING: frakcyjne/script.lua:6: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]
[2016-03-01 18:41] ERROR: frakcyjne/script.lua:6: attempt to concatenate a boolean value
Wysłany: 2016-03-01, 19:27
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 ,
function isPlayerInACL ( player , acl )
local account = getPlayerAccount ( player )
if ( isGuestAccount ( account ) ) then
return false
end
return isObjectInACLGroup ( "user." .. getAccountName ( account ), aclGetGroup ( acl ) )
end
function frakcyjny ( plr , cmd , ... )
local plr_account = getPlayerAccount ( plr )
if not isGuestAccount ( plr_account ) then
local allArgs = {...}
local theMessage = table . concat ( allArgs , " " )
for k , v in ipairs ( getElementsByType ( "player" )) do
local v_account = getPlayerAccount ( v )
if v_account then
if not isGuestAccount ( v_account ) then
if isPlayerInACL ( v , "PSP" ) or isPlayerInACL ( v , "SAPD" ) or isPlayerInACL ( v , "SAMC" ) then
outputChatBox ( "#ff0000" .. getPlayerName ( plr ).. "#ffffff**#1D9DE6Frakcyjny:#ffffff**#49AC4C " .. theMessage , v , 255 , 255 , 255 , true )
end
end
end
end
else
outputChatBox ( "Nie jeste? zalogowany. Nie mo?esz u?ywa? tej funkcji !" )
end
end
addCommandHandler ( "frakcyjny" , frakcyjny )
addEventHandler ( "onPlayerJoin" , getRootElement (),
function ()
bindKey ( source , "u" , "down" , "chatbox" , "frakcyjny" )
end )
addEventHandler ( "onResourceStart" , getResourceRootElement ( getThisResource ()),
function()
for index , player in pairs ( getElementsByType ( "player" )) do
bindKey ( player , "u" , "down" , "chatbox" , "frakcyjny" )
end
end )
Wysłany: 2016-03-01, 19:53
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Tagi: ponownie :: bindkeye
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: