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

[LUA]isCreature(cid). Return monsters or npcs?

Kyran

Member
Joined
Jan 17, 2009
Messages
68
Reaction score
5
Is it possible for this function to return only if there is a monster or a npc, like isMonster and isNpc does? I use TFS 0.2.8 and i can't seem to get it to work.

Thank you :)
 
the isCreature function doesn't care wether it's a player, monster or npc.. So if i use isPlayer(cid) == false it still wont know the difference between monsters and npc's. I see that other distros uses the functions isMonster, isNpc, isNpc and isCreature. But not TFS

Edit:
I'm also under the impression that the creatureids are limited to different types of creatures. Like players have f.eks 1 - 400000, monsters have from 400000 - 700000 and NPCs have from 700000 - 9000000. If thats the case, i don't see it as a big problem to make that function.
 
Last edited:
the isCreature function doesn't care wether it's a player, monster or npc.. So if i use isPlayer(cid) == false it still wont know the difference between monsters and npc's. I see that other distros uses the functions isMonster, isNpc, isNpc and isCreature. But not TFS

Edit:
I'm also under the impression that the creatureids are limited to different types of creatures. Like players have f.eks 1 - 400000, monsters have from 400000 - 700000 and NPCs have from 700000 - 9000000. If thats the case, i don't see it as a big problem to make that function.

It already exists and is very easy to find.

Code:
function isPlayer(cid)
    return isCreature(cid) and cid >= AUTOID_PLAYERS and cid < AUTOID_MONSTERS
end

function isMonster(cid)
    return isCreature(cid) and cid >= AUTOID_MONSTERS and cid < AUTOID_NPCS
end

function isNpc(cid)
    return isCreature(cid) and cid >= AUTOID_NPCS
end
 
Back
Top