• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent Staff Channel

Dilio

Owner of Project Thala
Joined
Jun 8, 2008
Messages
188
Reaction score
7
Location
London, Ontario
Well, I read Grehy's request, and it gave me an idea. I'll give the code first, then explain it.

WARNING: IF YOU DON'T TRUST ME YOU NEED TO ADD A PIECE OF CODE TO EVERY TALKACTION FOR STAFF!!

Step 1 -
Go to Creaturescripts.xml
Add:
Lua:
	<event type="joinchannel" name="StaffOn" script="staff.lua"/>
	<event type="leavechannel" name="StaffOff" script="staff.lua"/>

Step 2 -
Go to scripts and open login.lua
Add:
Lua:
registerCreatureEvent(cid, "StaffOn")
registerCreatureEvent(cid, "StaffOff")

Step 3 -
Create staff.lua
Add:
Lua:
function onJoinChannel(cid, channelId, users)
	if(channelId == CHANNEL_STAFF) then
		setPlayerStorageValue(cid, 12341, 2)
		doPlayerSendTextMessage(cid, 19, "You've signed in.")
		return TRUE
	end
end  

function onLeaveChannel(cid, channelId, users)
	if(channelId == CHANNEL_STAFF) then
		setPlayerStorageValue(cid, 12341, 1)
		doPlayerSendTextMessage(cid, 19, "You've signed out.")
		return TRUE
	end
end

Step 4a -
Download the attachment: Changed.rar

Step 4b -
Copy the files in changed.rar and replace them into talkaction scripts.

Step 5 -
If you'd rather not download the attachment (trust issues), or if you have custom scripts that weren't replaced, then you must go to your talkaction scripts, find every script for GMs/CMs and right after:
Lua:
function onSay(cid, words, param)
Add:
Lua:
if getPlayerStorageValue(cid, 12341) == 2 then
and before the last end
Add:
Lua:
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, You need to sign in.")
	return TRUE
end

Now, what you did with ALL that coding, is you've made it so it requires Staff members to 'sign in' to Staff Channel in order to use any commands. That way your Staff will keep their Staff Channel open.

:)

Credits:
Me. o.o
 

Attachments

I like the idea ^^, fine script ^^ Good job

Sincerely,
Yours Pablol
 
you could just make it so the commands have to be said in the staff channel :S

in talkaction (if channel == CHANNEL_STAFF then...)
 
Back
Top