Ir para conteúdo
  • 0

[Duvida]Premium


PsyMcKenzie

Pergunta

E ai galera, to tentando arrumar um script aqui pra um amigo meu, ele quer que quando o player receba os dias de premium, receba também uma promotion.

Tentei isso:

 

 

function onSay(cid, words, param) 
local t = string.explode(param, ",") 
local player = getPlayerByNameWildcard(t[1]) 
local premiumdays = tonumber(t[2]) 
     if (not t[1]) then 
     doPlayerSendCancel(cid, "You must fill with a player name.") 
     elseif (premiumdays < 0) then 
        doPlayerAddPremiumDays(player, premiumdays) 
        doPlayerSendTextMessage(cid,22,"You have removed " .. t[2] .. " premium days from " .. player .. ".") 
        doPlayerSendTextMessage(player,25,"You have lost " .. t[2] .. " premium days.") 
     elseif (premiumdays >= 1 and premiumdays < 150) then 
        doPlayerAddPremiumDays(player, premiumdays)
        doPlayerSetVocation(cid, getPlayerVocation(cid)+4)   
        doPlayerSendTextMessage(cid,22,"You have added " .. premiumdays .. " premium days from " .. getCreatureName(player) .. ".") 
        doPlayerSendTextMessage(player,25,"You received " .. premiumdays .. " premium days.")
     elseif (premiumdays > 0) then
     doPlayerSetVocation(cid, getPlayerVocation(cid)+4)       
    end
return TRUE 
end

 

Tentei adicionar aquela linha:

 

doPlayerSetVocation(cid, getPlayerVocation(cid)+4)

 

Mas não sei se fiz certo.

Quem puder ajudar.

Valew!!

Editado por PsyMcKenzie
Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

Dei Uma Editada Nele Nao Sei se vai funfar aki !! pq to sem ot no pc e muito ocupado se nao ate baixava pra testar

 

ate

 

function onSay(cid, words, param)

local t = string.explode(param, ",")

local player = getPlayerByNameWildcard(t[1])

local premiumdays = tonumber(t[2])

if (not t[1]) then

doPlayerSendCancel(cid, "You must fill with a player name.")

elseif (premiumdays < 0) then

doPlayerAddPremiumDays(player, premiumdays)

doPlayerSendTextMessage(cid,22,"You have removed " .. t[2] .. " premium days from " .. player .. ".")

doPlayerSendTextMessage(player,25,"You have lost " .. t[2] .. " premium days.")

elseif (premiumdays >= 1 and premiumdays < 150) then

doPlayerAddPremiumDays(player, premiumdays)

getPromotedVocation(voc) ---Poem O Id da Vocation

doPlayerSendTextMessage(cid,22,"You have added " .. premiumdays .. " premium days from " .. getCreatureName(player) .. ".")

doPlayerSendTextMessage(player,25,"You received " .. premiumdays .. " premium days.")

elseif (premiumdays > 0) then

doPlayerSetVocation(cid, getPlayerVocation(cid)+4)

end

return TRUE

end

Link para o comentário
Compartilhar em outros sites

  • 0

Se não funcionar dos geitos anteriormente ditos, tente assim:

function onSay(cid, words, param)
local t = string.explode(param, ",")
local player = getPlayerByNameWildcard(t[1])
local premiumdays = tonumber(t[2])
  if (not t[1]) then
  doPlayerSendCancel(cid, "You must fill with a player name.")
  elseif (premiumdays < 0) then
	 doPlayerAddPremiumDays(player, premiumdays)
	 doPlayerSendTextMessage(cid,22,"You have removed " .. t[2] .. " premium days from " .. player .. ".")
	 doPlayerSendTextMessage(player,25,"You have lost " .. t[2] .. " premium days.")
  elseif (premiumdays >= 1 and premiumdays < 150) then
	 doPlayerAddPremiumDays(player, premiumdays)
        if getPlayerPromotionLevel(cid) < 1 then
           setPlayerPromotionLevel(cid, 1)  
           doPlayerSendTextMessage(player,25,"You are promoted.")   
  	  end
	 doPlayerSendTextMessage(cid,22,"You have added " .. premiumdays .. " premium days from " .. getCreatureName(player) .. ".")
	 doPlayerSendTextMessage(player,25,"You received " .. premiumdays .. " premium days.")   
 end
return TRUE
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...