• 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!

TalkAction Player Depot Count

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,901
Reaction score
26
Location
Canada
Alright, Another script made intensely out of Boredom. This script is completely pointless and milked to have semi lots of features. Enjoy! xD

Explanation:
First off, You can allow players to check or not to check how many depot items you have in your main town Depo. You can Turn it ON or OFF for players to see or not. A normal player cannot check a GM's depot count, But a GM can check another GM's including there own depot count and the player that your checking must be online. (Oh! And different message depending on sex! lol)

Code:
<talkaction words="/checkdepot" access="0" event="script" value="checkdepot.lua"/>

<talkaction words="/depot" access="0" event="script" value="depot.lua"/>

checkdepot.lua
Lua:
function onSay(cid, words, param, channel)
local storage = 2000
local target = getPlayerByNameWildcard(param)
if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires a players name.") 
                return TRUE
        end 
      if(getPlayerGroupId(cid) >=2) then
   elseif(getPlayerGroupId(target) >=2) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot check a Staff memebers depot count.")
      return TRUE
         end
	if(not target) then
		target = getCreatureByName(param)
		if(not target) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player is not online.")
			return TRUE
		end                          
	end 
     if(getPlayerSex(target) == PLAYERSEX_FEMALE) and (getPlayerStorageValue(cid,storage) == 2) then     
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Number of Items in "..getCreatureName(target).."'s Depot in her homeTown "..getTownName(getPlayerTown(target))..": ~"..getPlayerDepotItems(target, getPlayerTown(target)).."~")
             elseif(getPlayerSex(target) == PLAYERSEX_MALE) and (getPlayerStorageValue(cid,storage) == 2) then  
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Number of Items in "..getCreatureName(target).."'s Depot in his homeTown "..getTownName(getPlayerTown(target))..": ~"..getPlayerDepotItems(target, getPlayerTown(target)).."~")
               else
                 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ""..getCreatureName(target).." does not have it enabled so you can see his depot item count.")              
                 end
                  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_SLEEP)                                                       
        return TRUE
end

depot.lua
Lua:
function onSay(cid, words, param, channel) 
local storage = 2000   
    if(param == "on") and (getPlayerStorageValue(cid,storage) <= 1) then
        setPlayerStorageValue(cid,storage,2)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are now allowing people to check your ammount of Depot Items.")
             elseif(param == "off") and (getPlayerStorageValue(cid,storage) == 2) then
           setPlayerStorageValue(cid,storage,1)  
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "People are no longer allowed to check your depot count.")
             else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You already have the command enabled.")          
         end 
            return TRUE      
          end

Code:
/checkdepot Chris

e9i3rr.jpg


Code:
/depot on

254zkaf.jpg
 
;o Great script! :D It's working on TFS 0.3.4PL2? :)
 
Last edited:
Chris, keep it up.
I wish I had thought of this.

:thumbup:
 
Code:
function onSay(cid, words, param, channel)
	local storage = 2000
	local target = getPlayerByNameWildcard(param)
	if (param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires a players name.")
		return true
	end

	if(not target) then
		target = getCreatureByName(param)
		if(not target) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player is not online.")
			return true
		end                          
        end

	if (getPlayerGroupId(target) >= 2) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot check a Staff memebers depot count.")
		return true
	end

	if (getPlayerStorageValue(target, storage) == 2) then
		local sex = getPlayerSex(target) == PLAYERSEX_FEMALE and "her" or "his"
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Number of Items in "..getCreatureName(target).."'s Depot in "..sex.." homeTown "..getTownName(getPlayerTown(target))..": ~"..getPlayerDepotItems(target, getPlayerTown(target)).."~")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_SLEEP)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getCreatureName(target).." does not have it enabled so you can see his depot item count.")    
	end
	return true
end

A little bit edited, idk if it works.
 
Do you have to Re-Write Every **cking one of my scritps chojrak? ..

Anyways, Thanks for the feedback guys.
 
Do you have to Re-Write Every **cking one of my scritps chojrak? ..

Anyways, Thanks for the feedback guys.
He didn't rewrite it, he just tabbed it and fixed some bugs.
 
Code:
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Number of Items in "..getCreatureName(target).."'s Depot in "..sex.." homeTown "..getTownName(getPlayerTown(target))..": ~"..getPlayerDepotItems(target, getPlayerTown(target)).."~")

He made it write Male or Female instead of He or She lol
 
Code:
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Number of Items in "..getCreatureName(target).."'s Depot in "..sex.." homeTown "..getTownName(getPlayerTown(target))..": ~"..getPlayerDepotItems(target, getPlayerTown(target)).."~")

He made it write Male or Female instead of He or She lol
No he didn't.
 
I totally did not read the line of code where it declares what sex is lol, my mistake
 
Is There A Script To Actually See whats In The Persons Depot Pm Me If There Is Or Contact Me On My Server poolersot.no-ip.info
Name : God Pooler
 
@up
that would own, but i guess its hard to make
currently i have no idea on how dps work. I think they get the info from the database.
 
sorry im a newbie, i need to create a checkdepot.lua and depot.lua files?? where i have to save them? and where i have to put this:

<talkaction words="/checkdepot" access="0" event="script" value="checkdepot.lua"/>

<talkaction words="/depot" access="0" event="script" value="depot.lua"/>


Regards!
 
Add the Lua files in data/talkactions/scripts and the 2 lines in data/talkactions/talkactions.xml.
 
Back
Top