Jump to content

xMKHx

Members
  • Posts

    151
  • Joined

  • Last visited

1 Follower

About xMKHx

  • Birthday 04/02/2000

Details

  • Gang
    NoGang
  • Location
    Tunisia
  • Occupation
    Lua Programmer
  • Interests
    Nothing :)

Recent Profile Visitors

3,454 profile views

xMKHx's Achievements

Busta

Busta (15/54)

22

Reputation

  1. addEventHandler("onResourceStart", resourceRoot, function() -- Replace the car model (ID 411 is the Infernus model, you can change it) local modelID = 411 -- Model ID to replace (e.g., 411 for Infernus) local dffFile = "path/to/your/car.dff" -- Path to the DFF file local txdFile = "path/to/your/car.txd" -- Path to the TXD file -- Load the TXD file local txd = engineImportTXD(txdFile) engineReplaceModel(txd, modelID) -- Load the DFF file local dff = engineLoadDFF(dffFile, modelID) engineReplaceModel(dff, modelID) end )
  2. I've used DeepSeek to fix your code, there is this result: -- Define the bomb function function bomb(player) local car = getPedOccupiedVehicle(player) if getElementModel(car) == 520 then outputChatBox("Сброс бомб", player) local x, y, z = getElementPosition(player) setTimer(AirstrikeThrow, 51, 1, player, x, y, z) end end -- Bind the "3" key to the bomb function for each player when they spawn or enter the vehicle function bindBombKey(player) bindKey(player, "3", "down", bomb) end -- Add event handlers to bind the key when the player spawns or enters a vehicle addEventHandler("onPlayerJoin", root, bindBombKey) addEventHandler("onVehicleEnter", root, function(player) bindBombKey(player) end) -- Define the AirstrikeThrow function function AirstrikeThrow(player, x, y, z) triggerClientEvent(getRootElement(), "AirstrikeThrowDo", getRootElement(), player) end
  3. Client-Side: -- Function to check ammo and reload function checkAmmoAndReload() -- Get the player's current weapon local weapon = getPedWeapon(localPlayer) -- Get the ammo in the player's clip local ammoInClip = getPedAmmoInClip(localPlayer) -- Get the total ammo the player has for the current weapon local totalAmmo = getPedTotalAmmo(localPlayer) -- If the clip is empty but the player has more ammo, reload the weapon if ammoInClip == 0 and totalAmmo > 0 then triggerServerEvent("onPlayerReloadWeapon", localPlayer) end end -- Event handler for when the player fires a weapon addEventHandler("onClientPlayerWeaponFire", localPlayer, checkAmmoAndReload) Server-Side: -- Event to handle weapon reloading addEvent("onPlayerReloadWeapon", true) addEventHandler("onPlayerReloadWeapon", root, function() -- Get the player's current weapon local weapon = getPedWeapon(source) -- Reload the weapon setPedWeaponSlot(source, getPedWeaponSlot(source)) end) I don't know if it's working, I just asked DeepSeek and this is the result.. Have fun
  4. Hello, can you please post your code.
  5. Check if the problem in the host or your resources
  6. Client and server sides and meta.xml
  7. I didn't try to code at first But I made some change, I think it will work now I've changed the col location to test, you can change it later Try this one server side greenzone = createColRectangle ( 1400.2144775391,1425.1593017578, 100, 100 ) greenzoneradar = createRadarArea ( 1400.2144775391,1425.1593017578, 100, 100, 255, 255, 0, 150 ) function Col_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then setElementData(thePlayer, "isInGreenZone", true) setRadarAreaFlashing ( greenzoneradar, true ) setTimer(giveMoneyToPlayers, 1000, 0, thePlayer) outputChatBox( "#FFFFFF* #00FF00You've entered the money zone!", thePlayer, 255, 255, 109, true ) end end addEventHandler ( "onColShapeHit", greenzone, Col_Enter ) function Col_Exit ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then setElementData(thePlayer, "isInGreenZone", false) setRadarAreaFlashing ( greenzoneradar, false ) outputChatBox ( "#FFFFFF* #FF0000You've left the money zone!", playerSource, 255, 255, 109, true ) end end addEventHandler ( "onColShapeLeave", greenzone, Col_Exit ) function giveMoneyToPlayers (thePlayer) if getElementData(thePlayer, "isInGreenZone") == false then return false end givePlayerMoney(thePlayer, 5) end I've re-checked the code and found an issue Try this version I hope it helps you greenzone = createColRectangle ( 1400.2144775391,1425.1593017578, 100, 100 ) greenzoneradar = createRadarArea ( 1400.2144775391,1425.1593017578, 100, 100, 255, 255, 0, 150 ) function Col_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then setElementData(thePlayer, "isInGreenZone", true) setRadarAreaFlashing ( greenzoneradar, true ) outputChatBox( "#FFFFFF* #00FF00You've entered the money zone!", thePlayer, 255, 255, 109, true ) end end addEventHandler ( "onColShapeHit", greenzone, Col_Enter ) function Col_Exit ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then setElementData(thePlayer, "isInGreenZone", false) setRadarAreaFlashing ( greenzoneradar, false ) outputChatBox ( "#FFFFFF* #FF0000You've left the money zone!", playerSource, 255, 255, 109, true ) resetTimer(timer) end end addEventHandler ( "onColShapeLeave", greenzone, Col_Exit ) timer = setTimer(function(thePlayer) for i, v in ipairs(getElementsByType("player")) do if getElementData(v, "isInGreenZone") == false then return false end givePlayerMoney(v, 5) end end ,1000, 0, thePlayer)
  8. Try this local greenzone = createColRectangle ( 1995.224609375, 1516.697265625, 11, 45 ) local greenzoneradar = createRadarArea ( 1993.91796875, 1567.671875, 50, -100, 255, 255, 0, 150 ) function Col_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then setElementData(thePlayer, "isInGreenZone", true) setRadarAreaFlashing ( greenzoneradar, true ) outputChatBox( "#FFFFFF* #00FF00You've entered the money zone!", thePlayer, 255, 255, 109, true ) end end addEventHandler ( "onColShapeHit", greenzone, Col_Enter ) function Col_Exit ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then setElementData(thePlayer, "isInGreenZone", false) setRadarAreaFlashing ( greenzoneradar, false ) outputChatBox ( "#FFFFFF* #FF0000You've left the money zone!", playerSource, 255, 255, 109, true ) end end addEventHandler ( "onColShapeLeave", greenzone, Col_Exit ) setTimer(function() for i,v in ipairs(getElementsByType("player")) do if getElementData(v, "isInGreenZone") == false then return false end givePlayerMoney(v, 5) end end, 1000, 1)
  9. There is a lot of examples on wiki https://wiki.multitheftauto.com/wiki/AddDebugHook
  10. You can search for free php inventory templates on internet and use mysql to manage data I made a search and I've found this https://www.sourcecodester.com/php/15419/simple-inventory-management-system-phpoop-free-source-code.html Its just an exmple but you have to make your own efforts
  11. What do you exactly want to do ?
  12. You can make some png blips and use custom blips https://community.multitheftauto.com/index.php?p=resources&s=details&id=960
×
×
  • Create New...