Search the Community

Showing results for tags 'weapons'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • Open Source Contributors
    • Suggestions
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Gang


Location


Occupation


Interests

Found 19 results

  1. So i have a shop script wich pretty much allows to buy items/weapons from this shop, the shop sells with "K.B.K Points" which is the player money but with another name to fit the server. The problem i have is when player buys one of the item they get all of them. I want to make them get the item they buy ONLY and get the right amount, for example if you buy a MK 48 Mod 0 Mag, you should get 100x of this item in your inventory because the mag itself is 100, otherwise wich ive tested it only gave 1x. But the problem is when i add more lines which i have shown below, it gives the player all the items listed below, i was trying to use if, and else if, but because i lack experience in lua coding i was not able to debug this even with debugscript! I would appreciate if someone could work out or help me out on how to make the shop only give the player the item the player buys and the right amount! The "+1" in the lists are the amount the player should get! If you need more of the code to understand and help me out then i will add it on request local items = { --items,cena(K.B.K Points) {"M1911",50}, {"PDW",150}, {"Winchester 1866",150}, {"AK-107",300}, {"M4A1 Holo",300}, {"MK 48 Mod 0",450}, {"CZ550",300}, {"DMR",400}, {"M1911 Mag",50}, {"PDW Mag",100}, {"1866 Slug",125}, {"AK-107 Mag",100}, {"M4A1 Holo Mag",50}, {"MK 48 Mod 0 Mag",200}, {"CZ550 Mag",50}, {"DMR Mag",25}, {"Medic Kit",50}, {"Painkiller",10}, {"Morphine",10}, {"Bandage",5}, {"Water Bottle",15}, {"Burger",15}, {"Tire",75}, {"Engine",125}, {"Tank Parts",50}, {"Camouflage Clothing",100}, {"Army Clothing",150}, {"Ghost Clothing",200}, {"K.B.K Backpack",150}, {"Ghillie Suit",200}, {"Civilian Clothing",30}, {"GPS",15}, {"Map",15}, {"Toolbox",25}, } SHOP = { button = {}, window = {}, gridlist = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() SHOP.window[1] = guiCreateWindow(0.17, 0.23, 0.65, 0.55, "Kill Or Be Killed Shop", true) guiWindowSetMovable(SHOP.window[1], false) guiWindowSetSizable(SHOP.window[1], false) guiSetProperty(SHOP.window[1], "CaptionColour", "FF075205") SHOP.gridlist[1] = guiCreateGridList(0.01, 0.06, 0.97, 0.63, true, SHOP.window[1]) column = guiGridListAddColumn(SHOP.gridlist[1], "Item", 0.5) column2 =guiGridListAddColumn(SHOP.gridlist[1], "K.B.K Points", 0.5) for _, v in ipairs(items) do local row = guiGridListAddRow ( SHOP.gridlist[1] ) guiGridListSetItemText ( SHOP.gridlist[1], row, column, v[1], false, false ) guiGridListSetItemText ( SHOP.gridlist[1], row, column2, v[2].."", false, false ) end guiSetProperty(SHOP.gridlist[1], "SortSettingEnabled", "False") SHOP.label[1] = guiCreateLabel(0.02, 0.69, 0.97, 0.08, "Select item which you want to buy! \nThe shop value is K.B.K Points", true, SHOP.window[1]) guiLabelSetColor( SHOP.label[1],255,255,255) guiSetFont(SHOP.label[1], "default-bold-small") guiLabelSetHorizontalAlign(SHOP.label[1], "center", true) guiLabelSetVerticalAlign(SHOP.label[1], "center") SHOP.button[1] = guiCreateButton(0.35, 0.79, 0.30, 0.12, "BUY", true, SHOP.window[1]) guiSetFont(SHOP.button[1], "default-bold-small") guiSetVisible ( SHOP.window[1], false ) addEventHandler ( "onClientGUIClick", SHOP.gridlist[1], click ) addEventHandler ( "onClientGUIClick", SHOP.button[1], buttonClick ) end ) bindKey ( "f4", "down", function ( ) if getElementData(localPlayer, "logedin") then -- if getElementData (getLocalPlayer(),"playerlevel") >= 3 then local state = ( not guiGetVisible (SHOP.window[1]) ) guiSetVisible ( SHOP.window[1], state ) showCursor ( state ) -- else -- outputChatBox (" 3!") -- end end end ) function buttonClick(button) if getElementData(localPlayer, "logedin") then if button == "left" then local nRow, nColumn = guiGridListGetSelectedItem( SHOP.gridlist[1] ) if nRow ~= -1 and nColumn ~= - 1 then local selectedItem = guiGridListGetItemText ( SHOP.gridlist[1], guiGridListGetSelectedItem ( SHOP.gridlist[1] ), 1 ) local price = guiGridListGetItemText ( SHOP.gridlist[1], guiGridListGetSelectedItem ( SHOP.gridlist[1] ), 2 ) local money = getPlayerMoney(thePlayer) if (money) >= tonumber(price) then guiLabelSetColor( SHOP.label[1],255,255,255) -- guiSetText( SHOP.label[1],"pietiek nauda") setPlayerMoney(money -tonumber(price)) setElementData(getLocalPlayer(),"PDW",getElementData(getLocalPlayer(),"PDW")+1) setElementData(getLocalPlayer(),"Winchester 1866",getElementData(getLocalPlayer(),"Winchester 1866")+1) setElementData(getLocalPlayer(),"M1911",getElementData(getLocalPlayer(),"M1911")+1) setElementData(getLocalPlayer(),"AK-107",getElementData(getLocalPlayer(),"AK-107")+1) setElementData(getLocalPlayer(),"M4A1 Holo",getElementData(getLocalPlayer(),"M4A1 Holo")+1) setElementData(getLocalPlayer(),"DMR",getElementData(getLocalPlayer(),"DMR")+1) setElementData(getLocalPlayer(),"CZ550",getElementData(getLocalPlayer(),"CZ550")+1) setElementData(getLocalPlayer(),"MK 48 Mod 0",getElementData(getLocalPlayer(),"MK 48 Mod 0")+1) setElementData(getLocalPlayer(),"M4A1 Holo Mag",getElementData(getLocalPlayer(),"M4A1 Holo Mag")+20) setElementData(getLocalPlayer(),"DMR Mag",getElementData(getLocalPlayer(),"DMR Mag")+5) setElementData(getLocalPlayer(),"CZ550 Mag",getElementData(getLocalPlayer(),"CZ550 Mag")+10) setElementData(getLocalPlayer(),"M1911 Mag",getElementData(getLocalPlayer(),"M1911 Mag")+100) setElementData(getLocalPlayer(),"PDW Mag",getElementData(getLocalPlayer(),"PDW Mag")+10) setElementData(getLocalPlayer(),"1866 Slug",getElementData(getLocalPlayer(),"1866 Slug")+7) setElementData(getLocalPlayer(),"MK 48 Mod 0 Mag",getElementData(getLocalPlayer(),"MK 48 Mod 0 Mag")+100) setElementData(getLocalPlayer(),"Medic Kit",getElementData(getLocalPlayer(),"Medic Kit")+1) setElementData(getLocalPlayer(),"Painkiller",getElementData(getLocalPlayer(),"Painkiller")+1) setElementData(getLocalPlayer(),"Morphine",getElementData(getLocalPlayer(),"Morphine")+1) setElementData(getLocalPlayer(),"Bandage",getElementData(getLocalPlayer(),"Bandage")+1) setElementData(getLocalPlayer(),"Water Bottle",getElementData(getLocalPlayer(),"Water Bottle")+1) setElementData(getLocalPlayer(),"Burger",getElementData(getLocalPlayer(),"Burger")+1) setElementData(getLocalPlayer(),"Tire",getElementData(getLocalPlayer(),"Tire")+1) setElementData(getLocalPlayer(),"Engine",getElementData(getLocalPlayer(),"Engine")+1) setElementData(getLocalPlayer(),"Tank Parts",getElementData(getLocalPlayer(),"Tank Parts")+1) setElementData(getLocalPlayer(),"Camouflage Clothing",getElementData(getLocalPlayer(),"Camouflage Clothing")+1) setElementData(getLocalPlayer(),"Army Clothing",getElementData(getLocalPlayer(),"Army Clothing")+1) setElementData(getLocalPlayer(),"Ghost Clothing",getElementData(getLocalPlayer(),"Ghost Clothing")+1) setElementData(getLocalPlayer(),"K.B.K Backpack",getElementData(getLocalPlayer(),"K.B.K Backpack")+1) setElementData(getLocalPlayer(),"Ghillie Suit",getElementData(getLocalPlayer(),"Ghillie Suit")+1) setElementData(getLocalPlayer(),"Civilian Clothing",getElementData(getLocalPlayer(),"Civilian Clothing")+1) setElementData(getLocalPlayer(),"GPS",getElementData(getLocalPlayer(),"GPS")+1) setElementData(getLocalPlayer(),"Map",getElementData(getLocalPlayer(),"Map")+1) setElementData(getLocalPlayer(),"Toolbox",getElementData(getLocalPlayer(),"Toolbox")+1) end guiLabelSetColor( SHOP.label[1],10,255,10) guiSetText( SHOP.label[1],"You succesfully bought "..selectedItem.." and you still have "..(money -tonumber(price)).." K.B.K Points") else guiLabelSetColor( SHOP.label[1],255,10,10) guiSetText( SHOP.label[1],"You are missing "..(price -tonumber(money)).." K.B.K Points") end else guiSetText( SHOP.label[1],"Select something first") guiLabelSetColor( SHOP.label[1],255,255,255) end end end function click () local selectedItem = guiGridListGetItemText ( SHOP.gridlist[1], guiGridListGetSelectedItem ( SHOP.gridlist[1] ), 1 ) local price = guiGridListGetItemText ( SHOP.gridlist[1], guiGridListGetSelectedItem ( SHOP.gridlist[1] ), 2 ) guiSetText( SHOP.label[1],"To buy "..selectedItem.." for "..price.." K.B.K Points press button below") guiLabelSetColor( SHOP.label[1],255,255,255) end
  2. Hello guys I need help to create a script for a kit of weapons you know how to do? I would like with a command gives me the kit of weapons for example I do / kit and gives me weapons if you know you tell me please!
  3. -- This piece of code in located in the 'onPlayerQuit' event handler. It saves the player's weapons and ammo if he has any, this is all working correctly local weapons = {} for slot = 1, 12 do local weapon = getPedWeapon(source, slot) if weapon > 0 then local ammo = getPedTotalAmmo(source, slot) if ammo > 0 then table.insert(weapons, {weapon, ammo}) end end end -- This is what appears under the 'weapons' column in the player's account table entry [ [ [ 30, 176 ] ] ] -- Which means the player left the server and had an AK-47 with total 176 ammo left -- And this is the part which loads the SQL weapons data for weapon, ammo in ipairs(fromJSON(accountData.weapons)) do giveWeapon(player, tonumber(weapon), tonumber(ammo)) end -- The problem is, the player doesn't get the weapons he has saved, instead, he'll be given a brassknuckle everytime and the SQL entry is reset Any ideas why it is not working properly? I'm using SQLite not MySQL. The weapons are saved correctly, so it would seem that the problems stems in the loading part.
  4. Badboysteve

    Weapons

    Hi am looking for a script that is a custom damage modifier instead of the original gta sa weapons i want to change the range of guns damage and also accuracy am max clip a gun can hold is that possible?
  5. Hello! I need to use attachElements with an object in a player's gun, but from what I noticed the player's weapon is not recognized as "element". Code: function customM4(source) if getPedWeapon(source) == 31 then local gunModel = createObject(1487, 1, 2, 3) attachElements(gunModel, getPedWeapon(source)) end end addCommandHandler("m4skin", customM4)
  6. Salvation

    Changing anims of weapons

    Hi, guys, i'm a belarusian, so i'm sorry for my bad english. My suggestion is that you should add a possibility to change animations of guns, so i could shoot and hold colt45 or another guns like a normal guy, not a gangsta :O :~ guy. This issue is already exist since 2014 https://bugs.mtasa.com/view.php?id=8396 I like roleplay servers so i wish u will add this function soon. Thanks.
  7. I want to force the player to run and aim at the same time with machine guns. (M4, AK47)
  8. Hello all MTA community recently I checked in my server that I need to do some settings like rhino I wanna make rhino for timer purpose like all can buy rhino but for minimum time -10 min 0r 5min till he die !how can I ? From fr-cilent .Lua or should I need add any other way ? Next is : I want to give more effect of ammos for ak47,m4 more ammo ,for snatchels and grenades I mean when I throw 1 grenade the other player must die even if he is with armour+health ,in recently MTA by thrwoing 4 grenades or snatchels only able to make player die ! anyone suggest me how to ? Please let me know Another one is for freeroam servers many use binds to regain more kills ,when they snatchel they recently use it has blast too I want to add this to as timer (wait 10 sec to use another key ) Let me know pls
  9. Working on a First Person Shooter gamemode, and i found a bug. The event onClientPreRender causes some delay at attachElements. Can somebody reproduce attachElements maths for me?
  10. Domingos MTA

    New Weapons

    Does anyone have a script that does this, or do you know how to make these new weapons? If yes please teach me !!
  11. Sami_~>

    how to block vehcile?

    help! can anyone tell me how to block rino and some vehicle. please......
  12. can any one say me how can i block weapons like rpg,minigun,rocket launcher etc..
  13. Anoymus

    Crafting Weapons

    Salut ... m-am gandit ca ar fi o idee buna sa adaugati un mod de crafting de arme... si m-am gandit si cum sa functioneze : Arma: -Un om este plasat pe harta (un om care vinde materialele .. sa zicem ca il cheama Jonny McGregor) -Cumperi materialele ... (sa fie o comanda sa vezi cate materiale ai ... /wepmaterials , /materialsview .. ) -Dupe ce cumperi materialele.. craftezi arma.. -Sa fie o comanda pentru a crafta arma (/buildweapon [id] ex. colt [5] , ak47 [7] etc etc ... ) -Dupa care ai acceasi animatie ca la HACKER ! Dupa ce o crafteaza o vei putea avea in inventar si saa te joci cu ea .. Un mic exemplu : Te duci Jonny McGregor apesi m si dai click dreapta pe el ... Alegi materiale pentru ce arma doresti ... ex . colt , sniper , ak , akm , etc Dupa ce ai cumparat materialele .. dai /buildweapon 5 - care ne v-a crafta un Colt.45 Si gata .. dupa ce ai asteptat sa se crafteze arma ... o vei putea vedea in inventar ... Ok dar... am arma... dar munitie ?! Munitie: -Un dealer plasat pe harta care vinde cartuse pentru diferite arme .. (pentru colt unul sa fie in LS ... pentru AK unul sa fie in SF etc etc) -Faza e simpla ... cumperi cartuselesi gata... Asa ar fi o ideie mai buna decat sa te chinui cu Gang-urile si Mafile ca sa poti obtine o arma SPER CA IDEEA MEA A FOST DE FOLOS !
  14. Hello there, I've been trying to create a weapon (uzi) and attach it on a vehicle (hydra) the weapon should fire when I click the left mouse button. I am stuck at the very beginning of the script (trying to get the uzi to spawn) and I just cannot progress any further. function hydraGuns() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then if getElementModel(vehicle) == 520 then local x, y, z = getElementPosition(vehicle) local weapon = createWeapon("uzi", x, y, z) outputChatBox ("Hydra guns are installed") end end end What am I doing wrong?
  15. Turbo777

    Why not working buyWeapon?

    function buyWeapon(thePlayer, command) local mycoins = exports.coinsystem:getPlayerCoin(thePlayer) if (mycoins >= 1) then giveWeapon(thePlayer, 31, 2000) exports.coinsystem:takePlayerCoin(thePlayer, prize) outputChatBox("you bought a M4.", thePlayer, 0, 255, 0, false) else outputChatBox("you don't have enough coins!", thePlayer, 255, 0, 0, false) end end addCommandHandler("buyw", buyWeapon) i got this error: xy.lua:17: attempt to compare number with nil
  16. Attention I have created this topic to tell you everyone that I am going to freelance in MTA:SA. As you don't know I am working with MTA:SA since 2013 and I have a lot of experience. If you are interested in any of MTA:SA (like DayZ) resouces, scripts or other things, just tell me what you want and I will sell it to you. Also I can teach you how to make some kind of scripts/resources/models/etc. by yourself, how to add it to the server. I can be your server scripter/mapper/hacker/etc., just hire me. Don't be shy You can contact me via e-mail (herokileris@gmail.com) or skype (herokileris), or here in the forum (this topic or pm). For example, some of the scripts I have made and I can sell you: Vip - (in DayZ) gets more blood, restorations when eating, using medics, drinking... Also gets more stats after each spawning in the map. Animals in the map spawning and has an inventory in which they drop randomly Raw Meat after death. Respawn timer works perfectly. Zombies changed their status from walking or running, how they walk like randomly in the game, they scream, moan, bite your neck, infect you. Also I have a lot of DAYZ zombie models and sounds. Weapons system - each weapon has own model and shooting sound, inventory space slots, the name, the spawning chances, damage, ammo use, crosshire (including and snipers). Hold your breath system - when you aim, your crosshire moves, you can hold your breath and stop moving crosshire by holding a key like for example: for a 5 seconds. There are sounds added also for it. Sounds for you and others when you use medics, food, drinks, etc. like in the real life depending on the distance. Armour, hats, helmets, masks, caps and other clothing systems. MORE AND MORE. Group system. Scoreboard system. Give/Set items system. Map bugs fixer. Radiators, engines, tires, rotors, scrap metals, tank parts, etc. system for vehicles. AND MORE. I have all .lua files.
  17. Hello, I have been looking for a way to check if melee damage was dealt with a weapon, because I want to add a gears of war animation when hit with a weapon, I was looking at the MTA Damage Types, found this: Does anyone have an Idea what can I use to accomplish this? thanks!
  18. Hello any1 knows how to add more guns on server? I have dayz server and i would like to get some help. Just tell me here or contact me if you know how to script.
  19. dominic1064

    Error Weapons Help Me Plz

    Guns Do not Work Error In MTA I play with my friends with heavy weapons and all that and reads * WARNING * Player * have * a * weapon * WARNING * Dominic1064 example has a Rocket Launcher help me plz tell me to play more good