Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Turismo, that script was scripted for SAUR, is not going to be released. P.S: It uses dxDrawText.
  2. Well, that's why there are two functions to send data to the client or server. check out triggerServerEvent (so you can send something, or make an event in the server to change his team) a lil example: -- server side addEvent("setMyTeam",true) addEventHandler("setMyTeam",root, function (thePlayer) setPlayerTeam(thePlayer, theTeamElement) end) -- client side triggerServerEvent("setMyTeam",getLocalPlayer(),getLocalPlayer()) I hope you understand.
  3. That's right, GUI is only client side. And for that is simple, use onClientResourceStart (when the client finishes downloading the required files).
  4. onClientPlayerJoin will be executed for everyone but the player who just joined. Why don't you use it server side instead? There's no "player classes", maybe you mean teams? if so, search for the team functions in the mta wiki (wiki.multitheftauto.com).
  5. http://www.mediafire.com/?eciucm6gko9ueg7
  6. No as far as I know.
  7. Well, at least explain what's the error...
  8. Learn to use the debugscript, type /debugscript 3 in-game (you must be logged in as Admin).
  9. Stolen resource from Cholrek: https://community.multitheftauto.com/index.php?p= ... ls&id=2605
  10. 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(attacker) 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 if not attacker or attacker == source then return end local accountS = getPlayerAccount(source) if accountS then local deaths = getAccountData(accountS,"deaths") setAccountData(accountS,"deaths",deaths+1) end 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) Try that.
  11. You have many typos in your script, like using 'then' when it should be 'do', also calling a variable alphaG but your variable was alphG. function fadeElement(ele, way) -- way true for in, false for out local allow = false local gui = false local alphaG = false local alphaS = false if supportedElements[getElementType(ele)] then allow = true alphaG = getElementAlpha alphaS = setElementAlpha elseif string.find(getElementType(ele), "gui") then allow = true alphaG = guiGetAlpha alphaS = guiSetAlpha end if not allow then debug.w("Invalid argument(1, 'element') @ fadeElement. Specified element is not allowed") else if way then while alphaG(ele) < 255 do alphaS(ele,alphaG(ele)+DIFFERENCE) end elseif not way then while alphaG(ele) > 0 do alphaS(ele, alphaG(ele)-DIFFERENCE) end end end end P.S: This script will do a infinite running script. Edit: Using repeat until won't make a infinite running script. function fadeElement(ele, way) -- way true for in, false for out local allow = false local gui = false local alphaG = false local alphaS = false if supportedElements[getElementType(ele)] then allow = true alphaG = getElementAlpha alphaS = setElementAlpha elseif string.find(getElementType(ele), "gui") then allow = true alphaG = guiGetAlpha alphaS = guiSetAlpha end if not allow then debug.w("Invalid argument(1, 'element') @ fadeElement. Specified element is not allowed") else if way then repeat alphaS(ele,alphaG(ele)+DIFFERENCE) until alphaG(ele) < 255 elseif not way then repeat alphaS(ele, alphaG(ele)-DIFFERENCE) until alphaG(ele) > 0 do end end end end But, I don't understand why it doesn't set the alpha, it set's once then again to 1.
  12. Show me your deaths counter script.
  13. Castillo

    Killscript

    See? that's what I told him, the bug was in the meta.xml, I have enough scripting experience to know that it was working.
  14. Well, if it's a bug, I can say, it's a pretty cool one o_O, I would love real MTA bots .
  15. Castillo

    Killscript

    So, could you explain why you put it if there's no point?
  16. Castillo

    Killscript

    The script should work if you setup up it's meta.xml correctly. P.S: Bandi, the second argument is theKiller, that's not required, please take some time reading the required arguments. Required Arguments: thePed: The ped to kill
  17. Does anyone know what hour will be that for Argentina? so I can know if I can join or not. Thanks in advance. P.S: Keep up the good work!
  18. This forum is english-only, please re-make your topic in the spanish section. https://forum.multitheftauto.com/viewfor ... 9ae0da5fb4
  19. Freecam is a resource that comes with MTA when you install it.
×
×
  • Create New...