Witam, skrypt po wpisaniu odpowiedniej komendy pisze co kto ma na sobie.
Spoiler:
Spoiler:
talkaction/scripts/itemSpy.lua
Wpisujemy to:
Kod:
Spoiler:
function onSay(cid, words, param)
local needed_access = 3 -- potrzebny access
local msg = ""
if getPlayerAccess(cid) >= needed_access then
local player = getPlayerByName( param )
local slots = { CONST_SLOT_HEAD, CONST_SLOT_NECKLACE, CONST_SLOT_BACKPACK, CONST_SLOT_ARMOR, CONST_SLOT_RIGHT, CONST_SLOT_LEFT, CONST_SLOT_LEGS, CONST_SLOT_FEET, CONST_SLOT_RING, CONST_SLOT_AMMO }
local slotsNames = { "GLOWA", "AMULET", "PLECAK", "ZBROJA", "PRAWA REKA", "LEWA REKA", "NOGI", "STOPY", "PIERSCIEN", "AMUNICJA" }
if isPlayer( player ) == TRUE then
msg = param .. " ma na sobie:\n"
for key, slot in pairs(slots) do
local item = getPlayerSlotItem( player, slot )
if item ~= FALSE then
local itemDescription = getItemDescriptions( item.itemid )
if( item.type > 1 ) then
msg = msg .. slotsNames[key] .. " -> " .. item.type .. "x " .. itemDescription.plural .. "\n"
else
msg = msg .. slotsNames[key] .. " -> " .. itemDescription.article .. " " .. itemDescription.name .. "\n"
end
end
end
else
msg = "Gracz o nicku " .. param .. " nie jest zalogowany."
end
else
doSendMagicEffect( getThingPos( cid ), CONST_ME_POFF )
msg = "Nie masz wymaganych uprawnien, aby skorzystac z tej funkcji."
end
doPlayerSendTextMessage( cid, MESSAGE_EVENT_DEFAULT, msg )
return TRUE
end
Spoiler:
W talkaction.xml:
Wpisujemy to:
Kod:
Spoiler:
<talkaction words="/spy" filter="first word" script="itemSpy.lua" />
Ta komenda brzmi!
Spoiler:
/spy nick
Offline