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

!pk <who is pk on the server> Script

zayat

New Member
Joined
May 12, 2009
Messages
347
Reaction score
2
i need a PK script which tell me who is pk on my server . Is there any?
 
XML:
<talkaction words="!pk;/pk" event="script" value="skull.lua"/>

Code:
local table = {
    [SKULL_WHITE] = 'White Skull', 
    [SKULL_RED] = 'Red Skull', 
    [SKULL_BLACK] = 'Black Skull'
}

function onSay(cid, words, param, channel)
    local strings, i, position, added = {''}, 1, 1, false
    for _, pid in ipairs(getPlayersOnline()) do
        if(added) then
            if(i > (position * 7)) then
                strings[position] = strings[position] .. ','
                position = position + 1
                strings[position] = ''
            else
                strings[position] = i == 1 and '' or strings[position] .. ', '
            end
        end

        added = false
        if getCreatureSkullType(pid) > 2 then
            strings[position] = strings[position] .. getCreatureName(pid) .. ' [' .. table[getCreatureSkullType(pid)] .. ']'
            i = i + 1
            added = true
        end
    end
    
    if i == 1 then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'No skulled players online.')
    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. ' skulled player' .. (i > 1 and 's' or '') .. ' online:')
    for i, str in ipairs(strings) do
        if(str:sub(str:len()) ~= ',') then
            str = str .. '.'
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
    end
    return true
end
 
Back
Top