Wysłany: 2014-08-29, 17:27
xBolekk
Wiek: 24 Na forum: 4474 dni Posty: 113
Nick w MP: Bolek.
Piwa : 190
Cze??, mam taki kodzik na wiadomo?ci prywatne, wszystko super dzia?a, jednak chcia?bym, aby by?a mo?liwo?? wys?ania pw przez ID, mam skrypt na id on te? dzia?a, prosz? o pomoc.
Kod pm:
function privateMessage ( thePlayer , commandName , sendToName ,...)
local pmWords = { ... }
local pmMessage = table . concat ( pmWords , " " )
if sendToName then
if ( getPlayerFromParticalName ( sendToName )) then
toPlayer = ( getPlayerFromParticalName ( sendToName ))
if not ( toPlayer == thePlayer ) then
if not ( pmMessage == "" ) then
outputChatBox ( ">> " .. getPlayerName ( toPlayer ) .. ": " .. pmMessage , thePlayer , true )
outputChatBox ( "<< " .. getPlayerName ( thePlayer ) .. ": " .. pmMessage , toPlayer , true )
else
outputChatBox ( "* U?yj /pm <ID/nick> <tre??> ." , thePlayer , true )
return false
end
else
outputChatBox ( "* Nie mo?esz wys?a? wiadomo?ci do siebie." , thePlayer , true )
return false
end
else
outputChatBox ( "* Nie odnaleziono gracza o podanym ID/nicku." , thePlayer , true )
return false
end
else
outputChatBox ( "* U?yj /pm <ID/nick> <tre??> ." , thePlayer , true )
return false
end
end
addCommandHandler ( "pm" , privateMessage )
addCommandHandler ( "pw" , privateMessage )
function getPlayerFromParticalName ( thePlayerName )
local thePlayer = getPlayerFromName ( thePlayerName )
if thePlayer then
return thePlayer
end
for _ , thePlayer in ipairs ( getElementsByType ( "player" )) do
if string . find ( string . gsub ( getPlayerName ( thePlayer ): lower (), "#%x%x%x%x%x%x" , "" ), thePlayerName : lower (), 1 , true ) then
return thePlayer
end
end
return false
end
Ostatnio zmieniony przez xBolekk 2014-08-29, 19:05, w całości zmieniany 2 razy
Wysłany: 2014-08-29, 18:53
Blur
Wiek: 28 Na forum: 4298 dni Posty: 47
Nick w MP: Blu
Piwa : 2
To powinno ci wystarczy?, ten kodzik.
function getElementByID ( id )
if not id then return false end
for k , v in ipairs ( getElementsByType ( "player" , getResourceRootElement ( getThisResource ()))) do
if tonumber ( getElementData ( v , 'ID' )) == tonumber ( id ) then
return v
end
end
end
Podmie? tylko sobie u siebie w kodzie.
Wysłany: 2014-08-29, 19:04
xBolekk
Wiek: 24 Na forum: 4474 dni Posty: 113
Nick w MP: Bolek.
Piwa : 190
Wysłany: 2014-08-29, 20:11
maxerxxl
Wiek: 30 Na forum: 5068 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
Wysłany: 2014-08-29, 20:25
xBolekk
Wiek: 24 Na forum: 4474 dni Posty: 113
Nick w MP: Bolek.
Piwa : 190
Ok mam ten kod, ale kiedy chce do napisa? PM to wyskakuje Najpierw wejd? do gry.
Wysłany: 2014-08-29, 21:45
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
xBolekk , bo ten kod jest przystosowany pod gamemod. Wysil si? troch? i przer?b go pod Sw?j serwer..
Wysłany: 2014-08-30, 11:38
Virelox
Wiek: 28 Na forum: 4814 dni Posty: 156
Nick w MP: Virelox
Piwa : 623
Usu? ten warunek b?d? przer?b go na sw?j
Wysłany: 2014-08-30, 12:01
xBolekk
Wiek: 24 Na forum: 4474 dni Posty: 113
Nick w MP: Bolek.
Piwa : 190
Jako? tego nie rozumiem, no dobra, je?li nie mo?ecie mi pom?c, to prosz? o zamkni?cie tematu.
Wysłany: 2014-08-30, 13:16
maxerxxl
Wiek: 30 Na forum: 5068 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
w pliku pm usu? to:
if not getElementData ( plr , "character" ) then
outputChatBox ( "Najpierw wejd? do gry." , plr )
return
end
potem to:
if ( getElementData ( plr , "kary:blokada_pm" )) then
outputChatBox ( "Posiadasz na?o?on? blokad? prywatnych wiadomo?ci. Blokada wygasa: " .. getElementData ( plr , "kary:blokada_pm" ), plr , 255 , 0 , 0 )
return
end
i to:
if ( isPlayerMuted ( target )) then
outputChatBox ( getPlayerName ( target ).. " jest wyciszony - nie odpisze Ci." , plr )
end
potem to:
if ninjaban ( tresc ) then
outputChatBox ( ">> " .. getPlayerName ( target ) .. "(" .. getPlayerID ( target ) .. "): " .. tresc , plr , 245 , 219 , 0 )
exports [ "lss-admin" ]: gameView_add ( "PM NINJABAN " .. getPlayerName ( plr ).. "/" .. getPlayerID ( plr ).. " >> " .. getPlayerName ( target ).. "/" .. getPlayerID ( target ).. ": " .. tresc )
return
end
i to:
local afk = getElementData ( target , "afk" ) or 0
if afk > 1 then
outputChatBox ( "(( Gracz do kt?rego piszesz jest obecnie AFK ))" , plr , 245 , 219 , 0 )
end
Tagi: pm/pw :: przez :: jak?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: