• 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!

Ver. 0.1.0 - Gesior ITEM/PACC Shop (PHP+LUA) for TFS

Compatibilty with TFS 0.3 :(

On TFS the login.lua seems to be not working because they don't recieve the Orange Message anymore (You recieved >>x)
I posted 2 LUA scripts, for TFS 0.2.6 - 0.2.13 and for TFS 0.3 If you use TFS 0.3 and my script doesn't work try with LUA script for 0.2.x
 
Geisor. I really appreciate this script and it helped me alot. but can you help me make the buy points possible.

like, im trying to make an npc script that takes money and adds points to the accounts > premium_points. option. but its not working.
 
Geisor. I really appreciate this script and it helped me alot. but can you help me make the buy points possible.

like, im trying to make an npc script that takes money and adds points to the accounts > premium_points. option. but its not working.
TFS 0.3 or TFS 0.2.13 npc? You must know LUAsql or new method to connect to database if you use TFS 0.3. I can make function to add points for you.
If you use TFS 0.3 rev. 840+ add this at end of .../data/functions.lua file:
Code:
function addPremiumPoints(cid, value)
	local player_account_id = db.getResult("SELECT `account_id` FROM `players` WHERE `name` = " .. db.escapeString(getCreatureName(cid)) .. ";")
	if(player_account_id:getID() ~= -1) then
		local account_id =  player_account_id:getDataInt("account_id")
		player_account_id:free()
		local player_account = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. account_id .. ";")
		if(player_account:getID() ~= -1) then
			local setpoints = player_account:getDataInt("premium_points") + value
			db.executeQuery("UPDATE `accounts` SET `premium_points` = " .. setpoints .. " WHERE `id` = " .. account_id .. ";")
			player_account:free()
			return TRUE
		end
	end
	return FALSE
end
return TRUE if changed premium days value
return FALSE if not
Use in talkaction:
Code:
function onSay(cid, words, param)
	if getPlayerMoney(cid) >= 5000 then
		if addPremiumPoints(cid, 10) == TRUE then
			doPlayerRemoveMoney(cid, 5000)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received 10 premium points for 5000gp.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error ocurred you don't receive 10 points.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "10 points cost 5000 gp, you don't have enought money.")
	end
end
(tested on TFS 0.3 rev. 900)
 
Last edited:
Gesior i have prob hehehehe

look img
You use TFS with "old" (use in 0.2.x) LUA connection to SQL. Use version of LUA script for "IF YOU USE TFS 0.2.9, 0.2.10, 0.2.11, 0.2.12, 0.2.13 OR TFS 0.3 REV. 815:"
Old TFS 0.3 use SQL connection like 0.2.13.
 
Last edited:
hey, add mny msn please [email protected] I need help, I got a question: Can you make a thing with paypal or something that you can buy points for real cash then buy items by that coin? :)
 
Gesior if you would like to learn how to use paypal i could help you.. i know how to sign up for and account and create the button you push to buy an item...

Not sure if you buy the points it adds it though... wana try and work thorugh it...?
 
I have a problem, i followed all your install steps but now:

Admin must put his SMS to Points script in file buypoints.php


where is buypoints.php?
 
Hello,
look:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/login.lua: onLogin

data/creaturescripts/scripts/login.lua:63: attempt to compare string with number
stack traceback:
data/creaturescripts/scripts/login.lua:63: in function <data/creaturescripts/scripts/login.lua:17>
This message are in console, when items give for player, buy dont give item for player
 
You use TFS with "old" (use in 0.2.x) LUA connection to SQL. Use version of LUA script for "IF YOU USE TFS 0.2.9, 0.2.10, 0.2.11, 0.2.12, 0.2.13 OR TFS 0.3 REV. 815:"
Old TFS 0.3 use SQL connection like 0.2.13.

if I use the script that there appears 1 closes the server.
And I use the 2 ° the server error occurs that the image.

I do not know what may have an idea?


hummm i compile 815+
 
Warning: Error parsing c:/xxxxx/config.lua on line 33 in C:\xampp\htdocs\shopsystem\config-and-functions.php on line 6
Database error. Unknown database type in c:/xxxxx/config.lua . Must be equal to: "mysql" or "sqlite". Now is: ""

i get this error :S
can some1 help me x.x?
 
Warning: Error parsing c:/xxxxx/config.lua on line 33 in C:\xampp\htdocs\shopsystem\config-and-functions.php on line 6
Database error. Unknown database type in c:/xxxxx/config.lua . Must be equal to: "mysql" or "sqlite". Now is: ""

i get this error :S
can some1 help me x.x?

Seems like you enter bad location to your config.lua folder, try to delete all "green" text (comments).
 
Thankyou Gesior for the talkaction, will test as soon as I can restart my server to update the functions. ;p and btw i use 3.0 not sure which revision, i compiled it recently though, it should work.
 
i have this problem
Code:
[11/07/2008  18:23:46] Lua Script Error: [CreatureScript Interface] 
[11/07/2008  18:23:46] in a timer event called from: 
[11/07/2008  18:23:46] data/creaturescripts/scripts/login.lua:onLogin

[11/07/2008  18:23:46] data/creaturescripts/scripts/login.lua:50: attempt to call global 'getItemWeight' (a nil value)
[11/07/2008  18:23:46] stack traceback:
[11/07/2008  18:23:46] 	data/creaturescripts/scripts/login.lua:50: in function <data/creaturescripts/scripts/login.lua:17>
plx help me

and please give me script "Points for SMS"
 
Back
Top