Jump to content

Bonus

Members
  • Posts

    297
  • Joined

  • Last visited

Everything posted by Bonus

  1. Bonus

    Solved

    And I sent you a link where its described very well.
  2. Solved ... It was not the code, it was the model-ID Had to try many combinations, atleast 264 and 258 worked.
  3. Bonus

    Solved

    Use gettok: https://wiki.multitheftauto.com/wiki/Gettok
  4. Hey, I got this problem: I download the file and load it with engineLoadTXD and engineImportTXD. Same for DFF. In that way I try to change 2 models / skins. But it changes both models with the SAME TXD AND DFF. Both models get the same mod and I dont know why. addEventHandler ( "onClientFileDownloadComplete", resourceRoot, function ( fileName, suc ) if suc then outputDebugString ( fileName ) if fileName == pathone..".txd" then outputDebugString ( 1 ) engineImportTXD ( engineLoadTXD ( fileName ), 7 ) elseif fileName == pathtwo..".txd" then outputDebugString ( 2 ) engineImportTXD ( engineLoadTXD ( fileName ), 9 ) elseif fileName == pathone..".dff" then outputDebugString ( 1 ) engineReplaceModel ( engineLoadDFF ( fileName ), 7 ) elseif fileName == pathtwo..".dff" then outputDebugString ( 2 ) engineReplaceModel ( engineLoadDFF ( fileName ), 9 ) end else outputChatBox ( "Skin konnte bei dir nicht runterladen werden!", 200 ) end end ) Debugscript says: [2016-02-04 15:18:55] INFO: Skins/Skin1/Skin1.txd [2016-02-04 15:18:55] INFO: 1 [2016-02-04 15:18:55] INFO: Skins/Skin1/Skin1.dff [2016-02-04 15:18:55] INFO: 1 [2016-02-04 15:18:55] INFO: Skins/Skin2/Skin2.txd [2016-02-04 15:18:55] INFO: 2 [2016-02-04 15:18:55] INFO: Skins/Skin2/Skin2.dff [2016-02-04 15:18:55] INFO: 2 [2016-02-04 15:18:55] INFO: Skins/Skin1/Skin1| Skins/Skin2/Skin2 -- thats outputDebugString ( pathone.." | "..pathtwo ) Normally it has to use Skin1 and Skin2 (both other skin mods). But only Skin2 gets used for both models. Why?
  5. You can use getElementsByType to get every player and compare their kills with getElementData. Or you can save the kills in an array and use the array to get the most kills.
  6. Absolutely not I'll tell you the difference: Your code: You use the function in every frame. When you have 60 FPS , your function has to get called 60 times per second. Thats 60x tocolorToRGBA, 300x dxDrawText ... RenderTarget: You create a RenderTarget, set the render target to this rendertarget and use your dxDrawOutlineText only 1 time! After that you clear the render target and use your rendertarget-texture: You just draw the rendertarget every frame. Thats only 60x dxDrawImage per Second Much better performance. example: http://www2.pic-upload.de/img/29634650/mta-screen_2016-01-16_05-24-27.png This window is just one renderTarget, 1 dxDrawText and 1 dxDrawRectangle. That means onClientRender uses only 1 dxDrawImage, 1 dxDrawText and 1 dxDrawRectangle every second. Without the renderTarget onClientRender-function would have to call atleast 8 dxDrawImage, 12 dxDrawText, 45 dxDrawImage and 4 dxDrawLine every second!! Which one is better?
  7. You know what a render target is, right?
  8. Bonus

    Solved

    function loadd (_, acc) local account = getAccountName(acc) local result = dbQuery ( database ,"SELECT RGB FROM RGB WHERE Account = ?", account) local poll = dbPoll(result, -1) if poll and poll[1] then setElementData(source, "RGB", poll[1]["RGB"]) end end addEventHandler("onPlayerLogin", getRootElement(), loadd) Try that ... onPlayerLogin gives you 3 arguments: The first is the previous acc, the second is the current acc and the third is a boolean for auto-login. You used the first argument, the previous acc. But I think you want to get the RGB for the current acc, not previous. Then you used source for the source (player) and for the previous acc. That can't work
  9. draw it on a renderTarget and draw the renderTarget with dxDrawImage
  10. Bonus

    Level

    First fix these two: error bad argument guiCreateLabel [Expected string at argument 5 got boolen] error bad argument givePlayerMoney Expected gui -element at argument 1 got nil ]
  11. Bonus

    Solved

    We cant see how you are loading. How can you expect us to know where the problem is?
  12. Bonus

    Level

    Use debugscript, there's an error. Even if it worked ups would be local, cant use it somewhere else out of the function, where it got created
  13. Bonus

    Level

    Is Level equal LevelUp? Two differenr names ...
  14. Bonus

    help please

    Well, wtf ... You even know how to script? You didnt even use my code ... also it has to be serversided, not clientsided.
  15. Bonus

    Solved

    Then try it and look into database if it got saved.
  16. Bonus

    SAM Turrent

    You can use createColSphere (or another Colshape), onClientElementColShapeHit, createWeapon, setWeaponTarget, fireWeapon
  17. Bonus

    help please

    Maybe show us the error?
  18. Bonus

    Peds problem

    Use onClientElementStreamIn on the triggered ped and use givePedWeapon and setPedControlState there. addEvent("onPedShoot",true) addEventHandler("onPedShoot",root, function (ped) setPedControlState( ped, "fire", true) addEventHandler ( "onClientElementStreamIn", ped, function () givePedWeapon ( source, 31, 5000, true ) setPedControlState ( source, "fire", true ) end) Edit: Its onClientElementStreamIn, not StreamedIn Update it
  19. Bonus

    Peds problem

    ... -.- Just use the code from Karim. If you want everyone to see the animation, delete the first player in triggerClientEvent.
  20. Bonus

    Peds problem

    Show your new serversided code.
  21. Bonus

    Peds problem

    Not sure why it does that. But you can use onClientElementStreamIn clientsided where you can give the weapon with givePedWeapon and set the controlstate. Post the code.
  22. Bonus

    Peds problem

    I'm pretty sure setControlState is for player only. You have to use setPedControlState. You can create the Ped, give him Weapon and trigger the ped to client, where you can use setPedControlState
×
×
  • Create New...