Jump to content

[ Dead Download Link ] [RELEASE] Shop with the new currency [ We Need You ]


Recommended Posts

  • 2 weeks later...

This quest is with mysql:

quest achievement begin
	state start begin
		function getcoins()
			local a = mysql_query("SELECT * FROM player.player WHERE id = "..pc.get_player_id().."")
			return a.coins[1]
		end
		function addcoins(coins_ammount)
			local a = mysql_query("UPDATE player.player SET coins = coins+"..coins_ammount.." WHERE id = "..pc.get_player_id().."")	
		end
		function removecoins(coins_ammount)
			local a = mysql_query("UPDATE player.player SET coins = coins-"..coins_ammount.." WHERE id = "..pc.get_player_id().."")	
		end		
		function buy(id,count)
			pc.give_item2(id,count)
		end		
		when 20095.chat."Sklep Osiagniec " begin
			cmdchat("SetIsNpc")
			npc.open_shop(16)
			setskin(NOWINDOW)
			cmdchat("SetPrice 200|200|200|200|200|0|0|100|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0")
		end
		when login begin
			cmdchat("SetQuestIndex "..q.getcurrentquestindex())
			cmdchat("setPP "..tonumber(achievement.getcoins()))
		end
		when button or info begin
			local items = {
				[0]={71124, 1, 200},
				[1]={71125, 1, 200},
				[2]={71126, 1, 200},
				[3]={71127, 1, 200},
				[4]={71128, 1, 200},
			}
			local slot = tonumber(achievement.GetInput("GetInput"))
			if achievement.getcoins() >= items[slot][3] then
				achievement.removecoins(tonumber(items[slot][3]))
				cmdchat("setPP "..tonumber(achievement.getcoins()))
				achievement.buy(items[slot][1], items[slot][2])
			else
				cmdchat("NieMamPP")
			end
		end
		function GetInput(value)
			cmdchat("GetInputStart")
			local ret = input(cmdchat(value))
			cmdchat("GetInputStop")
			return ret
		end
	end
end

 

Use console to add this to player.player

ALTER TABLE player.player ADD coins int(11) NOT NULL;

*Not tested*

  • Love 2
Link to comment
Share on other sites

Hi i was trying add this system and get this syserr clientside.

 

Crash after login screen when  will show my characther to login.

0423 09:04:08134 :: 
networkModule.py(line:194) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:23) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiAffectShower.py(line:8) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:expected an indented block (line 546)

0423 09:04:08134 :: ============================================================================================================
0423 09:04:08134 :: Abort!!!!

I tried check after which file this start happen and then i take this conclusion.

inventorywindows.py: OK

constinfo.py: OK

uishop.py(uploaded by Sanchez): when i try shop haven't any tooltip.

game.py: stop on loading screen to join ingame after character select.

uitooltip.py: crash after login

uiinventory.py: crash after login

 

thats all i think.

sry for the low knowledge to give more information.

 

Link to comment
Share on other sites

You had syntax errors everywhere, but check it now:

This is the hidden content, please

 

Thanks Sanchez. Now i will compare both files to see where was my errors.

 

 

-----EDIT-----

 

 

Crash after login Sanchez. and get this syserr.

0424 08:58:05465 ::
networkModule.py(line:194) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:28) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:14) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 475)

0424 08:58:05465 :: ============================================================================================================
0424 08:58:05465 :: Abort!!!!

 

Link to comment
Share on other sites

Same syserr. Only change the line error now to 503

0424 11:14:06732 ::
networkModule.py(line:194) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:28) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:14) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 503)

0424 11:14:06732 :: ============================================================================================================
0424 11:14:06732 :: Abort!!!!


Link to comment
Share on other sites

This quest is with mysql:

quest achievement begin
	state start begin
		function getcoins()
			local a = mysql_query("SELECT * FROM player.player WHERE id = "..pc.get_player_id().."")
			return a.coins[1]
		end
		function addcoins(coins_ammount)
			local a = mysql_query("UPDATE player.player SET coins = coins+"..coins_ammount.." WHERE id = "..pc.get_player_id().."")	
		end
		function removecoins(coins_ammount)
			local a = mysql_query("UPDATE player.player SET coins = coins-"..coins_ammount.." WHERE id = "..pc.get_player_id().."")	
		end		
		function buy(id,count)
			pc.give_item2(id,count)
		end		
		when 20095.chat."Sklep Osiagniec " begin
			cmdchat("SetIsNpc")
			npc.open_shop(16)
			setskin(NOWINDOW)
			cmdchat("SetPrice 200|200|200|200|200|0|0|100|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0")
		end
		when login begin
			cmdchat("SetQuestIndex "..q.getcurrentquestindex())
			cmdchat("setPP "..tonumber(achievement.getcoins()))
		end
		when button or info begin
			local items = {
				[0]={71124, 1, 200},
				[1]={71125, 1, 200},
				[2]={71126, 1, 200},
				[3]={71127, 1, 200},
				[4]={71128, 1, 200},
			}
			local slot = tonumber(achievement.GetInput("GetInput"))
			if achievement.getcoins() >= items[slot][3] then
				achievement.removecoins(tonumber(items[slot][3]))
				cmdchat("setPP "..tonumber(achievement.getcoins()))
				achievement.buy(items[slot][1], items[slot][2])
			else
				cmdchat("NieMamPP")
			end
		end
		function GetInput(value)
			cmdchat("GetInputStart")
			local ret = input(cmdchat(value))
			cmdchat("GetInputStop")
			return ret
		end
	end
end

 

Use console to add this to player.player

ALTER TABLE player.player ADD coins int(11) NOT NULL;

*Not tested*

The inventory shows 1234567, any solution?

Link to comment
Share on other sites

 

The inventory shoes 1234567, any solution?

 

 

 

I had the same problem, have you got any errors in sysser (i mean errors with wrong command in client or sth)?If yes you must do sth wrong in servercommandlist in game, but  if no; the problem is in the quest, my looks little bit different e.g 

function getcoins()
			local a = mysql_query("SELECT coins from player.player WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
			a = tonumber(a)
			return a
		end
cmdchat("setPP"..achievementy.getcoins())
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.