Postado Abril 25, 2017 8 anos Autor o elseif é caso eles não seja premium volte para vocação "free"...
Postado Abril 26, 2017 8 anos 6 horas atrás, Helliab disse: o elseif é caso eles não seja premium volte para vocação "free"... Tenta ai uahsusah(aproveitei pra ver se to entendendo o for) cria um arquivo novo em creaturescripts chamado newvoc.lua e coloca isso ai local free = {1, 2, 3, 4} local prem = {5, 6, 7, 8} function onLogin(cid) if isPremium(cid) then for _, v in pairs(free) do if getPLayerVocation(cid) == v then doPlayerSetVocation(cid, getPLayerVocation(cid) + 4) end end else for k, i in pairs(prem) do if getPLayerVocation(cid) == i then doPlayerSetVocation(cid, getPLayerVocation(cid) - 4) end end end return true end no creaturescripts.xml coloca isso: <event type="login" name="LogVoc" event="script" value="newvoc.lua"/> no login.lua só registra isso: registerCreatureEvent(cid, "LogVoc")
Postado Abril 28, 2017 8 anos Autor Em 25/04/2017 ás 22:47, Sekk disse: Tenta ai uahsusah(aproveitei pra ver se to entendendo o for) cria um arquivo novo em creaturescripts chamado newvoc.lua e coloca isso ai local free = {1, 2, 3, 4} local prem = {5, 6, 7, 8} function onLogin(cid) if isPremium(cid) then for _, v in pairs(free) do if getPLayerVocation(cid) == v then doPlayerSetVocation(cid, getPLayerVocation(cid) + 4) end end else for k, i in pairs(prem) do if getPLayerVocation(cid) == i then doPlayerSetVocation(cid, getPLayerVocation(cid) - 4) end end end return true end no creaturescripts.xml coloca isso: <event type="login" name="LogVoc" event="script" value="newvoc.lua"/> no login.lua só registra isso: registerCreatureEvent(cid, "LogVoc") Não funcionou! Os players não conseguem logar após ativação desse script. Fica no connecting...
Postado Abril 28, 2017 8 anos function onLogin(cid) if isPremium(cid) then if getPLayerVocation(cid) == 1 or getPLayerVocation(cid) == 2 or getPLayerVocation(cid) == 3 or getPLayerVocation(cid) == 4 then doPlayerSetVocation(cid, getPLayerVocation(cid) + 4) end else if getPLayerVocation(cid) == 5 or getPLayerVocation(cid) == 6 or getPLayerVocation(cid) == 7 or getPLayerVocation(cid) == 8 then doPlayerSetVocation(cid, getPLayerVocation(cid) - 4) end end return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.