function onKill(cid, target)
if isPlayer(target) == TRUE then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
end
return TRUE
end
LUA:function onKill(cid, target) if isPlayer(target) == TRUE then if getPlayerIp(cid) ~= getPlayerIp(target) then doPlayerAddExperience(cid, -1000000) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.") end end return TRUE end
if getPlayerIp(cid) ~= getPlayerIp(target) then
if getPlayerIp(cid) [COLOR="red"]==[/COLOR] getPlayerIp(target) then
and for example in creaturescripts i should add for example....
<event type="think" name="mcip" event="script" value="mcip.lua"/> something like this
and in the "think" what i should put?
<event type="kill" name="punishment" event="script" value="punishment.lua"/>
function onKill(cid, target, lastHit)
if isPlayer(target) and isPlayer(cid) then
if getPlayerIp(cid) == getPlayerIp(target) then
return doPlayerAddExperience(cid, -100000) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Keep killing players with the same ip as you and you'll be a rookie again!")
end
end
return true
end
<event type="kill" name="AntiMC" event="script" value="antimc.lua"/>