FE

/addpremium Como Adicionar?

Por fenix123, 13 de jul. de 2010 em Scripts

12
2.3k
fenix123F
13 de julho de 2010 às 17:25

ou galera, to presisando mt desse talkaction - /addpremium Nome, Dias

 

Alguem teria ai para me passar?

VodkartV
fenix123F
14 de julho de 2010 às 12:57

+ tpw, meu otserv e yorots 0.3.1, dai eu falo /addpremium Nome, Dias e da nada!

tyuahoiT
14 de julho de 2010 às 13:03

Tente Sem A virgula.

VodkartV
14 de julho de 2010 às 13:29

tpw eu testei aqui no servidor 8.60 e funciono

 

qual o erro que da?

 

talkactions: script

 

addp.lua

function onSay(cid, words, param)
local tmp = string.explode(param, ",")

local player = getPlayerByName(tmp[1])
local premiumdays = tonumber(tmp[2])

if isPlayer(player) ~= true then
doPlayerSendCancel(cid "Sorry, not possible.")
return TRUE
end
if premiumdays <= 0 or premiumdays == nil then
doPlayerSendCancel(cid, "Please, choose a number of premium days.")
return TRUE
end
doPlayerAddPremiumDays(player, premiumdays)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You received ".. premiumdays .." Premium Account from your account .. Enjoy all our advantages of a premium account ... Thanks. Relog your account please.")
return TRUE
end

 

 

talkactions.xml

 

        <talkaction access="3" words="/addpremium" script="addp.lua"/>

 

/addpremium Vodkart,5

fenix123F
14 de julho de 2010 às 14:09

Assim eu falo /addpremium Nome, Dias e fala que o comando nao existe tpw o cara fala e acontece nada. minha db e mysql.

Editado Julho 14 por Fenixlegion

joaohdJ
15 de julho de 2010 às 13:22

Usa a tag:

 

<talkaction words="/addpremium" access="3" event="script" value="addp.lua"/>

 

 

flw

fenix123F
15 de julho de 2010 às 21:03

Olha cara meu otserv e 8.4, eu usei essa tag + nao funfo ;x

joaohdJ
16 de julho de 2010 às 16:17

Tenta isso então:

 

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.")
     end

     if (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.")
     end

     if (premiumdays >= 1 and premiumdays < 150) then
        doPlayerAddPremiumDays(player, premiumdays)
        doPlayerSendTextMessage(cid,22,"You have added " .. premiumdays .. " premium days from " .. player .. ".")
        doPlayerSendTextMessage(player,25,"You received " .. premiumdays .. " premium days from " .. getCreatureName(cid) .. ".")      
    end
end

 

 

flw

fenix123F
16 de julho de 2010 às 18:42

Cara Vlw msm, Funfo ake xD...

 

VLWWW...

Editado Julho 17 por Fenixlegion

20 de julho de 2010 às 00:37

Dúvida sanada, tópico reportado.

 

Abraços.

20 de julho de 2010 às 11:31

Tópico Movido para a seção Pedidos Atendidos.