• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Windows each new account gets 130 points

Cristian2387

New Member
Joined
Oct 2, 2014
Messages
34
Reaction score
0
Hi, i need help with a script, i want a script that gives 130 shop points to all accounts even the new ones so players can use them to buy items in shop. its like every time someone creates an account, the account gets 130 points thank you
 
With SQL run this query to give all accounts 130 points
Code:
 UPDATE `accounts` SET `premium_points`= `premium_points` + 130
and to make it default to 130 use this SQL query
Code:
 ALTER TABLE `accounts`CHANGE`premium_points``premium_points`INT(11) NOT NULL DEFAULT '130';
 
Last edited:
Change sample chars if you want it when the player is created. You can also do it via your login.lua script.
 
With SQL run this query to give all accounts 130 points
Code:
 UPDATE `accounts` SET `premium_points`= `premium_points` + 130
and to make it default to 130 use this SQL query
Code:
 ALTER TABLE[/URL]`accounts`CHANGE`premium_points``premium_points`INT(11) NOT NULL DEFAULT '130';
hi, i tried it and i got this error : #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[/URL]`accounts`CHANGE`premium_points``premium_points`INT(11) NOT NULL DEFAULT '' at line 1
 
My bad. remove "[/url]" from the SQL line
now im getting this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INT(11) NOT NULL DEFAULT '130'' at line 1.
i think i have to change something in my config i dont know im not sure
 
With SQL run this query to give all accounts 130 points
Code:
 UPDATE `accounts` SET `premium_points`= `premium_points` + 130
and to make it default to 130 use this SQL query
Code:
 ALTER TABLE `accounts`CHANGE`premium_points``premium_points`INT(11) NOT NULL DEFAULT '130';
im going to try to use this
Code:
local points = 130 -- amount of premium points

function onLogin(cid)
if isPlayer(cid) == TRUE then
local Sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
db.executeQuery(Sql)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 130 Premium Point")
end
return true
end
 
now im getting this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INT(11) NOT NULL DEFAULT '130'' at line 1.
i think i have to change something in my config i dont know im not sure
sometimes u just need to read http://www.w3schools.com/sql/sql_alter.asp
 
thank you, ill read it hopefully i learn something that will help me how to resolve my problem
Strange, this is the code generated by phpmyadmin when i changed the default value of premium points o.O


im going to try to use this
Code:
local points = 130 -- amount of premium points

function onLogin(cid)
if isPlayer(cid) == TRUE then
local Sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
db.executeQuery(Sql)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You Have Received 130 Premium Point")
end
return true
end

also this code will run every time a player logs in, so he can exploit it for infinite points.

get 130 points -> buy stuff -> relog -> get 130 points -> repeat
 
Strange, this is the code generated by phpmyadmin when i changed the default value of premium points o_O




also this code will run every time a player logs in, so he can exploit it for infinite points.

get 130 points -> buy stuff -> relog -> get 130 points -> repeat
okay so this is what i ended up doing, i put this script that gives premium points to the first players that enter the server, i edited the script a little bit and this is the end result
Code:
 function onLogin(cid)
local free_points = 130
local players = 500 -- 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

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. Thanks for playing Hero Biba.')
for _, ePos in ipairs(effectPositions) do
        doSendDistanceShoot(ePos, pos, 30)
    doSendAnimatedText(pos, "+130 Premium 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
lol i put 500 because i know that 500 people are not going to go play in my server so is basically never going to end thanks for the help =)
 
Back
Top