What's new

Komenda Ban

Status
Not open for further replies.

blazion

Advanced User
Joined
Feb 5, 2009
Messages
242
Reaction score
13
Witam !
Chcialbym Sie Dowiedziec jak moge dodac komende /ban mam tylko u siebie /b ale to jest na ip wiekszosc ma zmienne ip a chce dodac cos takiego jak np /ban i czas na ile czasu Dzieki za pomoc oczywiscie repucik poleci za pomoc dzieki
P.S Probowalem juz w command.xml dodac /ban ale blad wyskakuje
 

yzzy92

Advanced User
Joined
May 14, 2009
Messages
308
Reaction score
32
Odp: Komenda Ban

Ale raczej bana mo?esz wrzuci? na posta? bo na ip jak kto? ma zmienne nic nie da.
 

blazion

Advanced User
Joined
Feb 5, 2009
Messages
242
Reaction score
13
Odp: Komenda Ban

Ale raczej bana mo?esz wrzuci? na posta? bo na ip jak kto? ma zmienne nic nie da.
no ale o to chodzi ze niemam tej komendy mam tylko /b a to jest na ip a pozniej mam w silniku na postac ale to bez sensu jest ciagle wlazic na dedyka i za pomoca silnika banowac wiec chce dodac komende /ban i zeby byla na postac
 

Ovner

Senior User
Joined
Jun 21, 2009
Messages
528
Reaction score
54
Age
31
Odp: Komenda Ban

Tu prosz? specjalnie dla Ciebie ; P

Tworzymy plik "bans.lua" i wklejamy do ?rodka to \/
Nast?pnie plik wrzucamy do talkactions\scripts
Code:
-- Ban talkaction by Gesior
local default_comment = ""
local default_lenght = 1 -- ban time in hours

function onSay(cid, words, param)
	local parametres = string.explode(param, ",")
	if(parametres[1] ~= nil) then
		local accId = getAccountIdByName(parametres[1])
		if(accId > 0) then
			local lenght = default_lenght
			local comment = default_comment
			if(parametres[2] ~= nil and tonumber(parametres[2]) > 0) then
				lenght = tonumber(parametres[2])
			end
			if(parametres[3] ~= nil) then
				comment = parametres[3]
			end
			doAddBanishment(accId, lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)
			local player = getPlayerByNameWildcard(parametres[1])
			if(isPlayer(player) == TRUE) then
				doRemoveCreature(player)
			end
		else
			doPlayerSendCancel(cid, "Player with name " .. parametres[1] .. " doesn't exist.")
		end
	else
		doPlayerSendCancel(cid, "You must enter name.")
	end
	return true
end

do talkactions dodajemy linijk? :
Code:
	<talkaction log="yes" access="3" words="/ban" script="bans.lua"/>

Oczywi?cie mo?na zmienia? :>.

Komenda - /ban nick,ilosc_godzin,pow?d
 

blazion

Advanced User
Joined
Feb 5, 2009
Messages
242
Reaction score
13
Odp: Komenda Ban

niestety nie dziala moze pod inna wersje tfs jest ja mam 2.0.0 w silniku wyskakuje jakis blad on line 4
 

yzzy92

Advanced User
Joined
May 14, 2009
Messages
308
Reaction score
32
Odp: Komenda Ban

Siema w?a?nie co? znalaz?em mo?e si? przyda :

 
Status
Not open for further replies.
Top