What's new

anty bomb system

Status
Not open for further replies.

orzeleagle122

Advanced User
Joined
May 18, 2010
Messages
449
Reaction score
16
potrzebuje skrypta ktore dziala nastepujaco:
jak wiecej niz dwie osoby chca wbic na raz z tego samogo ip
to skrypt pozwala tylko po uplynieciu 2sec od logowania tego ip
czyli co dwie sekundy moze zalogowac na raz z tego samogo ip.
za pomoc rep++
pozdrawiam
 

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: anty bomb system

1.
PHP:
local function gtfoMC(p) 
    if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then 
        doRemoveCreature(p.pid) 
    end 
        return TRUE 
end 

function onLogin(cid) 
    addEvent(gtfoMC, 1000, {pid = cid, max = 3}) 
    return TRUE 
end
2.
PHP:
local config = {
	max = 1,     -- max chars with the same ip
	text = "Multi-Client is not allowed.",  -- text on kick
	group_id = 1 -- only kick player with group id 1 (normal players)
}
 
local accepted_ip_list = {} 
 
local function antiMC(p)
	if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
        	doRemoveCreature(p.pid)
	end
	return TRUE
end
 
function onLogin(cid)
	if getPlayerGroupId(cid) <= config.group_id then
		if isInArray(accepted_ip_list, getPlayerIp(cid)) == FALSE then 
			addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
			doPlayerPopupFYI(cid, config.text)
		end
	end
	return TRUE
end
Mo?esz tych spr?bowa?.
 

orzeleagle122

Advanced User
Joined
May 18, 2010
Messages
449
Reaction score
16
Odp: anty bomb system

mozesz mi jeszcze napisac gdzie to powklejac ?
 

Xart Irok

Senior User
Joined
Sep 7, 2008
Messages
2,925
Reaction score
419
Age
32
Odp: anty bomb system

CreatureEvents.xml
PHP:
<event type="login" name="PlayerLogin" event="script" value="mc.lua"/>
Prosz? ja cie bardzo.
 
Status
Not open for further replies.
Top