-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
.. Really? They're 2 different languages, Lua and C! Yeah right, we now got visual basic functions in lua. They're just similar in coding.
-
Thanks!, i'll try it soon.
-
There's no value set yet, thats why i want to use insert into. How can i make this work with insert into??
-
It might be disabled aswell as os functions library, maybe for security reasons.
-
How can i do the "?" thing?
-
Bump i need help, this is driving me mad, i dont get why it does not work. output: ~HyPeX~: a restart: Resource restarting... *AS: Saving 1 records from sqlite. table 0 0 table 0 string number number number number string string string F27CCCFAB293B848763C115C76C09442 0 0 0 0 ~HyPeX~ AntiSpam None dbPoll failed. Error code: 1 Error message: near "~": syntax error Code: unction SaveDownOnResourceStop(resource) if resource ~= getThisResource() then return end outputChatBox("#6969C9*AS: Saving "..table.size(Punished).." records from sqlite.", root, 255,255,255,true) for i, v in pairs(Punished) do local exec = dbQuery(Database, "DROP TABLE IF EXISTS "..v[2]) local aresult, num_affected_rows, last_insert_id = dbPoll(exec, -1) outputChatBox(type(aresult)) outputChatBox(table.size(aresult)) local query = dbQuery(Database, "CREATE TABLE "..v[2].." (Serial varchar, Punishes int, StartTime int, EndTime int, Duration int, PlayerName varchar, ResponsibleName varchar, Reason varchar );") local bresult, num_affected_rows, last_insert_id = dbPoll(query, -1) outputChatBox(table.size(bresult)) outputChatBox(type(bresult)) outputChatBox(num_affected_rows) for i,v in pairs(bresult) do outputChatBox(type(v)) end outputChatBox(type(v[2]).." "..type(v[1]).." "..type(v[3]).." "..type(v[4]).." "..type(v[5]).." "..type(v[6]).." "..type(v[7]).." "..type(v[8])) outputChatBox((v[2]).." "..(v[1]).." "..(v[3]).." "..(v[4]).." "..(v[5]).." "..(v[6]).." "..(v[7]).." "..(v[8])) local dataSaving = dbQuery(Database, "INSERT INTO "..v[2].." (Serial, Punishes, StartTime, EndTime, Duration, PlayerName, ResponsibleName, Reason) VALUES ("..v[2]..","..v[1]..","..v[3]..","..v[4]..","..v[5]..","..v[6]..","..v[7]..","..v[8]..")") local cresult, num_affected_rows, last_insert_id = dbPoll(dataSaving, -1) local error_code,error_msg = num_affected_rows,last_insert_id outputConsole( "dbPoll failed. Error code: " .. tostring(error_code) .. " Error message: " .. tostring(error_msg) ) end end addEventHandler("onResourceStop", resourceRoot, SaveDownOnResourceStop)
-
Hey guys, i do not understand this error: (cresult) dbPoll failed; near "~": syntax error. function SaveDownOnResourceStop(resource) if resource ~= getThisResource() then return end outputChatBox("#6969C9*AS: Saving "..table.size(Punished).." records from sqlite.", root, 255,255,255,true) for i, v in pairs(Punished) do local exec = dbQuery(Database, "DROP TABLE IF EXISTS "..v[2]) local aresult = dbPoll(exec, -1) local query = dbQuery(Database, "CREATE TABLE "..v[2].." (Serial varchar, Punishes int, StartTime int, EndTime int, Duration int, PlayerName varchar, ResponsibleName varchar, Reason varchar );") local bresult = dbPoll(query, -1) for i,v in pairs(result) do outputChatBox(type(v)) end local dataSaving = dbQuery(Database, "INSERT INTO "..v[2].." (Serial, Punishes, StartTime, EndTime, Duration, PlayerName, ResponsibleName, Reason) VALUES ("..v[2]..","..v[1]..","..v[3]..","..v[4]..","..v[5]..","..v[6]..","..v[7]..","..v[8]..")") local cresult = dbPoll(dataSaving, -1) end end addEventHandler("onResourceStop", resourceRoot, SaveDownOnResourceStop) EDIT: ERROR Return: dbPoll failed. Error code: 1 Error message: near "~": syntax error EDIT2: Went even more into the trouble, and outputed some values: ~HyPeX~: a string number number number number string string string F27CCCFAB293B848763C115C76C09442 0 0 0 0 ~HyPeX~ AntiSpam None from: outputChatBox(type(v[2]).." "..type(v[1]).." "..type(v[3]).." "..type(v[4]).." "..type(v[5]).." "..type(v[6]).." "..type(v[7]).." "..type(v[8])) outputChatBox((v[2]).." "..(v[1]).." "..(v[3]).." "..(v[4]).." "..(v[5]).." "..(v[6]).." "..(v[7]).." "..(v[8]))
-
Bump, anyone knows whats going on?
-
Ineeded, interpolateBetween is your best friend at doing animations once you've mastered it. It is an interpolate between any values, if you only want one, just place 0 in the remaining places. (150,0,0,200,0,0)
-
Im not sure that the % one will work, mine will work perfectly. (Already tested it)
-
What do you mean? create a window and make it appear from the bottom? mainly for any animation you'd need: interpolateBetweeen setTimer onClientRender I myself found a clever way to make a dashboard with moving images, if you want the code PM me. It was made kind in this way http://activeden.net/item/xml-horizonta ... iew/127714
-
Try changing this if playerHealth > 15 then setElementHealth ( source, playerHealth - 500 ) end into this killPed(source) PD: You must also move this event server-side. There's no problem in doing that.
-
Tbh, i never used guieditor myself (though i will try it soon to make my small script project gui), not even for creating a small userpanel/login panel.
-
Yes, i didnt managed to want to edit the topic, i was fixing it on my side, i found a problem now, the length of table is returning 0.. and i dont know why. local loadUpTable = {} function LoadUpOnResourceStart(resource) if resource ~= getThisResource() then return end local dbqery = dbQuery(Database, "SELECT name FROM sqlite_master WHERE type='table'") local tables = dbPoll(dbqery, -1) outputChatBox("#6969C9*AS: Restoring "..#tables.." records from sqlite.", root, 255,255,255,true) local start = 0 for i,v in ipairs(tables) do start = start+1 for column, value in pairs(v) do loadUpTable[start] = value end end for i,v in ipairs(loadUpTable) do local Query = dbQuery(Database, "SELECT * FROM "..loadUpTable[i]) local result = dbPoll(Query, -1) outputChatBox(#result) for i,v in pairs(result) do outputChatBox(v) for col,val in ipairs(v) do outputChatBox(val) end end end end addEventHandler("onResourceStart", resourceRoot, LoadUpOnResourceStart)
-
Well, i get error: trying to concatenate field (?) a nil value. This happens on the dbQuery "SELECT * FROM "..loadUpTable[1] line. local loadUpTable = {} function LoadUpOnResourceStart(resource) if resource ~= getThisResource() then return end local dbqery = dbQuery(Database, "SELECT name FROM sqlite_master WHERE type='table'") local tables = dbPoll(dbqery, -1) outputChatBox("#6969C9*AS: Restoring "..#tables.." records from sqlite.", root, 255,255,255,true) for i=1,#tables do loadUpTable[i] = tables[i] end for i,v in ipairs(loadUpTable) do local Query = dbQuery(Database, "SELECT * FROM "..loadUpTable[i][1]) local result = dbPoll(Query, -1) Punished[ loadUpTable[i] ] = {} Punished[ loadUpTable[i] ][1] = result.Punishes[1] Punished[ loadUpTable[i] ][2] = result.Serial[1] Punished[ loadUpTable[i] ][3] = result.StartTime[1] Punished[ loadUpTable[i] ][4] = result.EndTime[1] Punished[ loadUpTable[i] ][5] = result.Duration[1] Punished[ loadUpTable[i] ][6] = result.PlayerName[1] Punished[ loadUpTable[i] ][7] = result.ResponsibleName[1] Punished[ loadUpTable[i] ][8] = result.Reason[1] end end addEventHandler("onResourceStart", resourceRoot, LoadUpOnResourceStart)
-
I just check the lowercase of the name, its an outdated version, nowdays i'd do this: local playername1 = string.lower(playername0) if (string.find(playername1,"boss")) then
-
Taken out from BOSS's script function CheckNick(cmd, player, nick) local playername0 = string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "") local playername1 = string.gsub(playername0, "[b]", "b") local playername2 = string.gsub(playername1, "[O]", "o") local playername3 = string.gsub(playername2, "[(SS)]", "ss") local playername4 = string.gsub(playername3, "[s]", "s") if (string.find(playername4,"boss")) then if (isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(source)), aclGetGroup("BOSS"))) then setPlayerTeam(source,Bossteam) outputChatBox("Welcome back " .. nick .. "#FF5555 to BOSS!",source, 231, 106, 12, true) else outputChatBox("#FF5555[Team]: kicked player #ffffff".. getPlayerName(player) .."#FF5555 for trying to fake the team!", getRootElement(), 255, 85, 85, true) kickPlayer(source, "Player with BOSS tag not logged in") end end end addCommandHandler("nick", CheckNick, false, false)
-
Oh its quite simple, these lag spikes are related to your Hard disk where GTA:SA is installed. Ineeded, your pc is fine, and should be also the hard disk, but some parts of the game are fragmented apparently, and when getting them together, it gets a lag spike. Try windows defrag, or any other program to defrag your hard disk. PD: Defrag should be done atleast once in a month.
-
This should answer your question: local PunishLevels = { function(player) --[[ Level 1 Punish (Just Warn) ]] outputChatBox("You have been warned for spamming, Please dont spam!", player, 255,255,255) end, function(player) --[[ Level 2 Punish (Second Warning) ]] outputChatBox("You have been warned for spamming again, Please dont spam!", player, 255,255,255) end, function(player) --[[ Level 3 Punish (Third Warning) ]] outputChatBox("You have been warned for spamming for the third time!, Please dont spam!", player, 255,255,255) end, function(player) --[[ Level 4 Punish (Mute Short time) ]] MutePlayer(player,600, "AntiSpam", "4th Level Punish") end } Then just calling the function with the assigned player in my case: PunishLevels[PunishLevel](player) --EG: PunishLevels[2](player)
-
It was a quick typing down, not really like that But it is then, okay?
-
Great, then it should be like this? local Savings = {} function test() local dbqery = dbQuery(db, "SELECT name FROM sqlite_master WHERE type='table'") local table = dbPoll(dbquery, -1) for i,v in ipairs(table) do table.insert(Savings, v) outputChatBox("Table Found! Name: "..v) end end
-
Wow thanks!!! working!! on MTA, wich tables are original? so i can remove them off by start.
-
SELECT * FROM `all_tables`; Error1: could not prepare statment (1 no such table: all_tables) Just tried it. http://www.w3schools.com/sql/trysql.asp ... select_all
