TalkAction Player Depot Count

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
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


Code:
/depot on
 

Seq

Banned User
Joined
May 6, 2009
Messages
87
Best answers
0
Reaction score
0
Location
Poland
;o Great script! :D It's working on TFS 0.3.4PL2? :)
 
Last edited:

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Chris, keep it up.
I wish I had thought of this.

:thumbup:
 

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
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.
 
OP
Sync

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
Location
Canada
Do you have to Re-Write Every **cking one of my scritps chojrak? ..

Anyways, Thanks for the feedback guys.
 

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,894
Best answers
4
Reaction score
817
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.
 
OP
Sync

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
Location
Canada
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
 

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,894
Best answers
4
Reaction score
817
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.
 
OP
Sync

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
Location
Canada
I totally did not read the line of code where it declares what sex is lol, my mistake
 

phillygangsta

New Member
Joined
May 9, 2010
Messages
46
Best answers
0
Reaction score
0
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
 

Glecko

Advanced OT User
Joined
Aug 21, 2007
Messages
1,015
Best answers
0
Reaction score
239
Location
Spain
@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.
 

Gesquivel

New Member
Joined
Nov 3, 2014
Messages
19
Best answers
0
Reaction score
0
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!
 

Limos

Premium User
Joined
Jun 7, 2010
Messages
10,018
Best answers
7
Reaction score
2,958
Location
Netherlands
Add the Lua files in data/talkactions/scripts and the 2 lines in data/talkactions/talkactions.xml.
 
Top