Slave Ots
LUA Newbie™
hello otlanders
it seems that there are no such script like that
and for this request: http://otland.net/f132/script-automaticly-gives-10-premium-points-first-10-logged-players-183274// i started working
this script give premium points for the first xx numbers of players to your server,
here we go
create new file and name it freeloginpoints.lua
in freeloginpoints.lua ;
then in data / creaturescripts / creaturescripts.xml put
last step in data / creaturesscripts / scripts / login.lua find
and add after it
now reload / open server and its ready to work
hope you ppl like it
Kind Regards
Slave Ots
it seems that there are no such script like that
and for this request: http://otland.net/f132/script-automaticly-gives-10-premium-points-first-10-logged-players-183274// i started working
this script give premium points for the first xx numbers of players to your server,
here we go
Code:
in data / creaturescripts / scripts
in freeloginpoints.lua ;
Code:
function onLogin(cid)
function onLogin(cid)
--authored by slave OTs____Sirion Mido's idea____for otLAnd.NeT
local free_points = 10
local players = 10 -- how much players shall it gives
local players_value = players - 1 -- dont edit this line
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 --put any empty storage for counting the ten times
local storage_2 = 15251 --empty storage for 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
then in data / creaturescripts / creaturescripts.xml put
Code:
<event type="login" name="freeloginpoints" event="script" value="freeloginpoints.lua"/>
last step in data / creaturesscripts / scripts / login.lua find
Code:
registerCreatureEvent(cid, "Mail")
and add after it
Code:
registerCreatureEvent(cid, "freeloginpoints")
now reload / open server and its ready to work
hope you ppl like it
Kind Regards
Slave Ots
Last edited: