• 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] Punishment system

Paulim

New Member
Joined
Jun 3, 2009
Messages
31
Reaction score
0
I would love for you guys help me with my script here to punish my players..
I already have a script that kills a player, which I designate...
Here you are:
Lua:
function onSay(cid, words, param)

local player = getCreatureByName(param)

if(param == "") then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return TRUE
    end

    local pid = getPlayerByNameWildcard(param)
    if(pid == 0 or (isPlayerGhost(pid) == TRUE and getPlayerAccess(pid) > getPlayerAccess(cid))) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
        return TRUE
    end 
        
        if isPlayer(player) == TRUE then
                doPlayerSendTextMessage(cid, 22, "You killed "..param.."!")
                doPlayerSendTextMessage(player, 19, "You were killed because you didnt respect the rules.")
                doCreatureAddHealth(player, -getCreatureMaxHealth(player))
        end
return TRUE
end

Now entering my idea for the script:

1º Add a comma (param) to command and designate the amount of exp I go to remove the dead player
Example: /kill botter, 100000 ( So the dead player loses 100000 amount of exp )
2º Add the name of the killer in the dead body, because currently shows the following:
You Recognize Botter, he was killed by NOTHING.

Thats my ideia, I hope you help me..
Thanks!!!
 
Very thanks but,
It Dont kills the player, only gimme a message like this:

You Killer Botter, 100000!

and the experience was retired from myself, but I fixed
doPlayerAddExperience(pid, -t[2])

Same way, it dont kills the player... neither exp, or nothing

Sorry for english
Thanks 4 help.
 
lulz i fail
Lua:
function onSay(cid, words, param, channel)
    if(param == '') then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Command param required.')
    end
 
    local t = string.explode(param, ',')
    local pid = getPlayerByNameWildcard(t[1])
 
    if not isPlayer(pid) or isPlayerGhost(pid) and getPlayerAccess(pid) > getPlayerAccess(cid) then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Player ' .. t[1] .. ' not found.')
    end
 
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You killed '..getCreatureName(pid)..'!')
    doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, 'You were killed because you didnt respect the rules.')
    if t[2] then
        doPlayerAddExperience(pid, -t[2])
    end
 
    doTargetCombatHealth(cid, pid, 1, -getCreatureMaxHealth(pid), -getCreatureMaxHealth(pid), 0)
    return true
end
 
Back
Top