-
Posts
327 -
Joined
-
Last visited
Everything posted by Orange
-
It smells like a nubish script -.- If it is opensource, why do you want to compile it? Read what is OpenSource first
-
Bueh... It's nothing with openframe's account classes local Acc = of.account:fromName("Example") Acc.data.money = 12333 -- amount of money, example Someone can make a class which makes it automatically... I must write these classes fast and make a tutorial
-
Update: To reduce amount of used variables, I've made a "of" table with all classes stored in. Also, making of these classes is simplified. "of.class:new" allows to inherit and automatically add "elementData" (.data) arrays. For me, next update will be more smiliar than r6.
-
I don't like this idea. Maybe, I'll add predefined events, so using default events will be like: onPlayerJoin:Handle(onJoin)
-
SVN Update: Revision 5 and 6 Added GUIClasses (thanks for 50p) (revision 5) Event:Use added (revision 6)
-
I've got objects from aztec. Contact me for them.
-
Madis - I totally forgot about it It's a very good idea, I'd implent it, when I'll finish Event and Builder classes - It will be available at svn. Additionaly, I registered at Google Code. Here's the link Also, the code will be tested on a new "Andromeda Test Server", which will be ready in next week. Thanks for "xSzyneKx" for sponsoring it. The next svn version of Event class will include "Use" function for default events. For example: Event:Use("onPlayerJoin"):Handle(onJoin) Thanks for reading this post. By the way, does someone want to join me with creating openFrame?
-
Yes! Finally, our team is going to finish the first version. Let me say about main ideas of this project: Defaulty in mta, global variables are available "in a list", so when we have files: 1.lua (can access just global variables from 1.lua) 2.lua (can access global variables from 1.lua and 2.lua) 3.lua (1.lua, 2.lua and 3.lua) and we can use global variables of file "1.lua" in files: 1.lua, 2.lua, 3.lua, but when you'll try to use global variable from 2.lua in file 1.lua, you'll get an error. That's why I made "Storage" class. It's the first loaded class. It allows to store variables and use it in resources, which was loaded before. For example, "1.lua" is Storage class. I'd like to make a SQL connection in "3.lua" and use it in "2.lua". The code will look like that: 3.lua local SQL = MySQLConnection:Create("host", "user", "password", "db") Storage:Store("SQL", SQL) 2.lua local SQL = Storage:Get("SQL") SQL:Query("blah blah blah") It's simple - isn't it? But it's just first class of others included in openFrame. The second class is Database Wrapper, which currently supports just MySQL. It allows you to easier use your database. For example, querying a string and doing operations on result is something like that: local SQL = MySQLConnection:Create("host", "user", "password", "db") local r = SQL:Query("SELECT * FROM example_table") while true do local row = r:fetchAssoc() if (not row) then break end outputDebugString(row["example_column"]) end r:freeResult() That's easy too... But you can make making your queries a lot easier. Our third class called "Builder" allows you to build SQL queries! local result = SQL:Query(Builder:Select("*"):Where("1 = 1", "2 = 2"):Order_By("id", ASC):Get("example_table")) If you'll debug it, the builder will return string like: SELECT * FROM example_table WHERE 1 = 1 AND 2 = 2 ORDER BY id ASC also, if you'd replace "Where" with "WhereOR", it would return: SELECT * FROM example_table WHERE 1 = 1 OR 2 = 2 ORDER BY id ASC Also, there's an Event System. It can replace addEvent("testEvent", true) addEventHandler("testEvent", getRootElement(), func) to Event:Create("testEvent", true):Handle(func, getRootElement()) It's a lot easier and shorter. These are currently finished classes. I'm working at finishing SQL classes (Builder and Database). Later, I'll finish server classes, but I have to do basic client ones before Can you say something about this idea? Maybe, suggestion about new module? Post it! I'll read this topic everyday
-
A: Apple Q: Am I sexy?
-
mtaSTATS team makes a contest! What to do? A nice-looking website template, which mixes stats site with social modules (Actual design mixed with social platform like facebook). We prefer 960gs as a css framework. The theme must be compatible with JQUERY 1.4.2 and one of the charts plugins There must be a theme for MyBB forums. It's allowed to base it on other template, but we'd like to have a original and nice-looking one. Also, we need a bugtracker theme. Like Mantis. And developer platforms theme. Like products website. What's the prize? Life time support for our scripts. Also, we will provide the winner not compiled versions of our gamemodes (currently, we're finishing OpenFrame MTASA Framework, then we'll build OpenBase - basemode alternative on it) Admin on mtaSTATS This list can be modified later! So, let's go!
-
OMG! Stop using weapon pickups in BM! Are you crazy?!
-
First question: I was playing "de_aztec" map somewhere on stealth... Where can I download it? Second: Does anyone know how to convert maps from counter-strike? Now, I've got .map file, but what next?
-
I'm not sure about using mysql here. For me, it isn't a good idea, server makes bigger bandwith >.> When I turned it on on my server, there was "omgwtflolsuperlal" lagzzz... It's better to use a lua irc library
-
Sorry for double-post, but... Project is still alive! Actually, I am testing my own PHP SDK implented into CodeIgniter. It's still bugged >.>
-
My nick is =VK=Orange :< Stop saying my name
-
I'm crazy today Ofc, it's not guide. Found a new one: -- encryption table local base64chars = {[0]='A',[1]='B',[2]='C',[3]='D',[4]='E',[5]='F',[6]='G',[7]='H',[8]='I',[9]='J',[10]='K',[11]='L',[12]='M',[13]='N',[14]='O',[15]='P',[16]='Q',[17]='R',[18]='S',[19]='T',[20]='U',[21]='V',[22]='W',[23]='X',[24]='Y',[25]='Z',[26]='a',[27]='b',[28]='c',[29]='d',[30]='e',[31]='f',[32]='g',[33]='h',[34]='i',[35]='j',[36]='k',[37]='l',[38]='m',[39]='n',[40]='o',[41]='p',[42]='q',[43]='r',[44]='s',[45]='t',[46]='u',[47]='v',[48]='w',[49]='x',[50]='y',[51]='z',[52]='0',[53]='1',[54]='2',[55]='3',[56]='4',[57]='5',[58]='6',[59]='7',[60]='8',[61]='9',[62]='-',[63]='_'} -- function encode -- encodes input string to base64. function enc(data) local bytes = {} local result = "" for spos=0,string.len(data)-1,3 do for byte=1,3 do bytes[byte] = string.byte(string.sub(data,(spos+byte))) or 0 end result = string.format('%s%s%s%s%s',result,base64chars[rsh(bytes[1],2)],base64chars[lor(lsh((bytes[1] % 4),4), rsh(bytes[2],4))] or "=",((#data-spos) > 1) and base64chars[lor(lsh(bytes[2] % 16,2), rsh(bytes[3],6))] or "=",((#data-spos) > 2) and base64chars[(bytes[3] % 64)] or "=") end return result end -- decryption table local base64bytes = {['A']=0,['B']=1,['C']=2,['D']=3,['E']=4,['F']=5,['G']=6,['H']=7,['I']=8,['J']=9,['K']=10,['L']=11,['M']=12,['N']=13,['O']=14,['P']=15,['Q']=16,['R']=17,['S']=18,['T']=19,['U']=20,['V']=21,['W']=22,['X']=23,['Y']=24,['Z']=25,['a']=26,['b']=27,['c']=28,['d']=29,['e']=30,['f']=31,['g']=32,['h']=33,['i']=34,['j']=35,['k']=36,['l']=37,['m']=38,['n']=39,['o']=40,['p']=41,['q']=42,['r']=43,['s']=44,['t']=45,['u']=46,['v']=47,['w']=48,['x']=49,['y']=50,['z']=51,['0']=52,['1']=53,['2']=54,['3']=55,['4']=56,['5']=57,['6']=58,['7']=59,['8']=60,['9']=61,['-']=62,['_']=63,['=']=nil} -- function decode -- decode base64 input to string function dec(data) local chars = {} local result="" for dpos=0,string.len(data)-1,4 do for char=1,4 do chars[char] = base64bytes[(string.sub(data,(dpos+char),(dpos+char)) or "=")] end result = string.format('%s%s%s%s',result,string.char(lor(lsh(chars[1],2), rsh(chars[2],4))),(chars[3] ~= nil) and string.char(lor(lsh(chars[2],4), rsh(chars[3],2))) or "",(chars[4] ~= nil) and string.char(lor(lsh(chars[3],6) % 192, (chars[4]))) or "") end return result end
-
I'm crazy today Ofc, it's not guide. Found a new one: -- encryption tablelocal base64chars = {[0]='A',[1]='B',[2]='C',[3]='D',[4]='E',[5]='F',[6]='G',[7]='H',[8]='I',[9]='J',[10]='K',[11]='L',[12]='M',[13]='N',[14]='O',[15]='P',[16]='Q',[17]='R',[18]='S',[19]='T',[20]='U',[21]='V',[22]='W',[23]='X',[24]='Y',[25]='Z',[26]='a',[27]='b',[28]='c',[29]='d',[30]='e',[31]='f',[32]='g',[33]='h',[34]='i',[35]='j',[36]='k',[37]='l',[38]='m',[39]='n',[40]='o',[41]='p',[42]='q',[43]='r',[44]='s',[45]='t',[46]='u',[47]='v',[48]='w',[49]='x',[50]='y',[51]='z',[52]='0',[53]='1',[54]='2',[55]='3',[56]='4',[57]='5',[58]='6',[59]='7',[60]='8',[61]='9',[62]='-',[63]='_'} -- function encode-- encodes input string to base64.function enc(data) local bytes = {} local result = "" for spos=0,string.len(data)-1,3 do for byte=1,3 do bytes[byte] = string.byte(string.sub(data,(spos+byte))) or 0 end result = string.format('%s%s%s%s%s',result,base64chars[rsh(bytes[1],2)],base64chars[lor(lsh((bytes[1] % 4),4), rsh(bytes[2],4))] or "=",((#data-spos) > 1) and base64chars[lor(lsh(bytes[2] % 16,2), rsh(bytes[3],6))] or "=",((#data-spos) > 2) and base64chars[(bytes[3] % 64)] or "=") end return resultend -- decryption tablelocal base64bytes = {['A']=0,['B']=1,['C']=2,['D']=3,['E']=4,['F']=5,['G']=6,['H']=7,['I']=8,['J']=9,['K']=10,['L']=11,['M']=12,['N']=13,['O']=14,['P']=15,['Q']=16,['R']=17,['S']=18,['T']=19,['U']=20,['V']=21,['W']=22,['X']=23,['Y']=24,['Z']=25,['a']=26,['b']=27,['c']=28,['d']=29,['e']=30,['f']=31,['g']=32,['h']=33,['i']=34,['j']=35,['k']=36,['l']=37,['m']=38,['n']=39,['o']=40,['p']=41,['q']=42,['r']=43,['s']=44,['t']=45,['u']=46,['v']=47,['w']=48,['x']=49,['y']=50,['z']=51,['0']=52,['1']=53,['2']=54,['3']=55,['4']=56,['5']=57,['6']=58,['7']=59,['8']=60,['9']=61,['-']=62,['_']=63,['=']=nil} -- function decode-- decode base64 input to stringfunction dec(data) local chars = {} local result="" for dpos=0,string.len(data)-1,4 do for char=1,4 do chars[char] = base64bytes[(string.sub(data,(dpos+char),(dpos+char)) or "=")] end result = string.format('%s%s%s%s',result,string.char(lor(lsh(chars[1],2), rsh(chars[2],4))),(chars[3] ~= nil) and string.char(lor(lsh(chars[2],4), rsh(chars[3],2))) or "",(chars[4] ~= nil) and string.char(lor(lsh(chars[3],6) % 192, (chars[4]))) or "") end return resultend
-
Sorry, wrong word used Btw. can someone fix this code?
-
Sorry, wrong word used Btw. can someone fix this code?
-
There are few implentations of encodings into MTA: Base64 Encoding function base64_enc(data) return ((data:gsub('.', function(x) local r,b='',x:byte() for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end return r; end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) if (#x < 6) then return '' end local c=0 for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end return b:sub(c+1,c+1) end)..({ '', '==', '=' })[#data%3+1]) end USAGE: base64_enc('string') encodes 'string' Base64 Decoding function base64_dec(data) data = string.gsub(data, '[^'..b..'=]', '') return (data:gsub('.', function(x) if (x == '=') then return '' end local r,f='',(b:find(x)-1) for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end return r; end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) if (#x ~= then return '' end local c=0 for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end return string.char(c) end)) end USAGE: base64_dec('KDFHSKJ87987KJSHAKJD9') decodes 'KDFHSKJ87987KJSHAKJD9'
-
There are few implentations of encodings into MTA: Base64 Encoding function base64_enc(data) return ((data:gsub('.', function(x) local r,b='',x:byte() for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end return r; end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) if (#x < 6) then return '' end local c=0 for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end return b:sub(c+1,c+1) end)..({ '', '==', '=' })[#data%3+1])end USAGE: base64_enc('string') encodes 'string' Base64 Decoding function base64_dec(data) data = string.gsub(data, '[^'..b..'=]', '') return (data:gsub('.', function(x) if (x == '=') then return '' end local r,f='',(b:find(x)-1) for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end return r; end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) if (#x ~= then return '' end local c=0 for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end return string.char(c) end))end USAGE: base64_dec('KDFHSKJ87987KJSHAKJD9') decodes 'KDFHSKJ87987KJSHAKJD9'
-
Security: srsly? For my old shitty projects? :> http://pecan.penguinzoft.pl/ - Site of pecan (API for mtaSTATS and... uhm, i'll say it later :>)
-
Security: srsly? For my old shitty projects? :> http://pecan.penguinzoft.pl/ - Site of pecan (API for mtaSTATS and... uhm, i'll say it later :>)
-
Ilogical ;D But, I know what do you want to make. Commands aren't really good. Detecting tag isn't too (I can rename and have privledges). It should be good to make a simple system, where clan member logins and gets privledges to use this func. After logout, he can't use it anymore. This idea sucks, because members can abuse :>
-
Ilogical ;D But, I know what do you want to make. Commands aren't really good. Detecting tag isn't too (I can rename and have privledges). It should be good to make a simple system, where clan member logins and gets privledges to use this func. After logout, he can't use it anymore. This idea sucks, because members can abuse :>
