Jump to content

NodZen_42

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by NodZen_42

  1. Bueno, Yo también hablo castellano, soy de Argentina. Voy a probar el script que me diste, y te aviso si funciona. 

  2. Hello guys, i need help with this. The idea is to create a dxDrawimage according to the zombie kills of the player, but it does not work. exports.scoreboard:addScoreboardColumn('Zombie kills') addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) givePlayerMoney(killer,50) addPlayerZombieKills(killer) end) function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if not zombieKills then setAccountData(account,"Zombie kills",0) end setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if zombieKills then setElementData(source,"Zombie kills",tostring(zombieKills)) else setElementData(source,"Zombie kills",0) end end) addEvent("onZombieWasted", true) addEventHandler("onZombieWasted", root, function (killer) addPlayerRanks (killer) end ) function addPlayerRanks(killer) local account = getPlayerAccount(source) local zombie_kills = getAccountData(account, "Zombie kills") if (zombie_kills >=0) and (zombie_kills <= 100) then setElementData(source, "Medalla", "Novato") elseif (zombie_kills >=101) and (zombie_kills <= 500) then setElementData(source, "Medalla", "Experimentado") end end ---------client local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local datos_cuenta = getElementData(source, "Medalla") if datos_cuenta == "Novato" then dxDrawImage(screenW-250, screenH-70,80,80,"Rangos/Novato.png") elseif datos_cuenta == "Experimentado" then dxDrawImage(screenW-250, screenH-70,80,80,"Rangos/Experimentado.png") end end ) Any help? Thanks.
  3. Can I talk to you by private message?
  4. Hi guys. I have a doubt. I want to make a script in which according to the "zombie kills" an image is created on the screen of that player. Now, to get the account information I need to use "getAccountData" and "getPlayerAccount", but these functions are only "server side", while "dxDrawImage" is a client and I also have to use "onClientRender". The question is .. How can I make this script?
  5. Hi guys, i need help with my script. The idea is to create a dxDrawimage depending of the skin of the player local screenW, screenH = guiGetScreenSize() function crear_image_team () local get_P_Model = getElementModel(getLocalPlayer()) if get_P_Model == 287 then militares = dxDrawImage(screenW-280, screenH-100, 20, 20, "Factions/Militares.png",0.0,0.0,0.0,tocolor(255,255,255,200)) outputChatBox("se te asigno un escudo militares", source, 255,255,255) elseif get_P_Model == 29 or get_P_Model == 73 or get_P_Model == 79 then bandidos = dxDrawImage(screenW-280, screenH-100, 20, 20,"Factions/Bandidos.png",0.0,0.0,0.0,tocolor(255,255,255,200)) outputChatBox("se te asigno un escudo bandidos", source, 255,255,255) end end addEventHandler("onClientRender",root,crear_image_team) addEventHandler("onPlayerSpawn", resourceRoot,crear_image_team) function changer () addEventHandler("onClientRender", getRootElement(), crear_image_team) end addEventHandler( "onClientResourceStart", resourceRoot, changer ) addEventHandler( "onPlayerJoin", resourceRoot, changer ) It doesn't work... Any help¿?
  6. I don't understand. That would be all the script? or just a part?
  7. Hi guys, i need help with script. The idea is if the player is "mercenarios" then create a image in the screen of that player. But, my script doesn't work. Any help? function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end local screenW, screenH = guiGetScreenSize() function teams_images () local team_mercenarios = isPlayerInTeam(source,"Mercenarios") if team_mercenarios then dxDrawImage(100, 100, 40,40,"mercenarios.png") end end addEventHandler("onClientPlayerSpawn", getLocalPlayer(),teams_images)
  8. Hi guys, i need your help with my script. function setear_humanos () local GET_TEAM_HUMANOS = isPlayerInTeam(source, "Humanos") if GET_TEAM_HUMANOS then setElementModel(source, skins_humanos[math.random(#skins_humanos)][1]) outputChatBox("Ahora eres humano", source, 0,200,0) end end addEventHandler("onPlayerSpawn",root, setear_humanos) The error is "attempt to call global" in the isPlayerInTeam function
  9. Hola Chicos, estoy aprendiendo esto del scripting y bueno, tengo este error con mi script function setear_humanos () local GET_TEAM_HUMANOS = isPlayerInTeam(source, "Humanos") if GET_TEAM_HUMANOS then setElementModel(source, skins_humanos[math.random(#skins_humanos)][1]) outputChatBox("Ahora eres humano", source, 0,200,0) end end addEventHandler("onPlayerSpawn", root, setear_humanos) Alguna ayuda?
  10. The script doesn't work. The console says : Bad argument @ 'getTeamFromName' [Expected string at argument 1, got table]
  11. something like this? local equipos = {"Zombies", "Humanos" } function crear_equipos () createTeam ("Zombies", 255,0,0) createTeam("Humanos", 0, 200,0) end addEventHandler("onResourceStart", getRootElement(), crear_equipos) function setear_equipos () local check_team = getTeamFromName("Zombies") if check_team then setPlayerTeam(source, check_team) else local check_team2 = getTeamFromName("Humanos") if check_team2 then setPlayerTeam(source, check_team2) end end end addEventHandler("onPlayerSpawn", root, setear_equipos)
  12. Hi users. I need your help with my simple script. I'm new with this. I just want to set the player in a random team, but it doesn't work. Any help ? The console says this "Bad argument @ 'setPlayerTeam' [Expected team at argument 2, got string 'Zombies']" Thanks Server local equipos = {"Zombies", "Humanos" } function crear_equipos () createTeam ("Zombies", 255,0,0) createTeam("Humanos", 0, 200,0) end addEventHandler("onResourceStart", getRootElement(), crear_equipos) function setear_equipos () if equipos then setPlayerTeam(source, equipos[math.random(#equipos)]) end end addEventHandler("onPlayerSpawn", root, setear_equipos)
×
×
  • Create New...