Jump to content

Jusonex

Retired Staff
  • Posts

    507
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Jusonex

  1. Jusonex

    MTA PHP SDK 0.4?

    https://dl.dropbox.com/u/53602417/mta/mtaphpsdk_0.4.zip
  2. Wie kommst du darauf, dass es am Port liegt? Werden die Server denn im Serverbrowser angezeigt? Und was heißt "ich komme in keine einzigen server" genau? (möglichst den genauen Ablauf)
  3. I have installed something like that, but I save the map, and when I resume it later, that objects are still there. That resource is named "object deleter"(not object_remover).Was maded by a german. Yes. That resource was (more or less) a test, I made for testing the new world building functions. You should use the newer one. Just add the following entry to the ACL admin group (more detailed manual here: https://wiki.multitheftauto.com/wiki/Ser ... nistrators): <object name="resource.object_remover"></object> Only "general.ModifyOtherObjects" is not enough. I'll fix the aclrequest list later.
  4. To facilitate removing world buildings you can use this resource: https://community.multitheftauto.com/index.php?p= ... ls&id=5993
  5. In hitElement stecken nicht direkt Spieler und Auto. Das Event onMarkerHit wird für beide Elemente ausgelöst. Mithilfe von https://wiki.multitheftauto.com/wiki/getElementType kannst du überprüfen, um welches Element es sich jeweils handelt: addEventHandler("onMarkerHit", marker, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" then -- Code für den Spieler elseif getElementType(hitElement) == "vehicle" then -- Code für das Fahrzeug end end )
  6. Thank you, your example works. I forgot to mention that "m_fBreath" is wrong. I found out that it has to be 2 bytes later. The following fields should also be correct now (tested with "m_bPlayerSprintDisabled"). Patch uploaded here: https://dl.dropbox.com/u/53602417/mta/ped_oxygen.patch Is there any special reason why getters use CClientPed directly and setters CClientEntity + casting?
  7. Hi, I'm trying to write get-/setPedOxygen. I already found the correct memory address in Mantis (click me), but I don't understand, why my reversed stuff didn't work. Here is it (pastebin): void __thiscall sub_60A8D0(int this, char a2, float a3) { int pPlayer; // esi@1 int pPlayerData; // ecx@3 // pPlayer + 1152 double v5; // st7@3 double v6; // st7@5 int v7; // eax@8 pPlayer = this; if ( !a2 || HasInfiniteOxygen ) { if ( sub_559AF0( > *(float *)(*(_DWORD *)(this + 1152) + 68) ) *(float *)(*(_DWORD *)(pPlayer + 1152) + 68) = flt_B7CB5C * a3// 1152: CPlayerPedDataSAInterface* // + flt_B7CB5C * a3 + *(float *)(*(_DWORD *)(pPlayer + 1152) + 68); } else { pPlayerData = *(_DWORD *)(this + 1152); v5 = flt_B7CB5C * a3; if ( *(float *)(pPlayerData + 68) > 0.0 && *(_DWORD *)(pPlayer + 1136) & 0x100000 ) { v6 = *(float *)(pPlayerData + 68) - v5; if ( v6 < 0.0 ) v6 = 0.0; *(float *)(pPlayerData + 68) = v6; } else { v7 = sub_821B80(v5 * 3.0); sub_73A530(pPlayer, pPlayer, 53, v7, 3, 0); } } *(_DWORD *)(*(_DWORD *)(pPlayer + 1152) + 52) &= 0xFFFFFF7Fu; } Wouldn't v6 or *(float *)(*(_DWORD *)(pPlayer + 1152) + 68) the player's oxygen? But with the following code I'll always get 0.0: float CPedSA::GetOxygen ( void ) { CPlayerPedDataSAInterface* pInterface = GetPedInterface ()->pPlayerData; float* ptr = (float*)(pInterface+68); float fBreath = *ptr; return fBreath; } My approach was to find this code by the "infinite oxygen" cheat flag (in this code "HasInfiniteOxygen"). I know the memory address from DEFCON1 is correct, but I want to understand why my stuff doesn't works Best regards
  8. a guy from IRC told me i should use the built-in MySQL functions. strangly, the row wasn't deleted, but I got 1 ("SELECT 1") as a result. It seems, that the "DELETE" query has been ignored. But why?
  9. hey guys, I've got a problem with MySQL Stored procedures. First of all: my procedure: CREATE PROCEDURE kickTenant(IN `houseID` smallint,IN `userID` bigint,IN `ownerID` bigint)BEGIN SET @cc = 0; SELECT count(*) INTO @cc FROM `house` WHERE `id` = houseID AND `owner` = ownerID; IF @cc = 1 THEN DELETE FROM `house_tenants` WHERE `ID` = houseID AND `tenant` = userID; SELECT 1; ELSE SELECT 2; END IF;END; and the lua part: local query = "CALL kickTenant("..houseID..", "..userID..", "..getPlayerUserID(client)..")" outputChatBox(tostring(query)) --outputs "CALL kickTenant(1, 1, 1)" (right) local result = mysql_query(handler, query) If I try this, 'result' will return nil and mysql_error()/mysql_errno() outputs But the strange thing is, that it work's perfect on my local (windows) computer, but not on the rootserver (Linux Debian x86) and if I try to execute this procedure via MySQL console (Navicat) on the rootserver, it works perfect, too.
  10. Okay, thank you very much. It works. Merry Christmas edit: it's maybe useful to add your "tutorial" to the wiki.
  11. First of all, thank you. If i try to compile lua, i'll get the output that there's a dependency to readline. Because of that I downloaded readline from http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html (I tried 6.2&6.3), but if I now try to compile lua, i'll get this output: make[1]: Entering directory `/root/ml_svn/lib/lua51/src' make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" make[2]: Entering directory `/root/ml_svn/lib/lua51/src' gcc -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lhistory -lncurses /usr/bin/ld: cannot find -lreadline collect2: ld returned 1 exit status make[2]: *** [lua] Error 1 make[2]: Leaving directory `/root/ml_svn/lib/lua51/src' make[1]: *** [linux] Error 2 make[1]: Leaving directory `/root/ml_svn/lib/lua51/src' make: *** [linux] Error 2 I moved readline's source to /usr/local/include/readline/ and I also tried to compile readline and moved the compiled libraries to /usr/local/libs/, but the output is always the same.
  12. First I downloaded the Module SDK from https://wiki.multitheftauto.com/wiki/Modules Then I tried: make and got that error message (look at previous post). There isn't also a configure file, required for make?. On another debian lenny (x64), i got this message: make: *** No rule to make target `/usr/include/gnu/stubs-32.h', needed by `CFunctions.o'. Stop. I also tried to add all files to a Code::Blocks Project. First I got the compiler message that some header files are missing. After I put in the absolute path (include/ILuaModuleManager.h) and included 'string.h' instead of 'string' (ml_base.cpp), the library was successfully compiled. Then I loaded the module with the server and i got this message: MODULE: Unable to find modules/libml_svn.so (/home/mtasa/mta/mods/dea thmatch/modules/libml_svn.so: undefined symbol: lua_type)! I also uploaded the Code::Blocks Project including all files: http://gamer-search.dyndns.org/ml_svn.tar.gz edit: Do I have to compile lua first? How? Isn't including lua.h and others headerfiles enough?
  13. hey guys, I am trying to compile a module via makefile on Debian Lenny (x86). It works fine on windows, but on linux I always get this error: make: *** No rule to make target `/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/include/stddef.h', needed by `CFunctions.o'. Stop." Are there any additional packages, which i need?
  14. Schau dir das mal an: https://wiki.multitheftauto.com/wiki/Known_Issues_-_FAQ Hier in der deutschen Sektion wirst du vermutlich nicht besonders schnell Hilfe bekommen. Wenn du auf die Deutschsprachigkeit bestehst, kannst du dich auch im deutschen MTA Forum melden (mta-sa.de)
  15. No. editor.main.imgOther = guiCreateStaticImage(X, Y+160, 72, 72, "images/other.png", false) addEventHandler("onClientGUIClick", editor.main.imgOther, editor.main.clickImage, false) That's already good. It's part of an own map editor. This image is a menu item. For example I place an object somewhere in the map. Now I want to select it to move it or whatever. But on the same position is an object in the 3D world. If I click on this menu item, onClientClick (attached to the object) will be triggered, but onClientGUIClick (attached to the gui image), too.
  16. Hey guys, I've got a little problem. I created a GUI image like this: editor.main.imgSaveExit = guiCreateStaticImage(X, Y+240, 72, 72, "images/save_exit.png", false) and I also use a clicksystem on objects/vehicles. But the problem is, if I click on this image, the object behind this image triggers onClientClick, too. How could I deny this? (if the player clicks on the image, onClientClick won't be triggered)
  17. do you mean, setElementPosition before each frame?
  18. Hey guys, i want to add new rails to the default GTA map, but for this, i need my own rail system, but I'm not sure how to begin. The calculation of the direction isn't the problem, but how to move the train (realistic) upon the rails. What functions are needed? Has anyone got experiences in this?
  19. Jusonex

    getPedTarget

    you could use onClientPlayerWeaponFire
  20. Oh...yeah. spawnPunkte[0][1] was nil. Thanks
  21. Jusonex

    Money

    You need the string functions: http://lua-users.org/wiki/StringLibraryTutorial http://mta-sa.de/forum/index.php?page=T ... 3#post8663 (I think that code is the right for you)
  22. Jusonex

    Claymore Mines

    function createClaymore ( x,y,z, creator ) local x,y,z = getElementPosition ( creator ) local claymoreObject = createObject ( 1945, x, y, z - 1, 0, 0, 90 ) --create an object which looks like a claymore local claymoreCol = createColSphere ( x, y, z, 1 ) --create a col sphere with radius 1 setElementData ( claymoreCol , "type", "claymore" ) --store the type of colshape so it can be retrieved setElementData ( claymoreCol, "object", claymoreObject ) --store the object of the claymore setElementData ( claymoreCol, "creatorPlayer", creator ) --store the person who created it end function claymoreHit ( player, matchingDimension ) if getElementData ( source, "type" ) == "claymore" then --ensure its a claymore --retrieve the object associated to the claymore, and who created it local claymoreObject = getElementData ( source, "object" ) local claymoreCreator = getElementData ( source, "creatorPlayer" ) --get the position of the claymore local x,y,z = getElementPosition ( source ) createExplosion ( x,y,z, 12, claymoreCreator ) --create an explosion, associated to the creator, of a small size at the col's position --destroy the claymore object, and the col shape so it doesnt trigger again. destroyElement ( claymoreObject ) destroyElement ( source ) end end addEventHandler ( "onColShapeHit", getRootElement(), claymoreHit ) addCommandHandler("claymore", function(player) --adds a commandhandler to create a claymore local x, y, z = getElementPosition(player) --gets player's position createClaymore(x, y, z, player) --creates the claymore end)
  23. Jusonex

    Claymore Mines

    https://wiki.multitheftauto.com/wiki/CreateColSphere Take a look at the second example.
  24. Hey guys, I've got a problem. Sometimes the player didn't spawn, if he was killed. That's my code: local spawnPunkte = { {2490.9541015625, -1665.9912109375, 14}, {2665.7795410156, -1430.2344970703, 31}, {2423.7976074219, -1239.5343017578, 25}, {2154.5483398438, -1137.8609619141, 26}, {2108.0493164063, -1781.1252441406, 14.5}, {1685.4399414063, -2323.234375, 14}, {1785.7797851563, -1926.1567382813, 14}, {1972.0899658203, -1156.9620361328, 21.5} } addEvent("onPlayerNewSpawn", true) function spawn(player, new) if ( new == "new" ) then spawnPlayer(player, 1834.4523925781, -1682.6423339844, 14, 90) createBlips(player) else local spawn = math.random(0,#spawnPunkte) repeat until spawnPlayer(player, spawnPunkte[spawn][1]+math.random(-2,2), spawnPunkte[spawn][2]+math.random(-2,2), spawnPunkte[spawn][3], 0, math.random(9,288)) end setCameraTarget(player, player) end addEventHandler("onPlayerNewSpawn", getRootElement(), spawn) addEventHandler("onPlayerWasted", getRootElement(), function(_, killer) setTimer(spawn, 5000, 1, source) givePlayerMoney(killer, 50) end) If the player didn't spawn, I get this error message: "attempt to index field '?' (a nil value)" (Line 20) But why only sometimes? Justus
×
×
  • Create New...