Dilio
Owner of Project Thala
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:
Step 2 -
Go to scripts and open login.lua
Add:
Step 3 -
Create staff.lua
Add:
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:
Add:
and before the last end
Add:
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
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)
Lua:
if getPlayerStorageValue(cid, 12341) == 2 then
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
-
changed.rar22.1 KB · Views: 25 · VirusTotal