Jump to content

ViRuZGamiing

Members
  • Posts

    1,050
  • Joined

  • Last visited

Everything posted by ViRuZGamiing

  1. Yes he does, to give you more inside in the code i'm going to explain it with the comments "-- text". local weaponsToDamageRhino = { [35] = true, -- basis RPG [36] = true, -- Heatseaking RPG -- You can add different weapons too apart from RPG, if not then a table isn't necessarily needed. -- The [number] is the weapon ID, true means it's valid, every other number returns false. } function handleRhinoDamage(attacker, weapon, loss, x, y, z, tyre) if (weapon and getElementModel(source) == 432 and loss > 0) then -- if the weapon exists and the vehicle being shot is a Rhino and -- the damage dealt isn't 0 but any number higher then do the following. if (weaponsToDamageRhino[weapon]) then -- if the weapon is one of the valid ID's above (35 'true' and 36 'true') then do the following. setElementHealth(source, getElementHealth(source) - loss) -- set the health (life points) of the Rhino (source is the vehicle being shot) -- too the current health minus the loss. end end end addEventHandler("onClientVehicleDamage", root, handleRhinoDamage)
  2. 1350 is already a Number, do make it a Number (remove tonumber() j
  3. Any 3D Modeling software should do, Free; Blender Paid; 3DS Max, Cinema 4D, Maja, Zbrush, etc. I'm not familiar with these programs. Just know them. I hope this helped you. If you Ask me C4D is the easiest to learn/understand. Regards Viruz
  4. https://wiki.multitheftauto.com/wiki/IsPedChoking
  5. https://wiki.multitheftauto.com/wiki/Cr ... AttachedTo https://wiki.multitheftauto.com/wiki/GetPlayersInTeam Loop through the player his team members and create the blips attached to those players. It think this would work (not tested), Regards Viruz
  6. https://wiki.multitheftauto.com/wiki/OnClientGUIClick https://wiki.multitheftauto.com/wiki/PlaySound
  7. Made a capital mistake, sry for bothering
  8. Hello, First I'll ask my question if code is needed I'll post it. The problem is; onResourceStart => retrieve data from XML => Store in a table onPlayerLogin => retrieve data from table Error interval is empty (a.k.a Table is empty)
  9. bone_attach and weapon object
  10. This is what I have now as a fix; function spawnHandler (source) giveWeapon(source, 22, 1, true) giveWeapon(source, 4, 1, false) end function spawnBuffer () setTimer (spawnHandler, 1000, 1, source) end addEventHandler("onPlayerSpawn", getRootElement(), spawnBuffer) function deadHandler (ammo, attacker, weapon, bodypart, stealth) if (attacker) then outputChatBox(tostring(getPlayerName(attacker)).." killed "..tostring(getPlayerName(source)).."!") if (weapon) then takeWeapon(attacker, weapon) local getAmmo = getPedTotalAmmo(attacker, 2) local setAmmo = getAmmo + 1 giveWeapon (attacker, weapon, setAmmo, true) triggerClientEvent("onPlayerDeadScore", source, attacker, weapon, bodypart) end end end addEventHandler ("onPlayerWasted", getRootElement(), deadHandler) validValues = { [4] = true, [22] = true } function oneHit (attacker, weapon, bodypart, loss) if (attacker) then if validValues[weapon] then killPed (source, attacker, weapon, bodypart, false) else outputChatBox("[ERROR] 2: No valid weapon!") end else outputChatBox("[ERROR] 1: No valid attacker!") end end addEventHandler ("onPlayerDamage", getRootElement(), oneHit) function killCmd (thePlayer) killPed(thePlayer) end addCommandHandler("kill", killCmd) I get 2 problems, • No gun received on kill with Knife, but with Pistol it is. • admin\server\admin_server.lua:1458: Admin security - Client/player mismatch from 192.168.x.x (onElementDataChange score)
  11. Actually I do, I have both weapons changed with a client side script. function loadSkins() txd1 = engineLoadTXD ( "textures/colt45.txd" ) engineImportTXD ( txd1, 346 ) dff1 = engineLoadDFF ( "textures/colt45.dff", 0 ) engineReplaceModel ( dff1, 346 ) txd2 = engineLoadTXD ( "textures/knife.txd" ) engineImportTXD ( txd2, 335) dff2 = engineLoadDFF ( "textures/knife.dff", 0 ) engineReplaceModel ( dff2, 335) local armytxd = engineLoadTXD ("textures/armyskin.txd") engineImportTXD (armytxd, 2) local armydff = engineLoadDFF ("textures/armyskin.dff", 0) engineReplaceModel (armydff, 2) local vectortxd = engineLoadTXD ("textures/vector.txd") engineImportTXD (vectortxd, 7) local vectordff = engineLoadDFF ("textures/vector.dff", 0) engineReplaceModel (vectordff, 7) end function timerFunction () setTimer (loadSkins, 1000, 1) end addEventHandler("onClientResourceStart", resourceRoot, timerFunction)
  12. Hello, me and my friend were testing my gamemode but it seems it doesn't kill with 1 hit, when having weapon 22 or 4. Also we can't see eachother's guns. Code: Regards ViRuZ
  13. GetDistanceBetweenPoints3D or GetDistanceBetweenPoints2D and check if distance is smaller then 1, maybe? not sure.
  14. ammo represents the victims ammo, didn't read that. thought killer ammo. Probably fixed.
  15. Because of the ammo is 1 and you shoot, you lose your gun. Now it gives you a gun.
  16. Look at the code, I have it all, the problem is it's not giving the correct amount of ammo
  17. Hi guys, I need some help the point is, when I shot and I hit it's 1 hit dead, if dead then give the bullet back. Example: 1 bullet, gets the kill, still 1 bullet 2nd Example: 1 bullet, miss the kill, 0 bullets 3th Example: 0 Bullets, knifes, 1 bullet Code: function spawnHandler () takeAllWeapons (source) giveWeapon(source, 22, 1, true) giveWeapon(source, 4, 1) end addEventHandler("onPlayerSpawn", getRootElement(), spawnHandler) function deadHandler (ammo, attacker, weapon, bodypart) if (attacker == false) then outputChatBox(tostring(getPlayerName(source)).." commited suicide!") elseif (attacker == true) then outputChatBox(tostring(getPlayerName(attacker)).." killed "..tostring(getPlayerName(source)).."!") giveWeapon(attacker, 22, 1, true) wSlot = getSlotFromWeapon (weapon) tAmmo = getPedTotalAmmo (attacker, wSlot) tAmmo = tAmmo + 1 takeWeapon(attacker, 22) giveWeapon(attacker, 22, tAmmo, true) if ( bodypart == 9 ) then if ( weapon == 22 ) then outputChatBox("HEADSHOT!") elseif (weapon == 4) then outputChatBox("KNIFE KILL!") end end end end addEventHandler ("onPlayerWasted", getRootElement(), deadHandler ) function oneHit ( attacker, weapon ) if ( weapon == 22 or 4) then if (getElementType(attacker) == "player") then killPed (source) end end end addEventHandler ( "onPlayerDamage", getRootElement (), oneHit )
  18. Maybe with 3D text? and then decreased the font size if the text is longer then the width of the plate.
  19. https://wiki.multitheftauto.com/wiki/Se ... ePlateText No modding needed
  20. You mean the pickups? Solidsnake.
  21. get to know the basics of scripting instead of requesting free scripts. We'll help, not create it.
×
×
  • Create New...