BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
S - SIDE
function banPlayerCommand ( theClient , cmd , nick , reason , time , ... )
local accName = getAccountName ( getPlayerAccount ( theClient ))
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "RCON" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Moderator" )) then
if cmd and nick and reason and time then
local who = getPlayerFromName ( nick )
if who then
local gracz = getPlayerName ( theClient )
local reason = table . concat ({...}, "" )
-- banPlayer ( who , theClient , reason , time )
triggerClientEvent ( getRootElement (), "ban" , root , "nick" , "reason" , "gracz" )
else
outputChatBox ( "Nie ma takiego gracza na serwerze!" , theClient )
end
else
outputChatBox ( "U?yj: /zbanuj <nick> <pow?d> <czas>" , theClient )
end
else
outputChatBox ( "Nie masz uprawnie? !" , theClient )
end
end
addCommandHandler ( "zbanuj" , banPlayerCommand )
C - SIDE
addEvent ( "ban" , true )
addEventHandler ( "ban" , root ,
function ()
addEventHandler ( "onClientRender" , root , pban )
end
)
local screenW , screenH = guiGetScreenSize ()
function pban ( nick , gracz , reason )
dxDrawRectangle ( screenW * 0.3281 , screenH * 0.1046 , screenW * 0.2990 , screenH * 0.0731 , tocolor ( 229 , 0 , 0 , 83 ), false )
dxDrawText ( "Gracz: " .. nick .. " zosta? zbanowany przez: " .. gracz .. ".\nPow?d: " .. reason .. "." , screenW * 0.3312 , screenH * 0.1102 , screenW * 0.6219 , screenH * 0.1685 , tocolor ( 254 , 254 , 254 , 254 ), 1.00 , "default-bold" , "center" , "center" , false , false , false , false , false )
end
function sban ()
removeEventHandler ( "onClientRender" , root , pban )
end
setTimer ( sban , 6000 , 1 )
Problem polega na tym ?e nie triggeruje argument?w