Jump to content

SpecT

Members
  • Posts

    656
  • Joined

  • Days Won

    9

Everything posted by SpecT

  1. Welcome to the forum! We can't help you without showing the script. Also this topic should be in the Scripting section for script related problems.
  2. This should solve the problem: local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then if (weapon == 37) then -- flame thrower ammo = ammo/10 end playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end )
  3. Is it multiplying it by a fixed value or it's different everytime ? In the issues they say that it muplties it by 10. So if the actual value is 2 it will return 20. If it's like this you can save a value divided by 10. I could test it later to see how it behaves.
  4. Hey, Check out the GetPedTotalAmmo function documentation and it's issues. Flame thrower's ammo is multiplied by 10.
  5. Try this: function handleOnPlayerACInfo( detectedACList, d3d9Size, d3d9MD5, d3d9SHA256 ) for _,acCode in ipairs( detectedACList ) do if acCode == 31 or acCode == 32 or acCode == 1 or acCode == 4 or acCode == 5 or acCode == 6 or acCode == 7 or acCode == 11 or acCode == 17 or acCode == 21 then kickPlayer( source, "Macro não é permitido no servidor." ) end end end addEventHandler("onPlayerACInfo", root, handleOnPlayerACInfo) local glitches = {"quickreload","fastmove","crouchbug","highcloserangedamage","hitanim","baddrivebyhitbox"} function enableGlitches () for _,glitch in ipairs(glitches) do -- something end end addEventHandler ( "onResourceStart", resourceRoot, enableGlitches) function source ( source, command ) local reload = aclReload() -- Reload the ACL if ( reload ) then -- Check it was reloaded successfully -- something else -- If not, output it (line below) outputChatBox ( "An unknown error occured. Please check the ACL file exists.", source, 255, 0, 0 ) end --else -- If they're not an admin, output it (below) --outputChatBox ( "You must be an admin to use this command!", source, 255, 0, 0 ) --end end addCommandHandler ( "reload", source )
  6. Did you try what I suggested at first ? Add: addEventHandler("onPlayerACInfo", root, handleOnPlayerACInfo)
  7. Well I sent you a fixed one.
  8. The error says it all. You have useless/unexpected symbol that stops the code to load. local glitches = {"quickreload","fastmove","crouchbug","highcloserangedamage","hitanim","baddrivebyhitbox"} function enableGlitches () for _,glitch in ipairs(glitches) do end end addEventHandler ( "onResourceStart", resourceRoot,enableGlitches)
  9. Hello and welcome to the forum! I think that the event handler for "handleOnPlayerACInfo" is missing (which could be the cause) or maybe you didn't paste it here. addEventHandler("onPlayerACInfo", root, handleOnPlayerACInfo) Could you show what the error you get is?
  10. SpecT

    MTA SDK Node JS

    You will need to put in the "httpport" which is set in the mtaserver.conf file. Maybe the problem is that the port is not 22005 but something else.
  11. SpecT

    [HELP] F11 Map

    What exactly doesn't work ? Can you show what you have tried ?
  12. SpecT

    [HELP] F11 Map

    To toggle the chat you can add showChat(false) when the map is opened and showChat(true) when the map is hidden. About the radar and the other info you should make some changes to their code. In the map client file you should add in the toggleMap() function 2 setElementData where the map is shown and hidden. setElementData(localPlayer, "mapShown", true,false) -- shown setElementData(localPlayer, "mapShown", false,false) -- hidden Then in the client files of the other resources I told you above (radar and the info on the right corner) you will need to add this in the functions which are triggered "onClientRender": if not getElementData(localPlayer, "mapShown") then return end
  13. Hello, I wrote some stuff I think it might help you out. local sx, sy = guiGetScreenSize() local progress = 0; local borderY = 0; local animState = 0 local panelTick = getTickCount() function animatePanel() local tick = getTickCount() - panelTick local progress = tick/1000 if progress >= 1 then -- anim finished --togglePanel() -- uncomment if you want it to go back down once the animation finishes end if animState == 1 then borderY = interpolateBetween ( sy/1, 0, 0, sy/1.15, 0, 0, progress, "Linear") else borderY = interpolateBetween ( sy/1.15, 0, 0, sy/1, 0, 0, progress, "Linear") end dxDrawRectangle ( 0, borderY, sx, 100, tocolor(0,0,0,255),false) -- panel end function togglePanel() if animState == 0 then animState = 1 -- opening else animState = 0 -- closing end panelTick = getTickCount() removeEventHandler("onClientRender",getRootElement(),animatePanel) addEventHandler("onClientRender",getRootElement(),animatePanel) end addCommandHandler("tog", togglePanel)
  14. Hello, I assume that this code is meant to be server-sided then this should do the work: function onStartSetStats() for i, player in pairs (getElementsByType("player")) do setPedStat (player, 22, 0) setPedStat (player, 23, 0) outputChatBox("Stats Changed To Default!", player, 255, 0, 0) end end addEventHandler("onResourceStart",resourceRoot,onStartSetStats)
  15. Hello, In order the MTA Anti-Cheat Team to review your ban you should provide your MTA serial.
  16. SpecT

    MTA Crash Bug

    As @Dutchman101 said the game stability isn't guaranteed by using modified files (in your case gta3.img file). So we can't provide you a "reduced" gta3.img file. In order to play it without crashes it would be best to play it with original game files. GTA:SA is not a high demanding game for nowadays PCs and it should run just fine on an average PC if there aren't any super heavy mods installed. If you have low performance on all servers then you should rather consider upgrading your PC than using reduced texture quality mods.
  17. Well you need to store the player in a variable. function teszt() local wep = getPedWeapon(source) local targetPlayer = source if isPedOnFire(source) and wep == 24 then toggleControl(source, "fire", false) setTimer(function() toggleControl(targetPlayer, "fire", true) end, 5000, 1) end end addEventHandler("onPlayerWeaponFire",root,teszt) Now it should work fine.
  18. You can set a timer after some time to enable the fire control. For example: function teszt() local wep = getPedWeapon(source) if isPedOnFire(source) and wep == 24 then toggleControl(source, "fire", false) setTimer(function() toggleControl(source, "fire", true) end, 5000, 1) end end addEventHandler("onPlayerWeaponFire",root,teszt)
  19. It could be a problem with the server. Does this happen when you join other servers ?
  20. SpecT

    HELP with table

    You need to specify every element of every row in the table in createObject. Just like this: createObject(narrows[1][1], narrows[1][2], narrows[1][3], narrows[1][4], narrows[1][5], narrows[1][6], narrows[1][7])
  21. SpecT

    Question

    No problem. Good job on finding the cause of this mess! It's a shame that there are such people...
  22. You have to put the math.random line inside the timer function. This way everytime the timer executes the function it will generate random number and then the explosions will be at random locations. timers[ hitPlayer ] = setTimer ( function() loc = math.random(#locations) createExplosion ( locations[loc][1], locations[loc][2], locations[loc][3], 6, hitPlayer ) end, 5000, 0 ) About the kill timers it will kill only the specified player's timer. The other timers (for the other players) will stay untouched.
  23. It seems fine to me. As long as it works fine you should not worry about it. You could only add a check if the timer exists and then kill it. if isTimer(timers[hitPlayer]) then killTimer(timers[hitPlayer]); end IF IT AIN'T BROKE, DON'T FIX IT
  24. SpecT

    Question

    If the scripts are compiled you won't be able to read anything from the files when you open them in an editor. If they are not compiled you could check all the files and use the "find" feature of your text editor to find his serial number somewhere in them. He probably added his serial as an exclusion to everything. If you find something suspicious you can post it here and we will tell you how to fix it. BTW is the "admin" resource edited by him ?
  25. You can't use the addCommandHandler like that. You can either do it like this (server side ONLY!): addEventHandler("onPlayerCommand", root, function(cmd) if (cmd == "Check" or cmd == "Checkk" or cmd == "checkkk") then outputChatBox("Okay") end end) or like this: function testFunc() outputChatBox("Ok") end addCommandHandler( "Check", testFunc) addCommandHandler( "Checkk", testFunc) addCommandHandler( "checkkk", testFunc)
×
×
  • Create New...