What's new

Anty MC

Status
Not open for further replies.
Joined
Jul 14, 2010
Messages
37
Reaction score
5
Odp: Anty MC

creature.xml

Code:
<event type="login" name="xxx" event="script" value="onlogin.lua"/>
<event type="logout" name="xxx" event="script" value="onlogout.lua"/>


data-->creaturescript-->scripts

onlogin.lua
Code:
MC_loggedIPs = {}
MC_kicked = {}

function onLogin(cid, lastLogin)
	local playerIP = getPlayerIp(cid)
	if(MC_loggedIPs[playerIP] ~= nil) then
		MC_kicked[cid] = TRUE
		doPlayerPopupFYI(cid, "MC Is blocked!")
		doRemoveCreature(cid)
		return TRUE
	end

	MC_loggedIPs[playerIP] = TRUE
	return TRUE
end

onlogout.lua
Code:
function onLogout(cid)
	if(MC_kicked[cid] == TRUE) then
		return TRUE
	end

	local playerIP = getPlayerIp(cid)
	if(_G["MC_loggedIPs"][playerIP] ~= nil) then
		_G["MC_loggedIPs"][playerIP] = nil
	end
	return TRUE
end

Notka moderatorska:
+1pkt OT Expert
 
Last edited by a moderator:
Status
Not open for further replies.
Top