Wysłany: 2014-06-22, 00:55
MrFapus
Wiek: 28 Na forum: 4696 dni Posty: 11
Nick w MP: Fapek^
Od jakiego? czasu pr?buje znale?? skrypt do mutowania tylko czatu og?lnego, czyli ?eby mo?na by?o pisa? na teamsayu. Znalaz?em jaki? skrypt ale nie dzia?a dobrze, prosz? po pomoc.
To jest ten skrypt kt?ry znalaz?em
Kod: addEventHandler('onPlayerChat', root, function( message, messageType )
local echipa = getPlayerTeam (source)
if messageType == 0 and isPlayerMuted ( source ) then
outputChatBox("You are muted on Public chat. You can still use TeamChat.",source)
elseif messageType == 2 then
if ( echipa ) then
local r, g, b = getTeamColor ( echipa )
for k, p in ipairs ( getPlayersInTeam ( echipa ) ) do
outputChatBox(getPlayerName ( source )": #FFFFFF"..message, p, r, g, b, true )
end
end
end
cancelEvent( )
end )
function mutePlayer(player,command,victimName)
if victimName then
local tipu = getPlayerFromName(victimName)
if tipu then
if ( not isPlayerMuted(tipu) ) then
setPlayerMuted(tipu, true)
outputChatBox("You have been muted.",tipu)
end
else
outputChatBox("Could not find player with name: "..tostring(victimName),player)
end
else
outputChatBox("Usage: /pmute <player name>",player)
end
end
addCommandHandler("pmute",mutePlayer)
Wysłany: 2014-06-22, 01:15
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Wysłany: 2014-06-22, 19:47
MrFapus
Wiek: 28 Na forum: 4696 dni Posty: 11
Nick w MP: Fapek^
Gdy komu? daje mute to nie mo?e te? pisa? na teamsayu i chcia?bym ?eby wystarczy?o wpisa? fragment nicku aby skrypt zadzia?a? a nie ca?y.
Wysłany: 2014-06-22, 19:53
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Sko?cze gra? i zrobi? Ci to.
[ Dodano : 2014-06-22, 20:08 ]
addEventHandler ( "onPlayerChat" , root , function( message , messageType )
local echipa = getPlayerTeam ( source )
if messageType == 0 and isPlayerMuted ( source ) then
outputChatBox ( "You are muted on Public chat. You can still use TeamChat." , source )
elseif messageType == 2 then
if ( echipa ) then
local r , g , b = getTeamColor ( echipa )
for k , p in ipairs ( getPlayersInTeam ( echipa ) ) do
outputChatBox ( getPlayerName ( source ) ": #FFFFFF" .. message , p , r , g , b , true )
end
end
end
cancelEvent ( )
end )
function mutePlayer ( player , command , victimName )
if victimName then
local tipu = partName ( player , victimName )
if tipu then
if ( not isPlayerMuted ( tipu ) ) then
setPlayerMuted ( tipu , true )
outputChatBox ( "You have been muted." , tipu )
end
else
outputChatBox ( "Could not find player with name: " .. tostring ( victimName ), player )
end
else
outputChatBox ( "Usage: /pmute <player name>" , player )
end
end
addCommandHandler ( "pmute" , mutePlayer )
function partName ( plr , cel )
local target = nil
if ( tonumber ( cel ) ~= nil ) then
target = getPlayerID ( cel )
else
for _ , v in ipairs ( getElementsByType ( "player" )) do
if string . find ( string . gsub ( getPlayerName ( v ): lower (), "#%x%x%x%x%x%x" , "" ), cel : lower (), 1 , true ) then
if ( target ) then
outputChatBox ( "Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter." , plr )
return nil
end
target = v
end
end
end
return target
end .
Prosze
Wysłany: 2014-06-22, 21:17
MrFapus
Wiek: 28 Na forum: 4696 dni Posty: 11
Nick w MP: Fapek^
Dalej mutuje teamsay, i mam jeszcze jedn? pro?b? m?g?by? doda? jeszcze ?eby ka?dy widzia? ?e kogo? zmutowa?em na czacie og?lnym.
Wysłany: 2014-06-22, 21:20
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Kurczee czekaj Nie ten post, go?ciu chcia? kawa?ki nick?w.
[ Dodano : 2014-06-22, 21:23 ]
Nie no to Ty chcia?e?
Wysłany: 2014-06-22, 21:24
MrFapus
Wiek: 28 Na forum: 4696 dni Posty: 11
Nick w MP: Fapek^
Ja to chcia?em ale jeszcze "Gdy komu? daje mute to nie mo?e te? pisa? na teamsayu" a w?asnie o to mi chodzi ?eby m?g? tan pisa?.
Wysłany: 2014-06-22, 21:27
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
addEventHandler ( "PlayerChat" , root , function( message , messageType )
local echipa = getPlayerTeam ( source )
if messageType == 0 and isPlayerMuted ( source ) then
outputChatBox ( "You are muted on Public chat. You can still use TeamChat." , source ) cancelEvent () return end
if messageType == 2 then
if ( echipa ) then
local r , g , b = getTeamColor ( echipa )
for k , p in ipairs ( getPlayersInTeam ( echipa ) ) do
outputChatBox ( getPlayerName ( source ) ": #FFFFFF" .. message , p , r , g , b , true )
end
end
end
end )
Spr?buj.
Wysłany: 2014-06-22, 21:30
MrFapus
Wiek: 28 Na forum: 4696 dni Posty: 11
Nick w MP: Fapek^
Wysłany: 2014-06-22, 21:32
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Tagi: mute
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: