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

allowClones only in some players

Cotizado

Member
Joined
May 12, 2008
Messages
320
Reaction score
7
is it posible to allowClones only in some players lua or c++?
like there are alot of chars but only some of them can multiply character
or just the ones with group 7
 
Last edited:
@phowned
i will try it
@unknown
it could be posible allowing all and then return false where group id ~= 7 and online = 1
but i dont know how to make it all together
 
@phowned
i will try it
@unknown
it could be posible allowing all and then return false where group id ~= 7 and online = 1
but i dont know how to make it all together
In 0.3.6pl1 .cpp files is:
m_confNumber[ALLOW_CLONES] = getGlobalNumber("allowClones", 0);
Then its possible to allow clones (set in config.lua value to 1). If you want make my last script work you must 'allow clones' (all players).
 
In 0.3.6pl1 .cpp files is:

Then its possible to allow clones (set in config.lua value to 1). If you want make my last script work you must 'allow clones' (all players).

That's another view to make the script, good idea, might be possible in that way.

##Slight modification at playersOnline check, better to use ipairs loop for that.
LUA:
local allowed,c = {'Cotizado'},0 --names,clones.
function onLogin(cid)
	if isInArray(allowed:lower(),getCreatureName(cid):lower()) then
		return TRUE
	end
	for _,pid in ipairs(getPlayersOnline()) do
		if getCreatureName(pid) == getCreatureName(cid) then
			c = c+1
		end
	end
	if c > 1 then
		return false
	end
	return c = 0
end

ofcourse, allow clones in config.
 
Last edited:
@up
Are you sure that 'c' shouldn't be definied in function? I'm not sure, but I think your script will add +1 every login to 'c' and never set 'c' to 0 (only when reload creaturescripts / restart server).
 
local c doesn't have to be defined in the function, as it's a numberic value. (better to define above function).

And it doesn't add +1 every second.
This checks every player online and if there is a player with the same name, it adds +1 to the value.
if c = 1 then that means that there is only one player with the same name (including the one logging in).
so if c > 1 then it means that you are already logged in, so it returns false.

But I did add that it will go to 0 again now.
 
Back
Top