Jump to content

ManeXi

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by ManeXi

  1. function cancelPedDamage ( attacker, weapon ) --This is to cancel the damage if attacker then if not (weapon == 16) or (weapon == 35) or (weapon == 36) then cancelEvent() end end -- outputChatBox("Player Weapon is: "..getPedWeapon(attacker, weapon)) end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelPedDamage ) this is my code now, I don't care much about Ped's weapon, but still canceling RPG and RPG-HS damage, I have tried to put special IDs like explosions etc... but nothing
  2. No, sir. https://wiki.multitheftauto.com/wiki/On ... ayerDamage And I still getting the output error
  3. I want to cancel damage in every weapon with some exceptions, but because god wanted RPG(35) and RPG-HS(36) can't be exceptions. function cancelPedDamage ( attacker, weapon ) --This is to cancel the damage if not (weapon == 16) or (weapon == 35) or (weapon == 36) then cancelEvent() end outputChatBox("Player Weapon is: "..getPedWeapon(attacker, weapon).."") end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelPedDamage ) In other words, damage is not cancelled in Grenade(16) but yes in RPG(35) and in RPG-HS(36) And for another unknown reason I can't output the weapon that the attacker used it puts: ERROR: damage_c.lua:5: attempt to concatenate a boolean value
  4. It's ok, thanks for helping, this can be set as Solved
  5. Can anyone tell me which are the pros and cons of MySQL and SQLite? Which should I choose depending my objectives? etc...
  6. Well I have made custom settings to disable/enable GTA:SA glitches via admin panel, it works but I use a timer to keep being able to enable/disable them on real time. Idk if it's my paranoia, but I find it pretty annoying, so my question is How can I use a "for" loop with it. This is the code: function executeGlitches() local super_sprint = get("super_sprint") local fastmove = get("fastmove") local crouchbug = get("crouchbug") local fastfire = get("fastfire") local quickstand = get("quickstand") local hitanim = get("hitanim") setGlitchEnabled ( "fastsprint", super_sprint ) setGlitchEnabled ( "fastmove", fastmove ) setGlitchEnabled ( "crouchbug", crouchbug ) setGlitchEnabled ( "fastfire", fastfire ) setGlitchEnabled ( "quickstand", quickstand ) setGlitchEnabled ( "hitanim", hitanim ) end setTimer(executeGlitches,500, 0)
  7. k, I'll set without initial price, anyone who wants buy it just PM me.
  8. Do it then, and didn't say but that's initial price, the price may be discussed.
  9. Still not working This is the function for "giveKill" function giveKill ( player ) if getElementType(player) == "player" then setElementData(player,"Kills",getElementData(player,"Kills") + 1) local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setAccountData(acc,"Kills",getElementData(player,"Kills") + 1) local mo = getAccountData(getPlayerAccount(player),"Money") setPlayerMoney(player,tonumber(mo) + 50) setAccountData(acc,"Money",tonumber(mo) + 50) setElementHealth(player, getElementHealth(player) + 35) end end end
  10. Basically when I kill myself with a Greanade it gives me money and kills. function player_Wasted ( ammo, attacker, weapon, bodypart ) if ( attacker ) then giveKill(attacker) setkdr(attacker) triggerClientEvent(source,"startRespawnShow",source,attacker,weapon) giveDeath(source) setkdr(source) setCameraTarget(source,attacker) else triggerClientEvent(source,"startRespawnShow",source,source,0) giveDeath(source) setkdr(source) end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
  11. Awesome Pizza building watch SS here. -Everything in 1 object -Custom interior -2 Floor (Perfect for a robbery in a RPG server) -Autocar -Kitchen -WC Are you interested on buying it? PM me, price will be discussed.
  12. Thanks alot IIYAMA it works perfectly, this can be set as Solved.
  13. Anyone knows why it doesn't work? Please, this is important for me I would like to solve it.
  14. Still not working and there is not debug error.
  15. Simple01 yours still not working but it doesn't care Anubhav's does, anyway now I've got another doubt, instead of setting a certain key like before, I would like to get the keys from a certain control of a player, I have tried this: playersTime = {} playersTimer = {} addEventHandler( "onClientKey", root, function(button,press) if (button == getBoundKeys("crouch")) and (press) then if not(playersTimer[localPlayer]) then playersTimer[localPlayer] = setTimer(function() end, 1000, 1) playersTime[localPlayer] = 0 return end if (isTimer(playersTimer[localPlayer])) then playersTime[localPlayer] = playersTime[localPlayer] + 1 return else playersTimer[localPlayer] = nil outputChatBox("You have pressed the crouch Key "..playersTime[localPlayer].." times") playersTime[localPlayer] = nil end end end ) But it doesn't get rightly the keys
  16. In yours it gives me this error: And this other in yours:
  17. So I would like to count how many times I press for example the key "h" in 5 seconds, this is a sh!t I have made; addEventHandler( "onClientKey", root, function(button,press) if (button == "h") and (press) then setTimer( function add (a) local sum = 0 for i,v in ipairs(a) do sum = sum + v end end ,5000,1) outputChatBox("You have pressed the key H "..sum.." times") end end ) And after the 5 seconds It would be good if it puts in the Chat "You have pressed the key H X times" Honestly I have no idea of making a key counter, don't kill me, thanks for reading.
  18. Already reported in http://bugs.mtasa.com/view.php?id=9004
  19. First of all read this to know what are weapon flags: setWeaponProperty and This The flag i request is "flag_quickreload" as the name of flag says it's just a simple flag to allow San Andreas quickreload in that specific weapon, this would be very useful to fix certain weapon when adding extra stuff. (e.g. when you add a charge to the Rifle) I couldn't make a report in bug tracker since i'm only "viewer", if anyone who isn't "viewer" can do it for me i'll thank you too much.
  20. Is there any way to allow auto-reload of GTA:SA in certain weapons, i mean for example allowing auto-reload just in M4 and MP5 for example, with this: setGlitchEnabled ( "quickreload", true )
  21. Thank you much it worked perfectly this can be set a solved
  22. I've made a kdr script, and it's working properly, but i've got the problem that it's showing with infinite decimals and it's annoying, i want to show it with just 3 decimals. I will leave below everything related kdr script. function setkdr ( player ) local dea = getElementData(player,"Deaths") local kil = getElementData(player,"Kills") setElementData(player,"K/D Ratio", kil/dea) local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setAccountData(acc,"K/D Ratio",kil/dea) end end function player_Wasted ( ammo, attacker, weapon, bodypart ) if ( attacker ) then giveKill(attacker) setkdr(attacker) triggerClientEvent(source,"startRespawnShow",source,attacker,weapon) giveDeath(source) setkdr(source) setCameraTarget(source,attacker) else triggerClientEvent(source,"startRespawnShow",source,source,0) giveDeath(source) setkdr(source) end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) On login: local kdr = getAccountData(acc,"K/D Ratio" ) if not kdr then setAccountData(acc,"K/D Ratio",0) kdr = 0 end setElementData(source,"K/D Ratio",kdr)
  23. I don't get what i would do with just that...
×
×
  • Create New...