• Content count

  • Joined

  • Last visited

Community Reputation

4 Neutral

About chris1384

  • Rank
  • Birthday 05/11/2001


  • Gang
  • Location
    România, Focșani
  • Occupation
    doing simple lua things
  • Interests

Recent Profile Visitors

361 profile views
  1. [Help] Custom grenade

    Learned a lot from your code, I didn't know how to deal with the "onClientRender" and "onClientColshapeHit" events, so I though tables were a good idea for solving this . Thanks!
  2. [Help] Custom grenade

    Hi there! I was working on a custom grenade and got stuck into this issue: addEventHandler("onClientProjectileCreation", root, function(creator) if getProjectileType(source) == 17 then setTimer(markerfunc, 2000, 1, source) end end) ms = 0 mst = 0.5 function markerfunc(elem) local x,y,z = getElementPosition(elem) setElementPosition(elem, 0,0,0) m = createMarker(x,y,z,"cylinder",1,0,255,0,255) col = createColSphere(x,y,z,mst*12) addEventHandler("onClientRender", root, markersize) addEventHandler("onClientColShapeHit", col, colhit) setTimer(function() removeEventHandler("onClientColShapeHit", col, colhit) removeEventHandler("onClientRender", root, markersize) destroyElement(m) destroyElement(col) ms = 0 end, 500, 1) end function markersize() ms = ms + mst setMarkerSize(m, ms) local mx,my,mz = getElementPosition(m) setElementPosition(m, mx, my, mz-mst/1.3) end function colhit(thePlayer, matchingDimension) if getElementType ( thePlayer ) == "player" then outputChatBox(tostring(getPlayerName(thePlayer))) end end - "So.. What's the problem?" you may ask. Well, the problem is when 2 players throw a teargas simultaneously, one of the markers does not dissapear, and a debug error appears that something's wrong with the lines 18 - 21. Maybe a table is needed..? Someone?
  3. [Question] Race Spectator

    Getting a vehicle health when using setCameraTarget on a different player I meant, not from localPlayer. Nevermind, solved
  4. [Question] Race Spectator

    Hi there! I'm working at the race resource and I was wondering if I can get the spectator target's health and nitro and other elements data (like.. I'm spectating a player and I want to know how much nitro he has left). Is it possible? And how?
  5. [Help] onPlayerWasted issue

  6. [Help] onPlayerWasted issue

    Sorry for the late response, but before making this topic I edited something in the LUA code and I didn't noticed it was wrong edited. However, this is the part that really kills me and I still didn't figured out how to fix it: if getElementData(source, "zp_Class") == "Zombie" and #table_allZombiesAlive == 1 then outputChatBox("true", root) end When the player is infected by a zombie, (using onPlayerDamage) I use again updateTeamTables() to update the tables, but as it mentioned before, it doesn't update correctly so after the zombie is killed nothing happens, but after the round start and the zombie choosed infects another player, triggers the outputChatBox function.s. Edit: Maybe the updateTeamTables() isn't necessary, but I don't know an alternative to that. Someone?
  7. [Help] onPlayerWasted issue

    Did it with a tester Before round start (or resource start): 0 humans alive , 0 zombies alive After round start (choosing random zombie): 2 humans alive, 0 zombies alive After zombie killed (onPlayerWasted): 1 human alive, 1 zombie alive
  8. [Help] onPlayerWasted issue

    Hi there. Recently I have this issue with this part of the code, I'm trying to trigger something with onPlayerWasted, but it looks like the updateTeamTables() is not updated as it should be. To be more explicit, if there's only one zombie in the team, it should trigger the outputChatBox function, but that doesn't happen. Can someone help? Thanks. function updateTeamTables() table_allHumans = {} table_allHumansAlive = {} table_allZombies = {} table_allZombiesAlive = {} for k,v in ipairs(getElementsByType("player")) do if isPlayerInTeam(v, team_Humans) then table.insert(table_allHumans, v) if getElementData(v, "State") == "Alive" then table.insert(table_allHumansAlive, v) end elseif isPlayerInTeam(v, team_Zombies) then table.insert(table_allZombies, v) if getElementData(v, "State") == "Alive" then table.insert(table_allZombiesAlive, v) end end end end addEventHandler("onPlayerWasted", root, function(ammo, attacker, weapon, bodypart) updateTeamTables() for k,v in ipairs(getElementsByType("player")) do if getElementData(v, "zp_Class") == "Spectator" then setspectator(v) end end if getElementData(source, "zp_Class") == "Zombie" then if attacker ~= nil and isElement(attacker) then setspectator(source) local scr = getElementData(attacker, "Score") setElementData(attacker, "Score", tonumber(getElementData(attacker, "Score")+2)) end end local dths = getElementData(source, "Deaths") setElementData(source, "Deaths", tonumber(dths + 1)) setElementData(source, "State", "Dead") setElementData(source, "zp_Class", "None (Dead)") local allHumans = getPlayersInTeam(team_Humans) local allZombies = getPlayersInTeam(team_Zombies) elseif getElementData(source, "zp_Class") == "Zombie" and #table_allZombiesAlive == 1 then outputChatBox("true", root) end end)
  9. [Question] Check if player's chatbox is opened

    Oh I didn't know about this function .Thank you!
  10. Is there a way to check if the player has the chatbox opened? I'm using onClientKey for choosing things and I want to cancel it if the player pressed 'T' for chatbox.
  11. Thanks everyone for your help!
  12. Hi there! Recently I have this problem with knockbacking the victim and instantaneosly stop the victim from walking/running. 1. I tried using spawnPlayer with current coordinates and position, but for a second it can be seen that once spawned it turns smoothly from 0 to 90 degrees. I wonder if there's an alternative for this: function cancelrun ( attacker, weapon, bodypart, loss ) if attacker ~= nil then if isPedOnGround(source) then local x,y,z = getElementPosition(source) local r = getElementRotation(source) local skin = getElementModel(source) local h = getElementHealth(source) spawnPlayer(source, x,y,z,r) setElementModel(source, skin) setElementHealth(source, h) end end end addEventHandler ( "onPlayerDamage", getRootElement(), cancelrun ) 2. With 'knockback' I mean if the victim is getting damage I want him to be pushed back. An example might be very helpful. Thanks!
  13. TOPIC UPDATE [⇉] NEW IP ADDRESS: mtasa://
  14. Welcome To RuthLess! (funi neim ik xd) UN SCURT ISTORIC: Serverul a fost infiintat pe data de 23.09.2016 din lipsa serverelor de calitate si de faptul ca scripting-ul este hobby-ul meu. La inceput serverul trebuia sa fie unul de Race, dar, vazand cat de jucat este acel gamemode (practic mort) mi-am schimbat parerea facand unul de Freeroam si incercand sa fac cel mai frumos server de Freeroam din Romania! De ce l-am numit 'RuthLess'? Este un cuvant ce ma reprezinta (sunt nemilos la DM/shooter sau alt GM cu arme) si mi s-a parut un cuvant potrivit pentru acest server. FEATURES: [⇉] Aproape toata interfata serverului este in ENGLEZA! [⇉] Resurse originale facute doar de fondator pentru un gameplay neasemanator cu celelalte servere! [⇉] Mape de tip DM Racing, Shooter, Drift, Jumps si arene de Deathmatch! [⇉] Panou Mod Manager (/mods) pentru activarea/dezactivarea masinilor, skin-urilor sau armelor modificate! [⇉] O tona de comenzi pentru modificarea masinii sau a caracterului! (Handling Editor, Upgrades, Paintjobs cu link-uri directe, Blinking Lights/Neons, Clothes, Walking/Fighting Styles etc.) [⇉] HUD si Scoreboard realizat in dx + animat pentru informatiile caracterului/masinii si panouri (Freeroam, Guide, Gang Panel etc.) pentru a ghida jucatorii noi! [⇉] Shadere (reflect, contrast, bloom), noi texturi aduse mapei cat si a masinilor (Taillights) pentru o grafica de mare calitate! [⇉] Serverul este actualizat zilnic cu noi comenzi/bugfix-uri si altele! [⇉] Alte resurse: Panou VIP, Speaker Manager cu Bass Effect (/sound), Anti-Spawnkill, Peacemode, Warps List (/warps), Level System, SpeedBooster, Drift System. [⇉] Comenzi pentru antilag destinate jucatorilor cu calculatoare vechi! CONECTARE + ALTE INFORMATII: Owner: chris1384 (skype: theidnx1384) Momentan serverul duce lipsa de host din cauza problemelor financiare. [⇉] IP ADDRESS: mtasa:// (localhost) [⇉] RECORD JUCATORI: 28 (27 - 29 dec. 2016) Totusi, cu primul server (Romania Minecraft Server realizat in 2011) am reusit sa strang 32/32 jucatori, printre acestia se numarau si vreo 12 admini! :)) WALKTHROUGH (PHOTOS): Cam atat. See you there!
  15. No Vehicle Taillights

    Yes I added the textures to meta, also the debugscript shows nothing. Maybe it has to do with the modded vehicles but I'm not sure..