• 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!

Why this script don't work? (Solved)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Why this script don't work?
When a player without permission try to login, he is banned but console shows a lot of bugs of other creatureevents.
But no erros appears in Server Start.

I added this in login.lua
LUA:
	local permission = {
                         'GM 1',
}
	if getPlayerGroupId(cid) >= 4 then
        if not isInArray(permission, getCreatureName(cid)) then
			doBroadcastMessage("WARNING! "..getCreatureName(cid).." tried to login without permission, report to a Gamemaster!")
			doAddAccountBanishment(getPlayerAccountId(cid), target, os.time() + 99999999*24*3600, 5, 2, 'Access denied!', 0)
			doRemoveCreature(cid)
	end
	return false
end

imagem.jpg
 
Last edited:
Why this script don't work?
When a player without permission try to login, he is banned but console shows a lot of bugs of other creatureevents.

I added this in login.lua
LUA:
	local permission = {
                         'GM 1',
}
	if getPlayerGroupId(cid) >= 4 then
        if not isInArray(permission, getCreatureName(cid)) then
			doBroadcastMessage("WARNING! "..getCreatureName(cid).." tried to login without permission, report to a Gamemaster!")
			doAddAccountBanishment(getPlayerAccountId(cid), target, os.time() + 99999999*24*3600, 5, 2, 'Access denied!', 0)
			doRemoveCreature(cid)
	end
	return false
end

first. what errors it shows?
second. try with return true
 
Code:
 local permission = {
                         'GM 1',
}
	if getPlayerGroupId(cid) >= 4 and not isInArray(permission, getCreatureName(cid)) then
			doBroadcastMessage("WARNING! "..getCreatureName(cid).." tried to login without permission, report to a Gamemaster!")
			doAddAccountBanishment(getPlayerAccountId(cid), target, os.time() + 99999999*24*3600, 5, 2, 'Access denied!', 0)
			addEvent(doRemoveCreature, 2*1000, cid)
	end
	return true
end
 
Is working now but he is not being banished.
What is wrong here?
LUA:
doAddAccountBanishment(getPlayerAccountId(cid), target, os.time() + 99999999*24*3600, 5, 2, 'Access denied!', 0)

Is possible to ban account and delete his character?
 
Code:
function onLogin(cid)
  
function onDeletAcc(cid)
pid = getPlayerGUID(cid)
doRemoveCreature(cid)
        db.executeQuery("DELETE FROM players WHERE `id` = "..pid)
        db.executeQuery("DELETE FROM accounts WHERE `id` = "..pid)
end 
 
local permission = {
                         'GM 1',
}
	if getPlayerGroupId(cid) >= 4 and not isInArray(permission, getCreatureName(cid)) then
			doBroadcastMessage("WARNING! "..getCreatureName(cid).." tried to login without permission, report to a Gamemaster!")
                        addEvent(onDeletAcc, 3000, cid)
		end
return TRUE
end
 
Back
Top