antiblock
Elveron
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
Cαllмєσfficiαl

Nova Function Pc.get_Coins() Y Pc.change_Coins()

4 posts in this topic

Hey guys, eu trago dois recursos para mini-quest, você precisa colocar a busca mysql, mas agora quase todos são assim eu não acho problema.

 

As funções são os seguintes:

pc.change_coins(x)


 

function pc.change_coins(x)	mysql_query("UPDATE account.account SET coins=coins+'"..x.."' WHERE id='"..pc.get_account_id().."' LIMIT 1")end
 
Ele permite que você remova moedas ao usuário, por exemplo:

quest cupon_md_1000 begin	state start begin		when idcupon.use begin			pc.change_coins(1000)		end	endend	
 
Para subtrair basta adicionar - antes do número pc.change_coins(-100)

pc.get_coins()
function pc.get_coins()             local a = mysql_query("select * from account.account where id ='"..pc.get_account_id().."' LIMIT 1")             return a.coins[1] end 

 

Permite de ver quantas moedas vc tem

quest consulta_coins begin	state start begin		when login begin			if pc.get_coins() < 100 then				say("Tens menos de 100 coins")			else				say("Tens mais de 100 Coins")			end		end	endend	

Créditos : Rafa

 

 


 

Share this post


Link to post
Share on other sites
antiblock
https://i.imgur.com/aJ17bf7.gif

mas os coins sao yang ou moedas do site?

Share this post


Link to post
Share on other sites
quest consulta_coins begin	state start begin		when login begin			if pc.get_coins() < 100 then				say("Tens menos de 100 coins")			else				say("Tens mais de 100 Coins")			end		end	endend	
 

 

 

 

Share this post


Link to post
Share on other sites

É possível meteres aqui a Query ou um Tutorial qualquer dos vouchers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this