Zablokowanie komend

headkevin

Active User
Zarejestrowany
Dołączył
Lipiec 10, 2009
Posty
111
Liczba reakcji
0
Wiek
30
Witam czy idzie jakiemus gmowi zablokowac komende? :)
 
Odp: Zablokowanie komend

Tak da rade to zrobic...
talkactions/talkactions.xml

mamy przykladowo :

Kod:
<talkaction log="yes" words="/ghost" access="[color=blue]3[/color]" event="function" value="ghost"/>

3 - gdy zwiekszysz o 1 (czyli 4 ) to tylko CM i God moze uzywac a gdy o 2 (czyli 5) to tylko GOd albo niewiem ile tam u ciebie ma god moze miec 6
 
Odp: Zablokowanie komend

chodzi mi jednemu godowi zablokowac to np ja jestem god i ten 2 i chce temu 2.
 
Odp: Zablokowanie komend

Na pocz?tku skrypta napisz tak:
Kod:
if(getCreatureName(cid) == "tutaj_imie_gracza") then
	return true
end
 
Odp: Zablokowanie komend

Eeee panowie, ale gdzie tera co dodac po co mi ten skrypt up ?.. ; o?
 
Odp: Zablokowanie komend

Dodaj to w drugiej linijce ka?dego skryptu, kt?ry chcesz mu zablokowa? (czyli po onSay).
 
Odp: Zablokowanie komend

W talkactions.xml pod komenda od goda?
 
Odp: Zablokowanie komend

niee...w talkactions.xml masz komende /ghost i na koncu pisze np. ghost.lua wchodzisz tam
i po on say dodajesz to co dal Tairens


@down

dzieki ze mu to lepiej ogarnales poniewaz ja sie spieszyelm..
 
Ostatnia edycja:
Odp: Zablokowanie komend

Kod:
<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
	<!-- Gods -->
	<talkaction log="yes" words="/addskill" access="5" event="function" value="addSkill"/>
	<talkaction log="yes" words="/attr" access="5" event="function" value="thingProporties"/>
	<talkaction log="yes" words="/serverdiag" access="5" event="function" value="diagnostics"/>
	<talkaction log="yes" words="/closeserver" access="5" event="script" value="closeopen.lua"/>
	<talkaction log="yes" words="/openserver" access="5" event="script" value="closeopen.lua"/>
	<talkaction log="yes" words="/promote;/demote" access="5" event="script" value="promote.lua"/>
	<talkaction log="yes" words="/shutdown" access="5" event="script" value="shutdown.lua"/>
	<talkaction log="yes" access="5" words="/mode" event="script" value="mode.lua"/>

	<!-- Community Managers -->
	<talkaction log="yes" words="/s" access="4" event="script" value="summon.lua"/>
	<talkaction log="yes" words="/n" access="4" event="script" value="creature.lua"/>
	<talkaction log="yes" words="/m" access="4" event="script" value="creature.lua"/>
	<talkaction log="yes" words="/reload" access="4" event="script" value="reload.lua"/>
	<talkaction log="yes" words="/raid" access="4" event="script" value="raid.lua"/>
	<talkaction log="yes" words="/newtype" access="4" event="script" value="newtype.lua"/>
	<talkaction log="yes" words="/r" access="4" event="script" value="remove.lua"/>
	<talkaction log="yes" words="/owner" access="4" event="script" value="owner.lua"/>
	<talkaction log="yes" words="/storage" access="4" event="script" value="storage.lua"/>
	<talkaction log="yes" words="/config" access="4" event="script" value="configinfo.lua"/>
	<talkaction log="yes" words="/i" access="4" event="script" value="createitem.lua"/>
	<talkaction access="4" words="/z" event="script" value="magiceffect.lua"/>
	<talkaction access="4" words="/x" event="script" value="animationeffect.lua"/>
	<talkaction access="4" words="/y" event="script" value="animatedtext.lua"/>
	<talkaction log="yes" words="/bc" access="4" event="script" value="broadcastclass.lua"/>
	<talkaction log="yes" access="4" words="/mkick" event="script" value="masskick.lua"/>

	<!-- Gamemasters -->
	<talkaction log="yes" words="/ghost" access="3" event="function" value="ghost"/>
	<talkaction log="yes" words="/squelch" access="3" event="script" value="gamemaster.lua"/>
	<talkaction log="yes" words="/cliport" access="3" event="script" value="gamemaster.lua"/>
	<talkaction log="yes" words="/t" access="3" event="script" value="teleportmaster.lua"/>
	<talkaction log="yes" words="/c" access="3" event="script" value="teleporthere.lua"/>
	<talkaction log="yes" words="/goto" access="3" event="script" value="teleportto.lua"/>
	<talkaction log="yes" words="/a" access="3" event="script" value="teleporttiles.lua"/>
	<talkaction log="yes" words="/kick" access="3" event="script" value="kick.lua"/>
	<talkaction log="yes" words="/send" access="3" event="script" value="teleportsend.lua"/>
	<talkaction log="yes" words="/unban" access="3" event="script" value="unban.lua"/>
	<talkaction log="yes" words="/town" access="3" event="script" value="teleporttown.lua"/>
	<talkaction log="yes" words="/up" access="3" event="script" value="teleportfloor.lua"/>
	<talkaction log="yes" words="/down" access="3" event="script" value="teleportfloor.lua"/>
	<talkaction log="yes" words="/save" access="3" event="script" value="save.lua"/>
	<talkaction log="yes" words="/clean" access="3" event="script" value="clean.lua"/>
	<talkaction log="yes" words="/reports" access="3" event="script" value="reports.lua"/>
	<talkaction log="yes" words="/mc" access="3" event="script" value="multicheck.lua"/>
	<talkaction log="yes" access="3" words="/wp" event="script" value="waypoints.lua"/>

	<!-- Senior Tutors -->
	<talkaction log="yes" words="/notations" access="2" event="script" value="notations.lua"/>
	<talkaction log="yes" words="/info" access="2" event="script" value="playerinfo.lua"/>
	<talkaction log="yes" words="/gethouse" access="2" event="script" value="gethouse.lua"/>
	<talkaction log="yes" access="2" words="/b" event="script" value="broadcast.lua"/>

	<!-- Tutors -->
	<talkaction log="yes" words="/baninfo" access="1" event="function" value="banishmentInfo"/>
	<talkaction log="yes" access="1" words="/pos" event="script" value="position.lua"/>

	<!-- Players -->
	<talkaction words="!frags" event="script" value="frags.lua"/>
	<talkaction words="!online" event="script" value="online.lua"/>
	<talkaction words="!uptime" event="script" value="uptime.lua"/>
	<talkaction words="!deathlist" event="script" value="deathlist.lua"/>
	<talkaction words="!pvp" event="script" value="pvp.lua"/>
	<talkaction words="!q" event="script" value="money.lua"/>
	<talkaction words="!serverinfo" event="script" value="serverinfo.lua"/>
	<talkaction words="/commands" event="script" value="commands.lua"/>

	<!-- Houses -->
	<talkaction words="alana res" filter="word-spaced" event="function" value="houseBuy"/>
	<talkaction words="alana grav" filter="word-spaced" event="function" value="houseSell"/>
	<talkaction words="alana sio" filter="word-spaced" event="function" value="houseKick"/>
	<talkaction words="aleta grav" filter="word-spaced" event="function" value="houseDoorList"/>
	<talkaction words="aleta sio" filter="word-spaced" event="function" value="houseGuestList"/>
	<talkaction words="aleta som" filter="word-spaced" event="function" value="houseSubOwnerList"/>
	<talkaction words="alana som" filter="word-spaced" event="script" value="leavehouse.lua"/>

	<!-- Guilds -->
	<talkaction words="!createguild" event="function" value="guildCreate"/>
	<talkaction words="!joinguild" event="function" value="guildJoin"/>

	<!-- (Deprecated) Redirect old '/' to '!' -->
	<talkaction words="/online" hide="yes" event="script" value="online.lua"/>
	<talkaction words="/uptime" hide="yes" event="script" value="uptime.lua"/>
	<talkaction words="/deathlist" hide="yes" event="script" value="deathlist.lua"/>
	<talkaction words="/pvp" hide="yes" event="script" value="pvp.lua"/>
	<talkaction words="/serverinfo" hide="yes" event="script" value="serverinfo.lua"/>
	<talkaction log="yes" access="1" hide="yes" words="!pos" event="script" value="position.lua"/>
</talkactions>
Jak masz taki plik, wybierasz komend? kt?ra chcesz(a raczej linie z ni?) np.
Kod:
<talkaction log="yes" words="/shutdown" access="5" event="script" value="shutdown.lua"/>
Wchodzimy w scripts/shutdown.lua i mamy co? takiego:
Kod:
local shutdownEvent = 0

function onSay(cid, words, param, channel)
	if(param == '') then
		doSetGameState(GAMESTATE_SHUTDOWN)
		return true
	end

	if(param:lower() == "stop") then
		stopEvent(shutdownEvent)
		shutdownEvent = 0
		return true
	elseif(param:lower() == "kill") then
		os.exit()
		return true
	end

	param = tonumber(param)
	if(not param or param < 0) then
		doPlayerSendCancel(cid, "Numeric param may not be lower than 0.")
		return true
	end

	if(shutdownEvent ~= 0) then
		stopEvent(shutdownEvent)
	end

	return prepareShutdown(math.abs(math.ceil(param)))
end

function prepareShutdown(minutes)
	if(minutes <= 0) then
		doSetGameState(GAMESTATE_SHUTDOWN)
		return false
	end

	if(minutes == 1) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minute, please log out now!")
	elseif(minutes <= 3) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes, please log out.")
	else
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes.")
	end

	shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
	return true
end
I jak powiedzia? kolega, dodajemy po onSay'u:
Kod:
if(getCreatureName(cid) == "tutaj_imie_gracza") then
	return true
end
Czyli wychodzi:
Kod:
local shutdownEvent = 0

function onSay(cid, words, param, channel)
if(getCreatureName(cid) == "tutaj_imie_gracza") then
	return true
end	
if(param == '') then
		doSetGameState(GAMESTATE_SHUTDOWN)
		return true
	end

	if(param:lower() == "stop") then
		stopEvent(shutdownEvent)
		shutdownEvent = 0
		return true
	elseif(param:lower() == "kill") then
		os.exit()
		return true
	end

	param = tonumber(param)
	if(not param or param < 0) then
		doPlayerSendCancel(cid, "Numeric param may not be lower than 0.")
		return true
	end

	if(shutdownEvent ~= 0) then
		stopEvent(shutdownEvent)
	end

	return prepareShutdown(math.abs(math.ceil(param)))
end

function prepareShutdown(minutes)
	if(minutes <= 0) then
		doSetGameState(GAMESTATE_SHUTDOWN)
		return false
	end

	if(minutes == 1) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minute, please log out now!")
	elseif(minutes <= 3) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes, please log out.")
	else
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes.")
	end

	shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
	return true
end
Nick gracza proponowa?bym da? do zmiennej.
 
Odp: Zablokowanie komend

<talkaction log="yes" words="/attr" access="5" event="function" value="thingProporties"/>
A gdzie znajde taki plik ? thingproporties bo to nie lua. i niema go w scriptach
 
Odp: Zablokowanie komend

W tym niestety nie mo?esz zmieni?. Jest to skrypt korzystaj?cy z wbudowanej funkcji. Musia?by? zmienia? w C++ lub zrobi? skrypt na to.
 
Odp: Zablokowanie komend

Mo?esz w c++, talkactions.cpp - jednak to trudniejsze, musisz potem skompilowa? otsa... Ale jakby? chcia?...
Znajd?:
Kod:
bool TalkAction::thingProporties(Creature* creature, const std::string& cmd, const std::string& param)
{
    Player* player = creature->getPlayer();
	if(!player)
		return false;
Zamie? to na
Kod:
bool TalkAction::thingProporties(Creature* creature, const std::string& cmd, const std::string& param)
{
    Player* player = creature->getPlayer();
    if(player->getName() == "nick")
    {
        player->sendTextMessage(MSG_STATUS_SMALL, "You cannot use this comand!");
        return true;
    }
	if(!player)
		return false;
 
Back
Do góry