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

On Making Teams

Status
Not open for further replies.

Mattt

I'm cool I swear
Joined
Apr 28, 2008
Messages
1,163
Reaction score
7
Location
USA
Hey everyone, well im working on an War Server, and i wanna do like teams,

Like Humans vs Orcs?

and make it so you can pick that option when your making your character.

I was wondering if anyone could help me at all, Ill gladly give rep++:thumbup:
 
You have to edit the nr's a bit, since your probably only using promoted vocations.
Lua:
  local outfits =  {
        [1] = "necromancer", --sorc
        [2] = "dragon", --druid
        [3] = "elf", --pally
        [4] = "orc", --kina
        [5] = "necromancer", --master sorc
        [6] = "dragon", --elder druid
        [7] = "elf", --royal pally
        [8] = "orc", --elite kina
}

function onLogin(cid)
    local voc = getPlayerVocation(cid)
        if voc > 0 and getPlayerAccess == 1 then
            doSetMonsterOutfit(cid, outfits[string.lower(voc)], -1)
        end
return TRUE
end
 
i made it fast ;p let me rescript it the other way then
 
w about this one?
Lua:
local outfits =  {
    [0] = 53,  --troll outfit for rook
    [1] = 209, --necromancer outfit for sorc
    [2] = 123, --panda outfit for druid
    [3] = 159, --elf outfit for pally
    [4] = 306, --gladiator outfit for kina
}

function onLogin(cid)
        if getPlayerAccess < 2 then
            doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)].lookType, -1)
        end
return TRUE
end
i guess you added the line to creaturescripts.xml
 
Code:
25/03/2010 14:48:42] Description: 
[25/03/2010 14:48:42] data/creaturescripts/scripts/teams.lua:10: attempt to compare function with number
[25/03/2010 14:48:42] stack traceback:
[25/03/2010 14:48:42] 	data/creaturescripts/scripts/teams.lua:10: in function <data/creaturescripts/scripts/teams.lua:9>
 
Code:
  local outfits =   {
    [0] = 53,  --troll outfit for rook
    [1] = 209, --necromancer outfit for sorc
    [2] = 123, --panda outfit for druid
    [3] = 159, --elf outfit for pally
    [4] = 306, --gladiator outfit for kina
}

function onLogin(cid)
        if getPlayerAccess(cid) < 2 then
            doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)].lookType, -1)
        end
return TRUE
end
 
Code:
[25/03/2010 15:24:18] [Error - CreatureScript Interface] 
[25/03/2010 15:24:18] data/creaturescripts/scripts/teams.lua:onLogin
[25/03/2010 15:24:18] Description: 
[25/03/2010 15:24:18] data/creaturescripts/scripts/teams.lua:11: attempt to index field '?' (a nil value)
[25/03/2010 15:24:18] stack traceback:
[25/03/2010 15:24:18] 	data/creaturescripts/scripts/teams.lua:11: in function <data/creaturescripts/scripts/teams.lua:9>
 
I guess you logged in with a promoted character.
Code:
  local outfits =   {
    [0] = 53,  --troll outfit for rook
    [1] = 209, --necromancer outfit for sorc
    [2] = 123, --panda outfit for druid
    [3] = 159, --elf outfit for pally
    [4] = 306, --gladiator outfit for kina
    [5] = 209, --necromancer outfit for sorc
    [6] = 123, --panda outfit for druid
    [7] = 159, --elf outfit for pally
    [8] = 306, --gladiator outfit for kina
}

function onLogin(cid)
        if getPlayerAccess(cid) < 2 then
            doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)].lookType, -1)
        end
return TRUE
end
 
Code:
[25/03/2010 16:16:28] [Error - CreatureScript Interface] 
[25/03/2010 16:16:28] data/creaturescripts/scripts/teams.lua:onLogin
[25/03/2010 16:16:28] Description: 
[25/03/2010 16:16:28] data/creaturescripts/scripts/teams.lua:15: attempt to index field '?' (a number value)
[25/03/2010 16:16:28] stack traceback:
[25/03/2010 16:16:28] 	data/creaturescripts/scripts/teams.lua:15: in function <data/creaturescripts/scripts/teams.lua:13>
 
Oh, lol this one should do it
Code:
local outfits =   {
    [0] = {lookType = 53, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94},  --troll outfit for rook
    [1] = {lookType = 209, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --necromancer outfit for sorc
    [2] = {lookType = 123, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --panda outfit for druid
    [3] = {lookType = 159, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --elf outfit for pally
    [4] = {lookType = 306, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --gladiator outfit for kina
    [5] = {lookType = 209, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --necromancer outfit for sorc
    [6] = {lookType = 123, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --panda outfit for druid
    [7] = {lookType = 159, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --elf outfit for pally
    [8] = {lookType = 306, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94} --gladiator outfit for kina
}

function onLogin(cid)
        if getPlayerAccess(cid) < 2 then
            doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)], -1)
        end
return TRUE
end
 
Doesnt show any errors at all, but when i click my char, it never logs in. The exe says Matt has logged in and Matt has logged out.
 
ehm sypher, he already said he doesn't use TFS 0.2
@TFS 0.3 promoted vocations don't double the voc number
Vocation = 1 to 4
Promoted = 0 or 1

truly weird that it hasn't worked yet
 
@sypher i got it to work=] i had to reset accounts;p

Repp++ to cyb3r and sypher, thank you guys!

I really appreciate you guys helpin me:]
 
The one five posts up

Code:
local outfits =   {
    [0] = {lookType = 53, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94},  --troll outfit for rook
    [1] = {lookType = 209, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --necromancer outfit for sorc
    [2] = {lookType = 123, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --panda outfit for druid
    [3] = {lookType = 159, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --elf outfit for pally
    [4] = {lookType = 306, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --gladiator outfit for kina
    [5] = {lookType = 209, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --necromancer outfit for sorc
    [6] = {lookType = 123, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --panda outfit for druid
    [7] = {lookType = 159, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --elf outfit for pally
    [8] = {lookType = 306, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94} --gladiator outfit for kina
}

function onLogin(cid)
        if getPlayerAccess(cid) < 2 then
            doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)], -1)
        end
return TRUE
end
 
let's see which one works...
1
Lua:
local outfits =   {
    [0] = {lookType = 53, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94},  --troll outfit for rook
    [1] = {lookType = 209, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --necromancer outfit for sorc
    [2] = {lookType = 123, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --panda outfit for druid
    [3] = {lookType = 159, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --elf outfit for pally
    [4] = {lookType = 306, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --gladiator outfit for kina
}

function onLogin(cid)
    if getPlayerAccess(cid) < 2 then
        doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)], -1)
    else
        return false
    end
return true
end

2
Lua:
local outfits =   {
    [0] = {lookType = 53, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94},  --troll outfit for rook
    [1] = {lookType = 209, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --necromancer outfit for sorc
    [2] = {lookType = 123, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --panda outfit for druid
    [3] = {lookType = 159, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --elf outfit for pally
    [4] = {lookType = 306, lookHead = 94, lookAddons = 0, lookLegs = 94, lookBody = 94, lookFeet = 94}, --gladiator outfit for kina
}

function onLogin(cid)
    if getPlayerAccess(cid) < 2 then
        doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)], -1)
    else
        return true
    end
return true
end
1st one ought to be the one
 
Code:
[25/03/2010 16:59:04] 	[C]: in function 'doSetCreatureOutfit'
[25/03/2010 16:59:04] 	data/creaturescripts/scripts/teams.lua:11: in function <data/creaturescripts/scripts/teams.lua:9>
[25/03/2010 16:59:04] Meow has logged out.

Is what it says when i try to login my regular character.

and I still cant login my Admin

Thats for the first one
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Also same errors for second script
 
Status
Not open for further replies.
Back
Top