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

The War Server v0.9

Capture Frag
PHP:
local increasingItemID = {416, 446, 3216}
local decreasingItemID = {417, 447, 3217}
function onStepIn(cid, item, position, fromPosition)
	if item.itemid == 426 then
		doTransformItem(item.uid, 425)
	end
	doTeleportThing(cid, fromPosition, TRUE)
	if getGlobalStorageValue(STORAGE_GLOBAL_GAME_TYPE) == 2 and isPlayer(cid) == TRUE then
		if item.actionid == 11111 then
			if getPlayerAccount(cid) == 1 then
				if getFlag1Owner() == 0 then -- flag on spawn
					if getFlag2Owner() == cid then -- player have flag
						setFlag2Owner(0)
						setTeam1Points(getTeam1Points()+15)
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have captured the flag!")
						broadcastMessage(getCreatureName(cid) .. " capture flag! Team " .. TEAM1_NAME .. " receive 15 points!",MESSAGE_INFO_DESCR)
					else -- player don't have flag
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are on spawn of your team flag! You can\'t get your flag!")
					end
				else -- enemy have flag
					if getFlag2Owner() == cid then
						if CTF == "normal" then
							setFlag2Owner(0)
							setTeam1Points(getTeam1Points()+15)
							doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have captured the flag!")
							broadcastMessage(getCreatureName(cid) .. " capture flag! Team " .. TEAM1_NAME .. " receive 15 points!",MESSAGE_INFO_DESCR)
						else
							doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getCreatureName(getFlag1Owner()) .. " stolen your team flag! You can\'t capture enemy flag until your team flag come back!")
						end
					else
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are on spawn of your team flag! " .. getCreatureName(getFlag1Owner()) .. " stolen you team flag! Find him and kill him!!")
					end
				end
			elseif getPlayerAccount(cid) == 2 then
				if getFlag1Owner() == 0 then -- flag on spawn
					setFlag1Owner(cid)
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You stole the ENEMY flag!")
					broadcastMessage(getCreatureName(cid) .. " stolen " .. TEAM1_NAME .. " team flag!", MESSAGE_INFO_DESCR)
				else -- someone from your team have flag
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are on spawn of ENEMY flag! " .. getCreatureName(getFlag1Owner()) .. " from your team stolen enemy flag!")
				end
			end
		elseif item.actionid == 22222 then
			if getPlayerAccount(cid) == 2 then
				if getFlag2Owner() == 0 then -- flag on spawn
					if getFlag1Owner() == cid then -- player have flag
						setFlag1Owner(0)
						setTeam2Points(getTeam2Points()+15)
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have captured the flag!")
						broadcastMessage(getCreatureName(cid) .. " capture flag! Team " .. TEAM2_NAME .. " receive 15 points!",MESSAGE_INFO_DESCR)
					else -- player don't have flag
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are on spawn of your team flag! You can\'t get your flag!")
					end
				else -- enemy have flag
					if getFlag1Owner() == cid then
						if CTF == "normal" then
							setFlag1Owner(0)
							setTeam2Points(getTeam2Points()+15)
							doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have captured the flag!")
							broadcastMessage(getCreatureName(cid) .. " capture flag! Team " .. TEAM2_NAME .. " receive 15 points!", MESSAGE_INFO_DESCR)
						else
							doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getCreatureName(getFlag1Owner()) .. " stolen your team flag! You can\'t capture enemy flag until your team flag come back!")
						end
					else
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are on spawn of your team flag! " .. getCreatureName(getFlag2Owner()) .. " stolen you team flag! Find him and kill him!!")
					end
				end
			elseif getPlayerAccount(cid) == 1 then
				if getFlag2Owner() == 0 then -- flag on spawn
					setFlag2Owner(cid)
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You stolen the ENEMY flag!")
					broadcastMessage(getCreatureName(cid) .. " stolen " .. TEAM2_NAME .. " team flag!",MESSAGE_INFO_DESCR)
				else -- someone from your team have flag
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are on spawn of ENEMY flag! " .. getCreatureName(getFlag2Owner()) .. " from your team stolen enemy flag!")
				end
			end
		end
	end
	if getGlobalStorageValue(STORAGE_GLOBAL_GAME_TYPE) == 3 and isPlayer(cid) == TRUE then
		if item.actionid == 11111 then
			broadcastMessage(TEAM1_NAME .. " TEAM WIN! " .. getCreatureName(cid) .. " did quest first!",MESSAGE_INFO_DESCR)
			setMap(getNextMapID())
		elseif item.actionid == 22222 then
			broadcastMessage(TEAM2_NAME .. " TEAM WIN! " .. getCreatureName(cid) .. " did quest first!",MESSAGE_INFO_DESCR)
			setMap(getNextMapID())
		end
	end
	return TRUE
end

function onStepOut(cid, item, position, fromPosition)
	if item.itemid == 425 then
		doTransformItem(item.uid, item.itemid + 1)
	end
	return TRUE
end

Keraxel, can adapt to your system Team?
 
Gaaah :/
The last code is:
PHP:
 if getConfigValue('experienceByKillingPlayers') == "yes" then 
                doPlayerAddLevel(lastHitKiller, LEVEL_GAIN_FOR_KILL) 
            end
Now it should works correctly ;)



Where do i add this PHP code? in actions?
 
You can attack players in the same team.
How do i fix so you cant attack players in the same team.
 
Is it possible to change the team select code in mine.lua so it will choose account where is less players (1/1 and 2/2) instead of setting colors and spawn?
 
[15/05/2009 19:30:20] Lua Script Error: [CreatureScript Interface]
[15/05/2009 19:30:20] data/creaturescripts/scripts/mine/protect.lua:eek:nPrepareDeath

[15/05/2009 19:30:20] luaDoRemoveConditions(). Creature not found

[15/05/2009 19:30:24] Lua Script Error: [CreatureScript Interface]
[15/05/2009 19:30:24] data/creaturescripts/scripts/mine/protect.lua:eek:nPrepareDeath

[15/05/2009 19:30:24] luaDoRemoveConditions(). Creature not found
 
Back
Top