• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Kill players with God/GM

Aarthec

w0000t
Joined
Apr 25, 2009
Messages
129
Reaction score
0
Location
Sweden
Sometimes you might feel for punishing a player by killing him :)

How to use:
/kill playername


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 got killed by an admin")
		doCreatureAddHealth(player, -getCreatureMaxHealth(player))
	end
return TRUE
end

PHP:
<talkaction log="yes" access="5" words="/kill" event="script" value="killplayer.lua"/>
 
Last edited:
Back
Top Bottom