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

[TFS] I need /pvp command script

Originally taken from TFS 0.3 beta 1 patch level 2.
Code:
function onSay(cid, words, param)
	local tmp = getWorldType()

	local msg = ""	
	if(tmp == WORLD_TYPE_NO_PVP) then
		msg = "No-PVP"
	elseif(tmp == WORLD_TYPE_PVP) then
		msg = "PVP"
	elseif(tmp == WORLD_TYPE_PVP_ENFORCED) then
		msg = "PVP-Enforced"
	else
		return TRUE
	end
	
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "World type is currently set to " .. msg .. ".")
	return TRUE
end
 
Hello i have 2 problems.
First is that i need a /pvp command for my TFS 0.2.10 (in talkactions?) or script in C++ for this /pvp command to compile into my distro.
And second one is in this topic: (look at my post)
http://otland.net/f81/soccer-system-14837/index3.html

Tnx, for help i will give a reputation point.

Do you want to be able to change the World type? or do you want that it shows which server type your server is?...


kind regards, Evil Hero
 
The one you posted just says to what type the server is set at the moment. O_O

I guess it will only work for 0.3...
Code:
local nopvpWords = {"1", "nopvp", "nonpvp", "no-pvp", "non-pvp", "safe"}
local pvpWords = {"2", "pvp", "normal"}
local pvpenforcedWords = {"3", "pvpe", "pvpenforced", "pvp-enforced", "war"}

function onSay(cid, words, param)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return TRUE
	end

	local world = getWorldType()

	param = string.lower(param)
	if table.isStrIn(param, nopvpWords) then
		setWorldType(WORLD_TYPE_NO_PVP)
		world = "No-PVP"
	elseif table.isStrIn(param, pvpWords) then
		setWorldType(WORLD_TYPE_PVP)
		world = "PVP"
	elseif table.isStrIn(param, pvpenforcedWords) then
		setWorldType(WORLD_TYPE_PVP_ENFORCED)
		world = "PVP-Enforced"
	else
		doPlayerSendCancel(cid, "Bad gameworld type.")
		return TRUE
	end

	doBroadcastMessage("Gameworld type set to: " .. world .. ".", MESSAGE_EVENT_ADVANCE)
	return TRUE
end
 
Back
Top