Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using it in function #11

Open
DevilishDante opened this issue Dec 6, 2018 · 10 comments
Open

Problem using it in function #11

DevilishDante opened this issue Dec 6, 2018 · 10 comments

Comments

@DevilishDante
Copy link

DevilishDante commented Dec 6, 2018

hello, i cannot use skript-db in function in deed when i try this

	if {_player}'s inventory contains 100 emerald:
		execute unsafe "UPDATE `Cle_1` SET `Cle_1`.`Quantité` = `Quantité`+1 WHERE `Cle_1`.`UUID` = %{_uuid}%" in {SqlFarm}
		send "{@PCShopSurvie2}Vous venez &ad'acheter&f une &8✥ &7Clé Commune &8✥ {@PCShopSurvie2}" to {_player}
		remove 100 emerald from {_player}'s inventory
	else:
		send "{@PCShopSurvie}Vous n'avez &cpas assez d'émeraude&r pour acheter ceci ! {@PCShopSurvie}" to {_player}

Without sql line work perfectly but with it skript do nothing , literaly nothing, i don't have any error in console or when i reload thanks for reading me

@btk5h
Copy link
Owner

btk5h commented Dec 6, 2018

Does the line work outside of a function?

@DevilishDante
Copy link
Author

Does the line work outside of a function?

hello, yes work perfectly

PS: sorry if my english isn't perfect i'm french and i don't speak english every day u.u

@btk5h
Copy link
Owner

btk5h commented Dec 6, 2018

Try using skript-mirror instead of using functions. Skript functions don't really play nicely with asynchronous effects.

@DevilishDante
Copy link
Author

skript-mirror??

@btk5h
Copy link
Owner

btk5h commented Dec 6, 2018

Yes, the documentation for custom effects is here. Try using that instead of using a function.

@DevilishDante
Copy link
Author

hmm ok it seems a litle bit hard to learn this but i try :s

@TestingUser661
Copy link

Hey. Is there an update on this?
Maybe make a config "sql in functions", because some people have hundreds of functions that have to be changed.

@btk5h
Copy link
Owner

btk5h commented Apr 13, 2019

Hey. Is there an update on this?
Maybe make a config "sql in functions", because some people have hundreds of functions that have to be changed.

This is simply not possible since Skript does not support this. Your only option is to use something that does support async effects, like custom effects.

@TestingUser661
Copy link

Skript does not support what? If you could make it an config option, some people could have lots of time saved. Not everyone can change hundreds of functions to custom effects

@btk5h
Copy link
Owner

btk5h commented Apr 17, 2019

Skript does not support what? If you could make it an config option, some people could have lots of time saved. Not everyone can change hundreds of functions to custom effects

Functions are not allowed to contain waits. SQL effects behave as waits so that they do not freeze your server while the request is being executed.

If this is a feature that you need, a fix has to be made on Skript's side, not skript-db's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants