Ir para conteúdo

Players Que Logarem Ganham Pontos


LuckinhaSan

Posts Recomendados

Este script da uma quantidade a sua escolha de pontos

aos players do seu server quando logar pela primeira vez.

 

Vamos lá!

 

Vá em data/creaturescripts/scripts, copie um arquivo .lua e renomeie para freeloginpoints.lua, adicione isso -

 

function onLogin(cid)
function onLogin(cid)
--authored by slave OTs____Sirion Mido's idea

local free_points = 10
local players = 10 -- quantidade de players que vao ganhar
local players_value = players - 1  -- nao edite esta linha
local pos = getPlayerPosition(cid)
local effectPositions = { -- dont edit
{x = pos.x - 5, y = pos.y - 5, z = pos.z},
{x = pos.x + 5, y = pos.y - 5, z = pos.z},
{x = pos.x + 5, y = pos.y + 5, z = pos.z},
{x = pos.x - 5, y = pos.y + 5, z = pos.z},
{x = pos.x, y = pos.y - 4, z = pos.z},
{x = pos.x, y = pos.y + 4, z = pos.z},
{x = pos.x - 4, y = pos.y, z = pos.z},
{x = pos.x + 4, y = pos.y, z = pos.z},
{x = pos.x - 4, y = pos.y - 4, z = pos.z},
{x = pos.x + 4, y = pos.y - 4, z = pos.z},
{x = pos.x + 4, y = pos.y + 4, z = pos.z},
{x = pos.x - 4, y = pos.y + 4, z = pos.z}
}
local storage_1 = 15253   --colocar qualquer storage vazia
local storage_2 = 15251   --storage vazia para players
local function doPlayerAddPremiumPoints(cid, points)
return db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..points.." WHERE `id` = "..getPlayerAccountId(cid)..";")
end

------[END OF CONFIGS]-------only you need to edit the upper configs and the script will be ok
if isPlayer(cid) then
if getGlobalStorageValue(storage_1) < players_value then
if getCreatureStorage(cid, storage_2) < 0 then
doPlayerAddPremiumPoints(cid, free_points)
doPlayerSendTextMessage(cid, 19, 'you have been rewarded with ' .. free_points .. ' premium points. for being one of the first records here')
for _, ePos in ipairs(effectPositions) do
doSendDistanceShoot(ePos, pos, 30)
doSendAnimatedText(pos, "[+10 Points]", 180)
doSendAnimatedText(pos, "[+10 Points]", 180)
doSendAnimatedText(pos, "[+10 Points]", 180)
doSendAnimatedText(pos, "[+10 Points]", 180)
doSendAnimatedText(pos, "[+10 Points]", 180)
doSendAnimatedText(pos, "[+10 Points]", 180)
doSendAnimatedText(pos, "[+10 Points]", 180)
doSendDistanceShoot(ePos, pos, 30)
end
doCreatureSetStorage(cid, storage_2, 1)
setGlobalStorageValue((storage_1), getGlobalStorageValue(storage_1) +1)
end
end
end
return true
end

 

 

Em creturescripts.xml, adicione a tag -

<event type="login" name="freeloginpoints" event="script" value="freeloginpoints.lua"/>

 

Ainda na pasta creturescripts/scripts, abra login.lua, procure por -

registerCreatureEvent(cid, "Mail")

 

Abaixo dele, adicione isso -

registerCreatureEvent(cid, "freeloginpoints")

 

Espero que gostem!

Créditos - Slave

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

×
×
  • Criar Novo...