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

Compiling [TFS 0.2] SetWorldType

ScorpiOOn93

etherno.net
Joined
Jun 19, 2008
Messages
662
Reaction score
1
Location
CookieLand :DDD
Hello
I want to do something like hours of pvp and no-pvp on my server and for this i need a setworldtype function, but my distro doesnt have it. I was searching but i didnt found any topic with code to compile it so i was trying to took this function from tfs 0.3
I thought that i've done everything right beacouse i didnt had any errors while compiling etc. and then i took the script to change the worldtype in talkactions and this script is using the setworldtype function, but when i want to use this command for example to change the worldtype to no-pvp (/pvp "1) in my console its showing error:


and its not changing the worldtype.

This is script in talkaction:
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 ~= nil then
local world = ""
if isInArray(nopvpWords, param) == TRUE then
setWorldType(WORLD_TYPE_NO_PVP)
world = "No-PVP"
elseif isInArray(pvpWords, param) == TRUE then
setWorldType(WORLD_TYPE_PVP)
world = "PVP"
elseif isInArray(pvpenforcedWords, param) == TRUE then
setWorldType(WORLD_TYPE_PVP_ENFORCED)
world = "PVP-Enforced"
else
doPlayerSendCancel(cid, "Zly typ OTSa.")
return FALSE
end

broadcastMessage("Typ OTSa zostal zmieniony na: ".. world ..".", MESSAGE_EVENT_ADVANCE)
else
doPlayerSendCancel(cid, "Command requires param for action.")
end

return FALSE
end

I know that this script its working and the errors are beacouse i've done something wrong in my distro, but its almost the same like in distro from tfs 0.3 :/

Ps: I cant give here source from my distro...
 
@Up
Omg...
Yes i can change the worldtype in config.lua but then i can change it only with server restart and another change in config.lua and i want to do something like /pvp command to change the worldtype ingame.
 
Back
Top