Jump to content

kewizzle

Members
  • Posts

    164
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by kewizzle

  1. my progress bar doesnt change to my weapon stat stays frozen at the first number it was set to. client local stat8 = getPlayerStat (getLocalPlayer(),77) addEventHandler("onClientGUIClick", ak47B, function() if source == ak47B then triggerServerEvent ("setAK471",getLocalPlayer(),setAK471) guiProgressBarSetProgress(ak47Pr,tonumber(stat8/10)) end end) end) server addEvent("setAK471",true) addEventHandler("setAK471",root, function() if getPlayerStat(source,77) == 0 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 100) else if getPlayerStat(source,77) == 100 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 200) else if getPlayerStat(source,77) == 200 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 300) else if getPlayerStat(source,77) == 300 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 400) else if getPlayerStat(source,77) == 400 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 500) else if getPlayerStat(source,77) == 500 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 600) else if getPlayerStat(source,77) == 600 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 700) else if getPlayerStat(source,77) == 700 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 800) else if getPlayerStat(source,77) == 800 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 900) else if getPlayerStat(source,77) == 900 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then takePlayerMoney(source, getPlayerStat(source,77) + 2500) setPlayerStat(source, 77, 1000) else if getPlayerStat(source,77) == 1000 then outputChatBox("You maxed out your AK-47!",source,0,255,0) else local pMoney = getPlayerStat(source,77) local convertedMoney = convertNumber(pMoney + 2500) outputChatBox("$"..convertedMoney.." required to purchase this skill!",source,255,0,0) end end end end end end end end end end end end)
  2. hello i was wondering if it was possible to change progress bar max to 1000 instead of 100 so i can use it for this: addEventHandler("onClientMarkerHit", skillshop, function() local stat = getPlayerStat (getLocalPlayer(),69) local stat1 = getPlayerStat (getLocalPlayer(),70) local stat2 = getPlayerStat (getLocalPlayer(),71) local stat3 = getPlayerStat (getLocalPlayer(),72) local stat4 = getPlayerStat (getLocalPlayer(),73) local stat5 = getPlayerStat (getLocalPlayer(),74) local stat6 = getPlayerStat (getLocalPlayer(),75) local stat7 = getPlayerStat (getLocalPlayer(),76) local stat8 = getPlayerStat (getLocalPlayer(),77) local stat9 = getPlayerStat (getLocalPlayer(),78) guiProgressBarSetProgress(pistolPr, stat) guiProgressBarSetProgress(silencedPr, stat1) guiProgressBarSetProgress(deaglePr, stat2) guiProgressBarSetProgress(ShotgPr, stat3) guiProgressBarSetProgress(sawnoffPr, stat4) guiProgressBarSetProgress(spazPr, stat5) guiProgressBarSetProgress(tech9Pr, stat6) guiProgressBarSetProgress(mp5Pr, stat7) guiProgressBarSetProgress(ak47Pr, stat8) guiProgressBarSetProgress(m4Pr, stat9) end) figured it out addEventHandler("onClientMarkerHit", skillshop, function() local stat = getPlayerStat (getLocalPlayer(),69) local stat1 = getPlayerStat (getLocalPlayer(),70) local stat2 = getPlayerStat (getLocalPlayer(),71) local stat3 = getPlayerStat (getLocalPlayer(),72) local stat4 = getPlayerStat (getLocalPlayer(),73) local stat5 = getPlayerStat (getLocalPlayer(),74) local stat6 = getPlayerStat (getLocalPlayer(),75) local stat7 = getPlayerStat (getLocalPlayer(),76) local stat8 = getPlayerStat (getLocalPlayer(),77) local stat9 = getPlayerStat (getLocalPlayer(),78) guiProgressBarSetProgress(pistolPr, stat/10) guiProgressBarSetProgress(silencedPr, stat1/10) guiProgressBarSetProgress(deaglePr, stat2/10) guiProgressBarSetProgress(ShotgPr, stat3/10) guiProgressBarSetProgress(sawnoffPr, stat4/10) guiProgressBarSetProgress(spazPr, stat5/10) guiProgressBarSetProgress(tech9Pr, stat6/10) guiProgressBarSetProgress(mp5Pr, stat7/10) guiProgressBarSetProgress(ak47Pr, stat8/10) guiProgressBarSetProgress(m4Pr, stat9/10) end)
  3. i did this addEventHandler("onClientMarkerHit", skillshop, function() local stat = getPlayerStat (getLocalPlayer(),69) local stat1 = getPlayerStat (getLocalPlayer(),70) local stat2 = getPlayerStat (getLocalPlayer(),71) local stat3 = getPlayerStat (getLocalPlayer(),72) local stat4 = getPlayerStat (getLocalPlayer(),73) local stat5 = getPlayerStat (getLocalPlayer(),74) local stat6 = getPlayerStat (getLocalPlayer(),75) local stat7 = getPlayerStat (getLocalPlayer(),76) local stat8 = getPlayerStat (getLocalPlayer(),77) local stat9 = getPlayerStat (getLocalPlayer(),78) guiProgressBarSetProgress(pistolPr, stat) guiProgressBarSetProgress(silencedPr, stat1) guiProgressBarSetProgress(deaglePr, stat2) guiProgressBarSetProgress(ShotgPr, stat3) guiProgressBarSetProgress(sawnoffPr, stat4) guiProgressBarSetProgress(spazPr, stat5) guiProgressBarSetProgress(tech9Pr, stat6) guiProgressBarSetProgress(mp5Pr, stat7) guiProgressBarSetProgress(ak47Pr, stat8) guiProgressBarSetProgress(m4Pr, stat9) end)
  4. using progress bars to show all the players weapon stats when the shop is opened but it doesnt work addEventHandler("onClientMarkerHit", skillshop, function() local stat8 = getPedStat (getLocalPlayer(),77) if stat8 == 0 then guiProgressBarSetProgress(ak47Pr, 0) if stat8 == 100 then guiProgressBarSetProgress(ak47Pr, 10) if stat8 == 200 then guiProgressBarSetProgress(ak47Pr, 20) if stat8 == 300 then guiProgressBarSetProgress(ak47Pr, 30) if stat8 == 400 then guiProgressBarSetProgress(ak47Pr, 40) if stat8 == 500 then guiProgressBarSetProgress(ak47Pr, 50) if stat8 == 600 then guiProgressBarSetProgress(ak47Pr, 60) if stat8 == 700 then guiProgressBarSetProgress(ak47Pr, 70) if stat8 == 800 then guiProgressBarSetProgress(ak47Pr, 80) if stat8 == 900 then guiProgressBarSetProgress(ak47Pr, 90) if stat8 == 1000 then guiProgressBarSetProgress(ak47Pr, 100) end end end end end end end end end end end end) end )
  5. it doesnt work still also i fixed your then aswell its okay i got it working with this addEventHandler("onPlayerSpawn", getRootElement(), function() getammo = getPedTotalAmmo(source) if getammo <= 14 then giveWeapon ( source, 22, 15 ) end end)
  6. sorry i keep asking for help lol... i just dont know where im going wrong. I am just learning LOL i wanna give new players 15 pistol ammo when they first spawn. addEventHandler("onPlayerLogin", getRootElement(), function(_, account) if not getAccountData(account, "FirstTime") then setAccountData(account, "FirstTime", true) addEventHandler("onPlayerSpawn", getRootElement(), function(_, account) if getAccountData(account, "FirstTime", true) then giveWeapon ( source, 22, 15 ) end end) end end)
  7. thanks i always forget there is 4 arguments for triggerClientEvent
  8. addEvent("onPlayerLevelUp") addEventHandler("onPlayerLevelUp",root, function(level,old) outputChatBox("You level up!",source) playSound3DToElement(source,source,"levelUP.wav") triggerClientEvent("openLevelW", source, openLevelW) end)
  9. I had the problem before with another gui i made but for some reason i cant fix it with this one. addEvent("openLevelW",true) addEventHandler("openLevelW",root, function (thePlayer) if getElementData(source, "Level") == 4 and thePlayer == getLocalPlayer() then guiSetVisible( unlockwindow, not guiGetVisible( unlockwindow ) ) GUIEditor.label[1] = guiCreateLabel(34, 25, 201, 61, "-Unlocked Ability To Drive Bikes", false, unlockwindow) showCursor ( true ) else if getElementData(source, "Level") == 9 and thePlayer == getLocalPlayer() then guiSetVisible( unlockwindow, not guiGetVisible( unlockwindow ) ) GUIEditor.label[1] = guiCreateLabel(34, 25, 201, 61, "-Unlocked Ability To Drive Cars.\n-Unlocked Skin Shop.\n-Unlocked Chainsaw.\n-Unlocked The Kingdom.", false, unlockwindow) showCursor ( true ) end end end)
  10. been fiddling with this for a few hours. I know the picture is fine because im using it from my weapon shop to test. I am even using my weapon shop source to see if i can identify the issue, no luck and i am also not getting errors with "debugscript 3". heres my client.lua preview = guiCreateStaticImage(457, 31, 213, 488, ":skinshop/previews/uzi.png", false, skinwindow) heres my meta.xml <meta> <info author="Kewizzle" version="1.1" name="skinshop" type="script" /> <script src="GUI.lua" type="client" /> <script src="server.lua" type="server" /> <fire src="previews/blank.png"/> <fire src="previews/uzi.png"/> </meta> and my file path is C:\Program Files (x86)\MTA San Andreas 1.5\server\mods\deathmatch\resources\skinshop\previews\uzi.png
  11. im getting someone in my server right now to test this out and i will get back to you. works as expected thanks.
  12. addEventHandler("onPickupUse",getRootElement(),function() triggerClientEvent("playPickup", source, playPickup) destroyElement(source) end)
  13. it works for this part function MarkerHit ( hitPlayer, matchingDimension ) if hitPlayer == localPlayer then playSound("drops/pickuphit.wav") end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) but this one doesnt still plays for all addEvent("playPickup",true) addEventHandler("playPickup",root, function() playSound("drops/pickuped.wav") end) i tried adding if hitPlayer == localPlayer then to that one as well but then none of the sounds work but when i pickup the item it gives an error saying, "server triggered clientside event playPickup, but event is not added clientside.
  14. Heres my code and for some reason the sound plays for everyone in the game. addEvent("playPickup",true) addEventHandler("playPickup",root, function() playSound("drops/pickuped.wav") end) function MarkerHit ( hitPlayer, matchingDimension ) playSound("drops/pickuphit.wav") end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit )
  15. i see what you did guiGridListSetItemData( skinselect, Row, 1, v[2] ) would mean to get the Item data in the table skins and place it in the second column in each row according to the skin in the table.
  16. thanks guys im learning so much lol.
  17. heres my source, idk how to add the skin ids next to it. shinshop = createMarker(-673, 916.4, 11,"cylinder",2.0,0,255,0,255) local Skins = { { "CJ", 0 }, { "Hippie", 1 }, { "Division Sheild", 17 }, { "Division fumigator", 18 }, { "Division incinerator", 19 }, { "Rich Woman", 55 }, { "Tall Balla", 104 }, } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() skinwindow = guiCreateWindow((screenW - 527) / 2, (screenH - 608) / 2, 527, 608, "Kewizzle's Skin Shop", false) guiWindowSetSizable(skinwindow, false) guiSetProperty(skinwindow, "CaptionColour", "FFDDEA14") guiSetVisible( skinwindow, not guiGetVisible( skinwindow ) ) skinselect = guiCreateGridList(99, 29, 324, 490, false, skinwindow) guiGridListAddColumn(skinselect, "Skin Name", 0.5) guiGridListAddColumn(skinselect, "Skin ID", 0.5) purchase = guiCreateButton(99, 529, 155, 61, "Buy Skin $500", false, skinwindow) guiSetFont(purchase, "default-bold-small") guiSetProperty(purchase, "NormalTextColour", "FF00F940") cancelbuy = guiCreateButton(269, 529, 154, 61, "Cancel", false, skinwindow) guiSetFont(cancelbuy, "default-bold-small") guiSetProperty(cancelbuy, "NormalTextColour", "FFF90000") addEventHandler("onClientGUIClick", cancelbuy, CloseWindow) addEventHandler("onClientGUIClick", purchase, function() local Select = tonumber( guiGridListGetItemData( skinselect, guiGridListGetSelectedItem( skinselect ), 1 ) ) if ( Select and Select ~= '' ) then triggerServerEvent( "setClientSkin", localPlayer, tonumber( guiGridListGetItemData( skinselect, guiGridListGetSelectedItem( skinselect ), 1 ) ) ) CloseWindow() end end) for _,v in ipairs( Skins ) do local Row = guiGridListAddRow( skinselect ) guiGridListSetItemText( skinselect, Row, 1, v[1], false, false ) guiGridListSetItemData( skinselect, Row, 1, v[2] ) end end )
  18. it only works if im holding the left click button now. this works but then i right click the speaker the radio keeps playing function playMusic(button, state, _, _, _, _, _, clickedElement) if button == "left" and clickedElement == speaker then sound = playSound3D(url, -657.90002441406, 944.90002441406, 12) else stopSound(sound) end end addEventHandler("onClientClick", getRootElement(), playMusic)
  19. i did and still wont work for some reason. i tested the file too it plays in itunes.
  20. Client.lua heres my script local speaker = createObject(2232, -657.90002441406, 944.90002441406, 12, 0, 0, 255) local url = "http://208.85.242.69:9622/listen.pls" function playMusic(button) if (button) == "left" then local sound = playSound3D(url, -657.90002441406, 944.90002441406, 12) else stopSound(sound) end end addEventHandler( "onClientClick", speaker, playMusic )
×
×
  • Create New...