What is it?
/getPlayerItem Player, itemid/itemname will check how many items with id "itemid" "Player" have. It may come useful in many ways.
/getPlayerStorage Player, storage will check value of "Player's" "storage". With it you can check is player have done quest or do player have addon and many things.
/setPlayerStorage Player, storage, value it wil set "Player's" storage "storage" to value "value". The usage is obvious. You can manage storage values of player. Great for quest tests etc.
Why i need it?
Those commands can be useful for bug tracking or preventing players scamming gamemasters with false bug reports.
How To Use?
/getPlayerStorage Azi, 3642
-Azi's storage value for 3642 is 1.
/setPlayerStorage Azi, 3642, 7
-You have successfully set Azis's storage for 3642 to value 7.
/getPlayerItem Azi, 2160
-Azi have 64 crystal coins.
/getPlayerItem Azi, Magic Plate Armor
-Azi haven't any Magic Plate Armors.
How to Install?
in data/talkactions/talkactions.xml
add that under "<talkactions>"
now in data/talkactions/scripts/ make 2 files: getitem.lua and storage.lua
To getitem.lua paste this:
and to storage.lua paste:
/getPlayerItem Player, itemid/itemname will check how many items with id "itemid" "Player" have. It may come useful in many ways.
/getPlayerStorage Player, storage will check value of "Player's" "storage". With it you can check is player have done quest or do player have addon and many things.
/setPlayerStorage Player, storage, value it wil set "Player's" storage "storage" to value "value". The usage is obvious. You can manage storage values of player. Great for quest tests etc.
Why i need it?
Those commands can be useful for bug tracking or preventing players scamming gamemasters with false bug reports.
How To Use?
/getPlayerStorage Azi, 3642
-Azi's storage value for 3642 is 1.
/setPlayerStorage Azi, 3642, 7
-You have successfully set Azis's storage for 3642 to value 7.
/getPlayerItem Azi, 2160
-Azi have 64 crystal coins.
/getPlayerItem Azi, Magic Plate Armor
-Azi haven't any Magic Plate Armors.
How to Install?
in data/talkactions/talkactions.xml
add that under "<talkactions>"
PHP:
<talkaction log="yes" words="/setPlayerStorage" access="3" event="script" value="storage.lua"/>
<talkaction log="yes" words="/getPlayerStorage" access="3" event="script" value="storage.lua"/>
<talkaction log="yes" words="/getPlayerItem" access="3" event="script" value="getitem.lua"/>
now in data/talkactions/scripts/ make 2 files: getitem.lua and storage.lua
To getitem.lua paste this:
PHP:
function onSay(cid, words, param, channel)
if(param ~= "")then
local param = string.explode(param, ',')
if(isNumber(param[2]))then
param[2] = getItemNameById(param[2])
end
local item = getItemIdByName(param[2], FALSE)
local player = getPlayerByName(param[1])
if(isPlayer(player))then
if(isNumber(item))then
local count = getPlayerItemCount(cid, item)
if(count > 1)then
doPlayerSendTextMessage(cid, 19, getPlayerName(player).." have "..count.." "..getItemPluralNameById(item)..".")
elseif(count == 1)then
doPlayerSendTextMessage(cid, 19, getPlayerName(player).." have 1 "..getItemNameById(item)..".")
else
doPlayerSendTextMessage(cid, 19, getPlayerName(player).." haven't any "..getItemPluralNameById(item)..".")
end
else
doPlayerSendCancel(cid, "Item not found.")
end
else
doPlayerSendCancel(cid, "This player is not online.")
end
else
doPlayerSendCancel(cid, "Command requires params.")
end
return TRUE
end
and to storage.lua paste:
PHP:
function onSay(cid, words, param, channel)
if(param ~= "")then
local param = string.explode(param, ',')
local player = getPlayerByName(param[1])
local storKey = param[2]
local storVal = param[3]
if(words == "/setPlayerStorage")then
if(isNumber(storKey) == TRUE and isNumber(storVal) == TRUE)then
setPlayerStorageValue(player, storKey, storVal)
doPlayerSendTextMessage(cid, 19, "you have successfully set "..getPlayerName(player).."'s storage value for "..storKey.." to value "..storVal..".")
else
doPlayerSendCancel(cid, "Incorrect params.")
end
else
if(isNumber(storKey))then
local value = getPlayerStorageValue(player, storKey)
doPlayerSendTextMessage(cid, 19, getPlayerName(player).."'s Nick Gracza's storage value for "..storKey.." is "..value..".")
else
doPlayerSendCancel(cid, "Incorrect params.")
end
end
else
doPlayerSendCancel(cid, "Command requires params.")
end
return TRUE
end
Last edited: