Jump to content

Burak5312

Members
  • Posts

    361
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by Burak5312

  1. try this local function default3SBuy() guiSetEnabled(skinPayButton3, false) local money = getPlayerMoney(localPlayer) --replace with localPlayer local id = getElementModel(localPlayer) --replace with localPlayer if (money < 500) then --if the player's money is less than 0 go no further outputChatBox("You don't have enough money! (500$)", 255, 0, 0) guiSetVisible(skinPayButton3, true) return end if id == 284 then --getElementType is unnecessary in this case outputChatBox("You already pruchased this skin!", 255, 0, 0) end outputChatBox("You purchased a Humvee! (500$)", 0, 255, 0) takePlayerMoney(500) --this might be problem for server side i suggest you to do it using triggerServerEvent setElementModel(localPlayer, 284) end addEventHandler("onClientGUIClick", skinPayButton3, default3SBuy, false)
  2. extra parameter is passed here can you try deleting the true part triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id, true) -- <-- this triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id)
  3. change source to localPlayer addCommandHandler("pj", function(cmd,id) local veh = getPedOccupiedVehicle(localPlayer) --this if veh then local id = tonumber(id) or 0 local model = getElementModel(veh) if availablePaintJobs[model] and availablePaintJobs[model][id] then setElementData(veh, "tuning.paintjob", id) triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id, true) end end end)
  4. isObjectInACLGroup is server side function you can't use it on client side use triggerServerEvent and triggerClientEvent to do this split your code into pieces
  5. Try changing thePlayer to localPlayer addCommandHandler("pj", function(cmd,id) local plrAccName = getElementData(localPlayer, 'accName') --change thePlayer to localPlayer if isObjectInACLGroup("user."..plrAccName, aclGetGroup("Admin")) or isObjectInACLGroup("user."..plrAccName, aclGetGroup("Owner")) then local veh = getPedOccupiedVehicle(localPlayer) if veh then local id = tonumber(id) or 0 local model = getElementModel(veh) if availablePaintJobs[model] and availablePaintJobs[model][id] then setElementData(veh, "tuning.paintjob", id) triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id, true) end end end end)
  6. function onSpawnHeliMarkerHit(hitElement, matchingDimension) change function parameters like this
  7. function spawnItemsWhenStart ( name ) createPed(287, 1544.75390625, -1675.2421875, 13.55902671814, 90) end addEventHandler ( "onResourceStart", getResourceRootElement(), spawnItemsWhenStart ) function spawnMarkerFunction() --local deleteMarker = createMarker(1529.248046875, -1685.935546875, 4.5, "cylinder", 3, 135, 15, 15, 0) setElementInterior(spawnMarker, 0) setElementDimension(spawnMarker, 0) addEventHandler("onMarkerHit",spawnMarker,onSpawnMarkerHit) end spawnHeliMarker = createMarker (1930.0791015625, -2626.673828125, 12.5, "cylinder", 3, 122, 193, 67, 70) function onSpawnHeliMarkerHit (thePlayer, hitElement, heliSpawnPos) if(getElementType(hitElement) ~= "player") then --If hitElement is not a player, go no further return end local money = getPlayerMoney(hitElement) if (money < 10000) then --if the player's money is less than 10000 go no further outputChatBox("You don't have enough money!", hitElement, 255, 0, 0) return end outputChatBox("You purchased a blackhawk!", hitElement, 0, 255, 0) takePlayerMoney(hitElement, 10000) local heliSpawnPos={ {1967.8515625, -2636.1103515625, 13.546875}, {1998.966796875, -2636.849609375, 13.546875}, } local theVeh = getPedOccupiedVehicle(hitElement) if ( theVeh ) then if ( VehiclesTable[hitElement] ) then VehiclesTable[hitElement] = nil end return end local x, y, z = getElementPosition (hitElement) local rotX, rotY, rotZ = getElementRotation (hitElement) local random = math.random(1,#heliSpawnPos) VehiclesTable[hitElement] = createVehicle (563, heliSpawnPos[random][1], heliSpawnPos[random][2], heliSpawnPos[random][3]+2) setElementRotation (VehiclesTable[hitElement], rotX, rotY, 0) warpPedIntoVehicle (hitElement, VehiclesTable[hitElement]) end addEventHandler("onMarkerHit", spawnHeliMarker, onSpawnHeliMarkerHit) can you try this? You didn't say what getElementData means so I deleted that
  8. What data do you want to get with getElementData?, can you show line 90? by the way this line should be above the if code local money = getPlayerMoney(hitElement)
  9. there is an error here money must be a string tonumber(getElementData(hitElement, money)) change it like this tonumber(getElementData(hitElement, "money"))
  10. kodu gösterirsen belki yardımcı oluruz kodsuz kimse yardım edemez
  11. yes there must be something wrong with this link because it was working yesterday, now it's not working can you try to download it via archived website https://megalodon.jp/2022-0315-0707-50/bpb-team.ru/star-tR/files/maps.zip
  12. There's something here but I'm not sure if that's what you want http://bpb-team.ru/star-tR/files/maps.zip
  13. I'm not sure but can you try this code this is a bit different from the math you use local screenW, screenH = guiGetScreenSize() local myW, myH = 1920, 1080 -- your resolution here local relX, relY = (screenW/myW),(screenH/myH) --this dxDrawText("Password", screenW * 0.4844, screenH * 0.5093, screenW * 0.5188, screenH * 0.5222, tocolor(255, 255, 255, 255), 1.00 * relX, "default", "left", "top", false, false, false, false, false)
  14. server sana ait ise kodu gösterirmisin? eğer değilse server sahibi ile irtibat kurun bu sorun için script sonsuz döngüye giriyor olabilir
  15. You're welcome. Please open a new topic if you have any other questions, I'll help you as best I can. ?
  16. Are the function parameters correct? Is the function you called defined as exports in meta.xml? Are the function you call and the file you run the script on the same side?
  17. Can you try multiplying the size with screenW? --this dxDrawText("Password", screenW * 0.4844, screenH * 0.5093, screenW * 0.5188, screenH * 0.5222, tocolor(255, 255, 255, 255), screenW * 1.00, "default", "left", "top", false, false, false, false, false)
  18. There is no problem. Are you sure the font file is in the same folder as the script?
  19. actually you can solve this with a single variable instead of using "isEventHandlerAdded" Since there are more operations in the isEventHandlerAdded function, you can do it economically with a single variable. local isSpeedoMeterVisible = false --speedometer visibility status function hideSpeedometer() if(isSpeedoMeterVisible) then -- Is the speedometer visible? removeEventHandler("onClientRender", root, speedoMeterGUI) end end function showSpeedometer() if(isSpeedoMeterVisible == false) then -- Is the speedometer invisible? addEventHandler("onClientRender", root, speedoMeterGUI) end end ---------------------------------------------- function A1(player) vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player)==0 or getPedOccupiedVehicleSeat(player)==1 then showSpeedometer() -------call to create the handler end end addEventHandler("onClientVehicleEnter", root, A1) function A2() hideSpeedometer() -----call to remove the handler end addEventHandler("onClientVehicleStartExit", root, A2)
  20. You can use a table for this, if you don't have very complex code on the client side, I strongly recommend using a table. example: local playerThings = {} -- storage place for player things function example(thePlayer, cmd) local thingCheck = playerThings[thePlayer] -- if player things are always going to be numbers then there is no need for "tonumber" --local thingCount = tostring(thingCheck) -- actually I think it is not needed because you convert it to string type with concatenation in outputChatBox function if (thingCheck and thingCheck >= 1) then outputChatBox("You have "..thingCheck.." thing(s).", thePlayer, 255,255,255) else outputChatBox("You don't have anything.", thePlayer, 255, 255, 255) end end addCommandHandler("mythings", example)
×
×
  • Create New...