/kill George
-- Required group id to use command.
local req_G_ID = 5
function onSay(cid, words, param)
if (getPlayerGroupId(cid) < req_G_ID) then return TRUE end
if (param ~= "") then
local player = getPlayerByName(param)
if (player == 0) then
doPlayerSendCancel(cid, "A player with this name is not online.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
else
doCreatureAddHealth(player, - getCreatureMaxHealth(player))
doPlayerSendTextMessage(cid, 24, "You have successfully killed "..param..".")
end
else
doPlayerSendCancel(cid, "No player specified.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
Yeah! Thanks! I needed something like that. I just wonder if you can help me edit it a little. I want it to broadcast the kill aswell.
Example
/kill Cheater, "Afk botting
Then it will kill the cheater and broadcast something like this:
Player Cheater was slayed by (killer). Reason "Afk botting".
Something like that ^^
-- Required group id to use command.
local req_G_ID = 5
function onSay(cid, words, param)
if (getPlayerGroupId(cid) < req_G_ID) then return TRUE end
if (param ~= "") then
local player = getPlayerByName(param)
if (player == 0) then
doPlayerSendCancel(cid, "A player with this name is not online.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
else
doCreatureAddHealth(player, - getCreatureMaxHealth(player))
doPlayerSendTextMessage(cid, 24, "You have successfully killed "..param..".")
doBroadcastMessage("A GM used a stupid command" )
end
else
doPlayerSendCancel(cid, "No player specified.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
@ /\
You should read my post again.. That's not the function I asked for..
doBroadcastMessage(" " .. getPlayerGroupName(cid) .. " killed " .. getCreatureName(player) .. " for botting. )