29.08.2015, 23:27
Quote:
3 Things please:
You need to add:BitAnd bitNot bitOr BitXor bitLshift bitRshift bitARshift (look them up at MTA wiki/utility functions) bitTest (optional: just uses bitAnd ~= 0) Because Lua does not support the bitmask/bitwise operators: | & ^ ~ >> << >>> (We will not be able to easily detect player key presses until you add those.) https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange -- ------------------------------------------------------------------------------------------------------------------------------------ Код:
LUA_FUNCTION lua_HTTP(lua_State *L) { int index; int type; std::string url; std::string data; //std::string callback; ArgReader argReader(L); argReader.ReadNumber(index); argReader.ReadNumber(type); argReader.ReadString(url); argReader.ReadString(data); //argReader.ReadString(callback); bool success = HTTP(index, type, url.c_str(), data.c_str()); lua_pushboolean(L, success); return 1; } Код:
lua_HTTP(0, "www.example.com", HTTP_POST, "request=Hello world!", function(index, responseCode, data) if responseCode == 404 then print("HTTP response: 404 Page not found!"); elseif responseCode == 400 then print("HTTP response: " .. data); end end ); It would be very helpful to me -- ----------------------------------------------------------------------------------------------------------------------------------------- That socket module I PM'ed you the other day. -- ----------------------------------------------------------------------------------------------------------------------------------------- My only wishes for this, I would add them if I knew exactly how to (maybe make a tutorial for me on how to add/remove functions (I know C++)) xD I'm thankful if you do. Good work. |
As I said if I have some free time I'll trying to make a wiki for it (or if somebody have time for that then feel free to make it ) , plus add some feature (bit manipulation, mysql/sqlite functions, start/stop resources, etc).