Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. There's a topic about this, maybe it helps you: https://forum.multitheftauto.com/viewtop ... a5#p342602
  2. Seems like is a new function for 1.1. The wiki should explain what it does.
  3. I suposed that was the 'createTeam' function, since, he shouldn't use MTA function names as one of his.
  4. Do you know what 'account data' is? is a MTA database system, you can 'save' data in it, and that's what my script does.
  5. And... what's wrong with it? we need more details about the error. P.S: Type /debugscript 3 in-game to search for errors.
  6. I don't know, it's suposed to be working fine.
  7. You put that in a script .lua you create the meta.xml for it and start the resource, if you don't know how resources works, then take a look here: https://wiki.multitheftauto.com/wiki/Resources
  8. addEventHandler("onPlayerLogin",getRootElement(), function () local account = getPlayerAccount(source) local kills = getAccountData(account,"kills") local deaths = getAccountData(account,"deaths") local headshots = getAccountData(account,"headshots") if not kills then setAccountData(account,"kills",0) end if not deaths then setAccountData(account,"deaths",0) end if not headshots then setAccountData(account,"headshots",0) end end) function updatePlayerStats(ammo, attacker, weapon, bodypart) local account = getPlayerAccount(killer) if account then local kills = getAccountData(account,"kills") local headshots = getAccountData(account,"headshots") setAccountData(account,"kills",kills+1) if bodypart == 9 then setAccountData(account,"headshots",headshots+1) end end local accountS = getPlayerAccount(source) if accountS then local deaths = getAccountData(accountS,"deaths") setAccountData(accountS,"deaths",deaths+1) end end addEventHandler("onPlayerWasted",getRootElement(),updatePlayerStats) function getPlayerStats(thePlayer) local account = getPlayerAccount(thePlayer) if account then local kills = getAccountData(account,"kills") or 0 local headshots = getAccountData(account,"headshots") or 0 local deaths = getAccountData(account,"deaths") or 0 local ratio = string.format("%.2f", kills / deaths) outputChatBox("[sTATS]".. getPlayerName(thePlayer) .."'s Stats: Kills: ".. tostring(kills) .." (".. tostring(headshots) .." Headshots), ".. tostring(deaths) .." Deaths, Ratio: ".. tostring(ratio).."", getRootElement(), 255, 255, 0) end end addCommandHandler("stats",getPlayerStats) That's a good start, I think.
  9. A "stats" system can be many things... a little more expecific won't kill you.
  10. Castillo

    Banner Help

    My code is suposed to hide it then show after 500 MS.
  11. Castillo

    Banner Help

    GUIEditor_Window = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(800,124,96,48,"",false) GUIEditor_Window[2] = guiCreateWindow(569,134,231,450,"",false) GUIEditor_Image[1] = guiCreateStaticImage(9,43,193,145,"images/mtalogo.png",false,GUIEditor_Window[2]) GUIEditor_Image[2] = guiCreateStaticImage(29,236,193,164,"images/mtalogo.png",false,GUIEditor_Window[2]) function blinkElement(element) setTimer(function () guiSetVisible(element, not guiGetVisible(element)) end, 500, 0) end blinkElement(GUIEditor_Window[1]) blinkElement(GUIEditor_Window[2])
  12. Castillo

    Banner Help

    What do you mean by show and hide?
  13. You welcome. P.S: You only need to duplicate the time, and that'll be like 0.5 .
  14. I think the problem is the + 0.5, use + 1 instead.
  15. Acording to what I remember, the resource was uploaded ilegally, it was not suposed to be uploaded.
  16. local damage_data = { [3] = 20, [4] = 30, [5] = 40, [6] = 50, [7] = 60, [8] = 70, [9] = 80, } addEventHandler ( "onPlayerDamage", getRootElement (), function ( attacker, weapon, bodypart, loss ) if damage_data[bodypart] then local health = getElementHealth(source) local damage = damage_data[bodypart] setElementHealth(source, tonumber(health)-tonumber(damage)) end end) Body part names: 3: Torso 4: Ass 5: Left Arm 6: Right Arm 7: Left Leg 8: Right leg 9: Head Something like that?
  17. Stolen script from The Brazil Gangs: https://community.multitheftauto.com/ind ... ls&id=2578
  18. No tengo ni idea, ni sabia que en el GTA single player se podia tener 150% de armadura jaja.
  19. Castillo

    idle cars?

    addEventHandler("onResourceStart",resourceRoot, function() for k, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do toggleVehicleRespawn( vehicle, true ) setVehicleIdleRespawnDelay( vehicle, 2000 ) end end)
  20. This article needs checking for the following reason: Things like infinite run, fire proof CJ, 150 health, 150 armor have special activation flags. They need a way to be triggered on/off.
  21. Jaysd1, he's asking how to STOP GTA to take the weapon when ammo is 0, not to take the weapon (again) when ammo is 0.
×
×
  • Create New...