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

[Flag] Connotbeattacked

agomez

Member
Joined
Jan 28, 2009
Messages
211
Reaction score
5
want to have Cannotbeattacked but i want that that monster can attack me and characters no please could anyone help me? or how to make a new flag that players cant kill/attack you,and you cant attack her?
but monster should can attacking you
thanks

or how i can make if player have group id 7 he cannot be attacked or attack a player? maybe something like this?

function onCombat(cid, target)
if (getPlayerGroupId(cid) == 7 and getPlayerGroupId(target) == 1) or isPlayer(target) == FALSE then
return TRUE
else
doPlayerSendCancel(cid, "You cannot attack this player.")
return FALSE
end
end
 
Last edited:
LUA:
function onCombat(cid, target)
	if isPlayer(target) and (getPlayerGroupId(cid) == 7 or getPlayerGroupId(target) == 7) then
		return not doPlayerSendCancel(cid, 'You cannot attack this player.')
	end
	return true
end
 
Last edited:
i got this error ='(

[09/03/2011 17:19:16] [Error - CreatureScript Interface]
[09/03/2011 17:19:16] data/creaturescripts/scripts/pvp.lua:onCombat
[09/03/2011 17:19:16] Description:
[09/03/2011 17:19:16] (internalGetPlayerInfo) Player not found when requesting player info #17

and i added in groups.xml this:

<group id="7" name="Player"/>

to create the groupid 7 :P
is that right? or i missed something?
 
I put this:

function onCombat(cid, target)
if isPlayer(target) and (getPlayerGroupId(cid) == 7 or getPlayerGroupId(target) == 1) then
return not doPlayerSendCancel(cid, 'You cannot attack this player.')
end
return true
end
but now he can attack mosnter, and cannot attacked players.
But he can be attacked by players u.u
 
THANKS i fix it thank to your help ^^!! i'd add you red if i'd know u.u
but i need a little bit of help again heeh
how i can make ehwn you use a certain item you will receive GroupId 7 :D
 
thats worked hehehe =) im happy now. but i have a little problem, now i cant see the vocation of each player how can i make when i see the player it says: He is a getplayervocation u.u
i didnt use that function at all

i made this:

function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
if getPlayerGroupId(thing.uid) > 6 then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and ".\nShe" or ".\nHe") .. " PvP-Disabled")
doPlayerSendTextMessage(cid, 27, getPlayerName(thing.uid) .. " is disabled.")
else
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and ".\nShe" or ".\nHe") .. " PvP-Enabled.")
doPlayerSendTextMessage(cid, 27, getPlayerName(thing.uid) .. " is enabled.")
end
end
return true
end

but it appears a lot of times when you see a player just 1 time :S!!!!!!!! how can i fix it ='(
 
Last edited:
Back
Top