So there is a thing - I'm creating an anti-swear skript for czech server, aaaand that means we have swears with special letters as ř/č/á etc etc
And there I want to save these to MYSQL. Pretty simple. Well when I'm adding and removing swears, everything is okay, words keep adding to database. But there comes the problem.
Let's say I have word rohlik (not a swear word, just example). In our language, correct writing is "rohlík" (there is í instead of i), but I want in database both variants (since not everyone here uses diacritics in minecraft). So I added "rohlik" into the database and now I want to add "rohlík" and there is problem - it says it is already added. But when I type in in chat, it doesn't blank it. So I'm thinking that main problem is that when it checks database, it for some reason ignores the diacritics and instead of "rohlík" it reads as "rohlik". How can I prevent this?
Code of add swear:
Code of chat censoring system:
Also, when I add it manually via phpmyadmin, it works and blanks the word successfully, but when I disable swear words, it replaces both values with value in command (so /chat123 removeswear rohlík sets "enabled" to false in database, but it also replaces the collumn "value" in database, so before command there was rohlik and rohlík, now it is two rohlík)
Skript version: Skript ver. 2.2-dev27
Server version: spigot 1.8.8
Addons using: SkQuery 3.21.4
I have multiple skripts running on server using mysql same as in my code, and there is no problem.
Before end - sure, I can add words manually via phpmyadmin, but i think it is more comfortable via command and if there is way to get this working... well I want it
thanks for every help message
[doublepost=1559504113,1558542891][/doublepost]^
And there I want to save these to MYSQL. Pretty simple. Well when I'm adding and removing swears, everything is okay, words keep adding to database. But there comes the problem.
Let's say I have word rohlik (not a swear word, just example). In our language, correct writing is "rohlík" (there is í instead of i), but I want in database both variants (since not everyone here uses diacritics in minecraft). So I added "rohlik" into the database and now I want to add "rohlík" and there is problem - it says it is already added. But when I type in in chat, it doesn't blank it. So I'm thinking that main problem is that when it checks database, it for some reason ignores the diacritics and instead of "rohlík" it reads as "rohlik". How can I prevent this?
Code of add swear:
Code:
#ano=true, no=false
else if arg-1 is "addswear":
if player has permission "chat123.addswear":
if arg-2 is not set:
send "&cPoužití: /chat123 addswear <slovo>"
else:
set {_wordisinmysql1::*} to objects in column "enabled" from result of query "SELECT `enabled` FROM `swearwords` WHERE `value` = '%arg-2%'"
set {_wordisinmysql} to first element out of {_wordisinmysql1::*}
if {_wordisinmysql} is not set:
update "INSERT INTO `swearwords` (`enabled`, `value`) VALUES ('ano', '%arg-2%');"
send "&aSlovo &b%arg-2% &abylo přidáno na seznam zakázaných slov!"
else if {_wordisinmysql} is "ano":
send "&cSlovo &b%arg-2% &cjiž je na seznamu zakázaných slov!"
else if {_wordisinmysql} is "ne":
update "UPDATE `swearwords` SET `enabled` = 'ano' WHERE `value` = '%arg-2%';"
send "&aSlovo &b%arg-2% &abylo opět přidáno na seznam zakázaných slov!"
else:
send "&cNope."
Code of chat censoring system:
Code:
set {_swears::*} to objects in column "value" from result of query "SELECT `value` FROM `swearwords` WHERE `enabled` = 'ano'"
loop {_swears::*}:
if {_message} contains "%loop-value%":
replace "%loop-value%" with "**" in {_message}
Also, when I add it manually via phpmyadmin, it works and blanks the word successfully, but when I disable swear words, it replaces both values with value in command (so /chat123 removeswear rohlík sets "enabled" to false in database, but it also replaces the collumn "value" in database, so before command there was rohlik and rohlík, now it is two rohlík)
Skript version: Skript ver. 2.2-dev27
Server version: spigot 1.8.8
Addons using: SkQuery 3.21.4
I have multiple skripts running on server using mysql same as in my code, and there is no problem.
Before end - sure, I can add words manually via phpmyadmin, but i think it is more comfortable via command and if there is way to get this working... well I want it
thanks for every help message
[doublepost=1559504113,1558542891][/doublepost]^