Jump to content

HealthDown

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by HealthDown

  1. SERVER: hitmanMarker = createMarker ( 2303.4782714844, -2019.1921386719, 13.541597366333, "cylinder", 1.5, 205, 0, 0) function hitmanMarkerH( player ) setPlayerTeam ( player, "Hitmen" ) end addEventHandler( "onMarkerHit", hitmanMarker, hitmanMarkerH )
  2. i have tried centerWindow code and it doesnt work how to do it in other way
  3. function bindKeyF2 () if (getPlayerTeam(getLocalPlayer ( ))=="Traders") then guiSetVisible(traderJPanel, true) end end bindKey ("F2", "down", bindKeyF2) it doesnt show gui at all, but there is no debugscript error
  4. HealthDown

    skin shop

    can someone help me with skin shop and script me an example, i beg you. GUI: guiSkinShop = guiCreateWindow(284,179,245,307,"Skin Shop",false) guiSetAlpha(guiSkinShop,1) guiSkinShopGridlist = guiCreateGridList(10,29,223,234,false,guiSkinShop) guiGridListSetSelectionMode(guiSkinShopGridlist,2) guiGridListAddColumn(guiSkinShopGridlist,"Skins",0.2) guiSkinShopBuy = guiCreateButton(11,270,68,27,"Buy ($200)",false,guiSkinShop) guiSkinShopClose = guiCreateButton(164,270,68,27,"Close",false,guiSkinShop) i am not lazy to make myself, but whenever i script i get tons of bugs what noone can fix (even on this forum) so can you just make me an example and i will add skins by myself
  5. i just tried to put this outside it worked, but inside interior no
  6. but it still doesnt show gui
  7. yes i did it 3 times and no error
  8. no error in debugscript 3
  9. it still doesnt show anything
  10. Client: rootElement = getRootElement () guiTGB = guiCreateWindow(236,380,332,190,"Ten Green Bottles",false) guiSetAlpha(guiTGB,1) guiTGBCoke = guiCreateButton(15,155,63,23,"Coke - 1$",false,guiTGB) guiTGBJuice = guiCreateButton(95,155,63,23,"Juice - 1$",false,guiTGB) guiTGBCokeImg = guiCreateStaticImage(16,29,58,114,"coke.png",false,guiTGB) guiTGBBeer = guiCreateButton(171,155,63,23,"Beer - 2$",false,guiTGB) guiTGBShake = guiCreateButton(248,155,63,23,"Shake - 2$",false,guiTGB) guiTGBJuiceImg = guiCreateStaticImage(100,33,53,110,"juice.png",false,guiTGB) guiTGBBeerImg = guiCreateStaticImage(173,34,58,112,"beer.png",false,guiTGB) guiTGBShakeImg = guiCreateStaticImage(248,36,59,111,"shake.png",false,guiTGB) guiSetVisible(guiTGB, false) addEvent ( "onSpecialEvent", true ) function specialEventHandler ( text ) guiSetVisible(guiTGB, true) end addEventHandler ( "onSpecialEvent", rootElement, specialEventHandler ) Server: local markerTGB = createMarker(495.71051025391,-75.590278625488,997.7578125,"cylinder",1,255,0,0) setElementInterior (markerTGB, 11) function markerTGBhit( ) triggerEvent ( "onSpecialEvent", rootElement, "test" ) end addEventHandler( "onMarkerHit", markerTGB, markerTGBhit ) it shows cylinder, but it doesnt show gui when i collision with cylinder
  11. weedID = 826 -- object id for weed weedGrowTime = 100000 -- milliseconds weedHealthAmount = 50 -- health amount if smoking the weed weedCash = 100 -- cash if selling the weed seedCash = 5 -- weed seed price weedArea = createRadarArea(-50.442802,-108.432037,130.955353,134.419464,0,0,0,50) -- weed planting area weeds = { } -- weed objects table weedReady = { } -- weed ready table weedCol = { } -- weed collision circles table weedPlants = "" -- players weed slots which contain weed (dont edit this!) playerWeed = 0 -- player's weed at start playerSeeds = 0 -- player's weed seeds at start -- These are not relevant settings, but the default ones. There is the function which calls the server for the right settings. addEvent("weed.onSend",true) addEventHandler("weed.onSend",getRootElement(),function(a,b,c,d,e,f,g) if type(a) == "number" then weedID = a end if type(b) == "number" then weedGrowTime = b end if type(c) == "number" then weedHealthAmount = c end if type(d) == "number" then weedCash = d end if type(e) == "number" then seedCash = e end if type(f) == "number" then playerSeeds = f end if type(g) == "number" then playerWeed = g end addCommandHandler("weed",weedCommands) end) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function() triggerServerEvent("weed.onRequest",localPlayer) end) function weedCommands(cmd,subcmd,id) if not id and subcmd ~= "plants" then outputChatBox("Please specify a slot, or specify amount of weed!",255,0,0) return end if subcmd == "plant" then if not weeds[id] then local x,y,z = getElementPosition(localPlayer) if isInsideRadarArea(weedArea,x,y) and isPedOnGround(localPlayer) and not isPedInVehicle(localPlayer) then if playerSeeds < 1 then outputChatBox("Not enough seeds!",255,0,0) return end weeds[id] = createObject(weedID,x,y,z-2) weedPlants = weedPlants..id..", " weedCol[id] = createColCircle(x,y,10) playerSeeds = playerSeeds - 1 moveObject(weeds[id],weedGrowTime,x,y,z,0,0,0,"InOutQuad") setTimer(function(idd)weedReady[idd] = true end,weedGrowTime,1,id) outputChatBox("Successful plant! Wait till its ready for harvesting. Your seeds: "..playerSeeds,0,255,0) else outputChatBox("Please go in the planting area, exit your vehicle and stay on the ground to plant.",255,0,0) end else outputChatBox("This weed slot is alerady in use! Choose another slot!",255,0,0) end elseif subcmd == "harvest" then if weeds[id] then local x,y,z = getElementPosition(localPlayer) local x2,y2,z2 = getElementPosition(weeds[id]) if isElementWithinColShape(localPlayer,weedCol[id]) and weedReady[id] then destroyElement(weedCol[id]) destroyElement(weeds[id]) weedReady[id] = nil weeds[id] = nil weedCol[id] = nil weedPlants = weedPlants:gsub(id..", ","") playerWeed = playerWeed + 1 outputChatBox("Successful harvest! Your have "..playerWeed.." grams of weed.",0,255,0) else outputChatBox("Wait till the weed is ready for harvesting, and stay close to it!",255,0,0) end else outputChatBox("No weed in this slot!",255,0,0) end elseif subcmd == "highlight" then if weeds[id] then local x,y,z = getElementPosition(weeds[id]) local blip = createBlip(x,y,z,41,1,0,153,0,153) setTimer(destroyElement,100000,1,blip) end elseif subcmd == "plants" then if weedPlants == "" or weedPlants == " " then outputChatBox("You have no plants.",0,255,0) weedPlants = "" else outputChatBox("Your weed plants' slots: " ..weedPlants,0,255,0) end elseif subcmd == "sell" then id = tonumber(id) if id <= playerWeed then playerWeed = playerWeed - id outputChatBox("You sold "..id.. " grams of weed. You now have "..playerWeed.." grams.",0,255,0) givePlayerMoney(id*weedCash) else outputChatBox("Not enough weed!",255,0,0) end elseif subcmd == "buy" then id = tonumber(id) if id*8 <= getPlayerMoney() then playerSeeds = playerSeeds + id outputChatBox("You bought "..id.." seeds. You now have "..playerSeeds..".",0,255,0) takePlayerMoney(id*seedCash) else outputChatBox("Not enough money!",255,0,0) end elseif subcmd == "smoke" then id = tonumber(id) if id <= playerWeed then setElementHealth(localPlayer,getElementHealth(localPlayer)+10*id) playerWeed = playerWeed - id outputChatBox("You smoked "..id.." grams of weed. Your health has been refilled. You have "..playerWeed.." grams of weed.",0,255,0) else outputChatBox("Not enough weed!") end end end guiWeed = guiCreateWindow(246,237,275,177,"F2 - Weed Panel",false) guiSetAlpha(guiWeed,1) guiWindowSetMovable(guiWeed,false) guiWindowSetSizable(guiWeed,false) guiWeedHarvest = guiCreateButton(10,73,92,31,"Harvest Weed",false,guiWeed) guiWeedPlant = guiCreateButton(10,35,92,31,"Plant Weed",false,guiWeed) guiWeedSmoke = guiCreateButton(10,110,92,31,"Smoke Weed",false,guiWeed) guiWeedTxt1 = guiCreateLabel(109,80,99,17,"Number of Seeds:",false,guiWeed) guiWeedTxt2 = guiCreateLabel(109,109,99,17,"Number of Weed:",false,guiWeed) guiWeedTxt3 = guiCreateLabel(8,148,262,17,"You can buy seed and sell weed in Weed Shop",false,guiWeed) guiLabelSetColor(guiWeedTxt3,215,0,0) guiWeedClose = guiCreateButton(212,36,51,23,"Close",false,guiWeed) guiWeedProgress = guiCreateProgressBar(112,36,92,23,false,guiWeed) guiWeedSeed = guiCreateLabel(213,81,48,15,"2",false,guiWeed) guiWeedWeed = guiCreateLabel(213,109,48,15,"2",false,guiWeed) guiSetVisible(guiWeed, false) function showGuiWeed() if (guiGetVisible(guiWeed, true)) then guiSetVisible(guiWeed, false) showCursor(false) else guiSetVisible(guiWeed, true) showCursor(true) end end addEventHandler( "onClientResourceStart", getRootElement( ), function ( startedRes ) bindKey("f2", "down", showGuiWeed) end ); function guiWeedCloseAction() guiSetVisible(guiWeed, false) showCursor(false) end addEventHandler("onClientGUIClick", guiWeedClose, guiWeedCloseAction, false) function guiWeedPlantAction() if not guiGetText(guiWeedSeed)==0 then guiSetText(guiWeedSeed, guiGetText(guiSeedWeed)-1) setTimer (guiWeedTimer, 1000, 100) else end end addEventHandler("onClientGUIClick", guiWeedPlant, guiWeedPlantAction, false) function guiWeedTimer ( text ) guiProgressBarSetProgress(guiWeedPorgress, guiProgressBarGetProgress(guiWeedPorgress)+1) end
  12. in has error in 1. line (cant compare string with number)
  13. if (guiGetText(guiWeedSeed)>0) then guiSetText(guiWeedSeed, guiGetText(guiSeedWeed)-1) setTimer (guiWeedTimer, 1000, 100) else guiWeedSeed is label and it is number
  14. i want to execute it on F8 console, not in server
  15. i cant find it on mta, but anyway i have GUI button and when i press it i want to execute /weed plant 1 command
  16. https://community.multitheftauto.com/ind ... ls&id=2742 i want to make gui for that resource
  17. when i press on gui button i execute console command line "weed plant 1"
  18. i have commande "weed plant 1" and i want to execute it by clicking button
  19. what is code what will execute console command when i click on button?
  20. i need code what when i click on button it will process console action "weed plant" + textbox1. how to do that
×
×
  • Create New...