-
Posts
269 -
Joined
-
Last visited
Everything posted by fairyoggy
-
and if in the second case local msg = "[email protected]" How then to replace the letters with the characters before the character @
-
There is a text, for example, [email protected] Let's say local a = "[email protected]" How do I make the letters in front of the characters @ replaced by the character * I think need to create a variable B with the condition of replacing the letters before the character, but how to do it? was [email protected] has become *****@hotmail.com How to do it?
-
UID works just like a normal id. I’ll ask a little different. function fun1 () dbSecurityConnection = dbConnect( 'sqlite', 'accs.db') local getAnswerData = dbQuery( dbSecurityConnection, ' SELECT `email` FROM `accs` WHERE uid = ? ', 1 ) local result = dbPoll( getAnswerData, -1 ) local finduid = result[1].email outputChatBox ( ""..finduid.."" ) end addCommandHandler ( "tt", fun1 ) If I use this code, I use "1" in line local getAnswerData = dbQuery( dbSecurityConnection, ' SELECT `email` FROM `accs` WHERE uid = ? ', 1 ) I will get the output in chat: "mail.ru" if i use "2" in line local getAnswerData = dbQuery( dbSecurityConnection, ' SELECT `email` FROM `accs` WHERE uid = ? ', 2 ) i will get the output in chat: "dat.ru" It all works as planned BUT if i use "3" in line: local getAnswerData = dbQuery( dbSecurityConnection, ' SELECT `email` FROM `accs` WHERE uid = ? ', 3 ) As you can see on the screen of the database, there is no such line(with uid "3") A question: How can I make it so that when I type a non-existent UID in the database, I get an error in the chat NOT in code like this: I wanted to use something like this, but it not working: function fun1 () dbSecurityConnection = dbConnect( 'sqlite', 'accs.db') local getAnswerData = dbQuery( dbSecurityConnection, ' SELECT `email` FROM `accs` WHERE uid = ? ', 3 ) if getAnswerData then local result = dbPoll( getAnswerData, -1 ) local finduid = result[1].email outputChatBox ( ""..finduid.."" ) else outputChatBox ( "error" ) end end addCommandHandler ( "tt", fun1 )
-
It was just an example How to write it right? I need to know how to write a condition for checking in the database. need to check on the line "UID" on datebase and if this is not found then If in "uid" there will be such values as "1" and "2" how to work with other? I guess in the line "Limit 1" work is underway on this figure, but if it is in the database? I can be wrong, I have not worked with it yet. It is necessary that there is a check for "uid" and if this is not the case, then the method of exclusion In this case, there are no more digits 3 and above , but if appear "3" in uid how then to write correctly? Then there should be a check if This is in the database.
-
How do I implement the following action. There is a row in the database with the name "uid" How to check if there is no such UID then writes an error. Example: User type in edit UID "2" but it is not in the database, there is only "1" then The message appears with error. if user type in edit UID "1" then The message appears without error. --server dbSecurityConnection = dbConnect( 'sqlite', 'test.db') dbExec( dbSecurityConnection, ' CREATE TABLE if not exists `accs` (uid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, login) ' ) function date(uid, userlogin) dbExec( dbSecurityConnection, ' INSERT INTO `accs` VALUES(?, ? ) ', uid, userlogin) end
-
function givemins (player) local mins = getElementData(player,"mins") local res = getElementData(player,"respects") if mins == 60 then setElementData(player,"mins", -1) setElementData(player,"respects", (getElementData(player, "respects") or 0) +1) end setTimer( function() setElementData(player,"mins", (getElementData(player, "mins") or 0) +1) givemins() end, 1000, 1, root, source) end addCommandHandler ( "gg", givemins ) addEvent("givemins",true) addEventHandler("givemins",root,givemins) What am I doing wrong? and how to fix it? Need restart timer when the timer is over. The timer works, but after restart an error occurs.(that is, it works once without restart) 290 - local mins = getElementData(player,"mins") 291 - local res = getElementData(player,"respects") 298 - setElementData(player,"mins", (getElementData(player, "mins") or 0) +1)
-
Hello! Is it possible to limit shooting on an airplane hydra/hunter ? Without limitation, you can hold down the left mouse button and it will shoot endlessly. How to limit the number of shots?
-
One more question local test1 = 1 local test2 = 2 local test3 = 3 local ot = outputChatBox ( ""..ot.."" ) How to use random with this code? How do I make randomly choose one of the variables(test1 or test2 or test3) for "ot" ?
-
not working correctly, always output letter "G" but i need random from "bb" Example you type /ss and random output "B" next time maybe "C" and etc With your example, only the last letter is obtained "G"
-
How to use random for letters? function asd() bb = {"A", "B", "C", "F", "G"} for _, i in ipairs( bb ) do z = end outputChatBox ( ""..z.."" ) end addCommandHandler ( "ss", asd ) How to write correctly "z" for random from "bb"
-
Can you give me a working example for "email api" ?
-
I don’t understand how it works, can anyone help with this? So that the script code has a username and password from the email and this email will be send mail on other email.
-
Help! How to implement a script for sending emails? Something like: use in script login and password from e-mail and this email will be send mail on other email.
-
I have script for get real time: local minuteDelay = get ("realtime.minuteDelay") setMinuteDuration (minuteDelay) local hour = get ("realtime.initialHour") local minute = get ("realtime.initialMinute") function servetime () servertime = getRealTime () hours = (servertime.hour) minutes = string.format("%02d", servertime.minute) second = string.format("%02d", servertime.second) end setTimer (servetime, 1000, 0) local function onJoin() spawn(source) setTime (hours,minutes) end setting for this in meta: <settings> <setting name="*initialHour" value="0" friendlyname="Initial Hour" accept="0-23" desc="The hour that the game inits with when starting this resource." /> <setting name="*initialMinute" value="0" friendlyname="Initial Minute" accept="0-60" desc="The minute that the game inits with when starting this resource." /> <setting name="*minuteDelay" value="60000" friendlyname="Minute Delay" accept="0-9999000" desc="How much time does minutes delay its advance in miliseconds." /> </settings> I got what I wanted, but there is a problem with the seconds. Example: you start server in 11:33:55 and when in real time there will be 11:34:00 , will be on the server 11:33:05 It is necessary that the server would be the same (11:33:55 not 11:33:00) How to fix it?
-
@IIYAMA Can you give me example in code? I can’t understand how to use it correctly. I could only get this but how can i use it in my goal ? local time = getRealTime() local hours = time.hour local minutes = time.minute local seconds = time.second local duration = 10 local endtime = seconds + duration local curtime = hours..":"..minutes..":"..seconds local remaintime = endtime - curtime
-
For example, an account has a value: setAccountData (acc, "time", "10" ) How to make a timer on the server, by which in a minute this value will be "9" and after another 9 minutes it will become "0" Account must be offline
-
local health1 = getElementHealth(getPlayerFromName(player)) guiSetText(label1, "HP: "..health1.. " %") How to change digit display format? Now display like this but how to make that there would be a maximum of 2 digits after the decimal point 26.39 %
-
if current user try to login in account which was registered from another serial I get this error in the console How can I remove this error and allow authorization ?
-
How to ban a player if he is not on the server? GetAccountByID I can ban a player by parameter "player" but how to ban by parameter "account" ?
-
@#,xiRocKyz local zifr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0} addEventHandler("onClientGUIChanged", editMoney, function(element) local chars = table.concat(zifr, ""):gsub("[%(%)%.%%%+%-%*%?%[%^%$]", "%%%1") local editText = guiGetText(editMoney) local replacedText = editText:gsub("["..chars.."]", "") if editText == replacedText then guiSetText(source, "") playSoundFrontEnd(2) end end) Used your example. If you type numbers(zifr) into the edit. numbers are displayed - fine If you use other characters, the characters will not be displayed and sound will be played. - fine BUT If you type "1A" , "213FSDFSFS" and etc - It will work. How to fix it? Other characters except "zifr" should not be displayed
-
I just tried to make for login panel, for input fields,label which would determine which language is selected in the Windows language bar
-
How to do it when you write in guiEdit, for example, the character "A" and it is not written?
