• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Protection for your server

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
This script blocks every 'GMs' out of permission to login
In creaturescripts/scripts/login.lua add this
Lua:
function onLogin(cid)
 local permission = {
                         'GM Lucas Olzon Example',
}
	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)
                        return false
	end
 
not a good solution!?

If a hacker gets access to your database, he can do much more than just change his group_id l:

and ye you're missing return true & end
 
Last edited:
i'd never make something like this because it would never be executed, if you can secure your server you really don't need it :p:p:p
 
no sence if someone got access to your database he can got passwords for your GM...
In my datebase isn't password but like this:
przechwytywaniecr.png
 
It's not missing, you must add all code in login.lua

Yah it is, you gave us
Code:
function onLogin(cid)
 local permission = {
                         'GM Lucas Olzon Example',
}
	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)
		return false
	end

it should be,
Code:
function onLogin(cid)
 local permission = {
                         'GM Lucas Olzon Example',
}
	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)
		return false
	end
	return true
end
 
Back
Top