• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Super Anti MC {need help}

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Is possible to add to this script this?
Code:
1. Player can't kill the same IP more than 3x
[COLOR="red"]You cannot kill the same person three times in a row. Kill another player then you can kill him again. (You didn't received frag/reward)[/COLOR]

2. If he kill a different IP he can kill the old IP
[COLOR="red"]You killed a different IP. Now you can kill <old player> again.[/COLOR]
LUA:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then
			doCreatureAddHealth(cid, -200)
			doCreatureAddMana(cid, -200)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
		else
			doPlayerAddItem(cid, 2152, 1)
			setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
		end
	end
	return true
end
 
Last edited:
try:

LUA:
local storageCountKill = 75114

function onKill(cid, target, lastHit)
	if isPlayer(target) then
	local killCountPlayer = getCreatureStorage(cid, storageCountKill)
	
		if getPlayerIp(cid) == getPlayerIp(target) then
			if getCreatureStorage(cid, storageCountKill) >= 3 then
				doCreatureAddHealth(cid, -200)
				doCreatureAddMana(cid, -200)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
			else
				doPlayerAddItem(cid, 2152, 1)
				setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
			end
			
			if killCountPlayer == -1 then
				setPlayerStorageValue(cid, storageCountKill, 0)
			end
			
			setPlayerStorageValue(cid, storageCountKill, killCountPlayer+1)
			
		else

			setPlayerStorageValue(cid, storageCountKill, 0)
			doPlayerAddItem(cid, 2152, 1)
			setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
			
		end
	end
	
	return true
end
 
e no store it in table, per-player, and per-victim for each player

this will just make you get fap punishment every 3 kills :p
 
LUA:
function onKill(cid, target, lastHit)
	if isPlayer(target) and isPlayer(cid) then
		ip = getPlayerIp(target)
 
		if ipTables[getPlayerGUID(cid)] == nil then
			ipTables[getPlayerGUID(cid)] = {}
			ipTables[getPlayerGUID(cid)][ip] = 1
			doPlayerAddItem(cid, 2152, 1)
		else
			if ipTables[getPlayerGUID(cid)][ip] == nil then
				ipTables[getPlayerGUID(cid)] = {}
				ipTables[getPlayerGUID(cid)][ip] = 1
			else
				if ipTables[getPlayerGUID(cid)][ip] ~= 3 then
					ipTables[getPlayerGUID(cid)][ip] = ipTables[getPlayerGUID(cid)][ip] + 1
					doPlayerAddItem(cid, 2152, 1)
				else
					doCreatureAddHealth(cid, -200)
					doCreatureAddMana(cid, -200)
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
				end
			end
		end
	end 
	return true
end
 
Last edited:
@VirrageS

Your script functionality: If you kill same IP 3 times you will NEVER be abe to kill people without get punishment even if you are killing a different IP.

How should be:
1. Player can't kill the same IP more than 3x
You cannot kill the same person three times in a row. Kill another player then you can kill him again. (You didn't received frag/reward)

2. If he kill a different IP he can kill who he wants (including old IP). Remembering that player cannot kill same ip 3 consecutive times never.
You killed a different IP. Now you can kill <old player> again.
 
Back
Top