Jump to content

xMKHx

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by xMKHx

  1. Post server side too
  2. Hello, can you please post your code.
  3. Check if the problem in the host or your resources
  4. Client and server sides and meta.xml
  5. Post your code and meta please
  6. 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)
  7. 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)
  8. There is a lot of examples on wiki https://wiki.multitheftauto.com/wiki/AddDebugHook
  9. 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
  10. What do you exactly want to do ?
  11. You can make some png blips and use custom blips https://community.multitheftauto.com/index.php?p=resources&s=details&id=960
  12. You may use a glue system Try mine local glues = {} function glue (plr, cmd) local veh = getPedContactElement(plr) if (getElementData(plr, "glue") == false) then -- Boolean again >_< if isElement(veh) and (getElementType(veh) == "vehicle") then local px, py, pz = getElementPosition(plr) local vx, vy, vz = getElementPosition(veh) local sx = px - vx local sy = py - vy local sz = pz - vz local rotpX = 0 local rotpY = 0 local rotpZ = getElementRotation(plr) local rotvX,rotvY,rotvZ = getVehicleRotation(veh) local t = math.rad(rotvX) local p = math.rad(rotvY) local f = math.rad(rotvZ) local ct = math.cos(t) local st = math.sin(t) local cp = math.cos(p) local sp = math.sin(p) local cf = math.cos(f) local sf = math.sin(f) local z = ct*cp*sz + (sf*st*cp + cf*sp)*sx + (-cf*st*cp + sf*sp)*sy local x = -ct*sp*sz + (-sf*st*sp + cf*cp)*sx + (cf*st*sp + sf*cp)*sy local y = st*sz - sf*ct*sx + cf*ct*sy local rotX = rotpX - rotvX local rotY = rotpY - rotvY local rotZ = rotpZ - rotvZ attachElements(plr, veh, x,y,z, rotX, rotY, rotZ) setElementData(plr, "glue", true) glues[plr] = veh end else if (isElement(glues[plr])) then detachElements(plr, glues[plr]) setElementData(plr, "glue", false) end end end addCommandHandler("glue", glue)
  13. You can try this addCommandHandler( "brake", function ( thePlayer ) local theVehicle = getPedOccupiedVehicle( thePlayer ) if ( theVehicle ) then if ( isVehicleDamageProof( theVehicle ) ) then outputChatBox("Your vehicle is no longer damageproof!", thePlayer, 0, 255, 0) setVehicleDamageProof( theVehicle, false ) else outputChatBox("Your vehicle is now damageproof!", thePlayer, 0, 255, 0) setVehicleDamageProof( theVehicle, true ) end end end )
  14. You can use setElementData For Example: function changeFreq (freq) if getElementData(source, "freq") == freq then return outputChatBox("You're already on "..freq.." frequency !", source, 255, 0, 0) end setElementData(source, "freq", freq) outputChatBox("You are now on "..freq.." frequency.", source, 0, 255, 0) end addCommandHandler("freq", changeFreq) function freqChat(plr, command, ...) if getElementData(plr, "freq") == false then return outputChatBox("Get a frequency first by using /freq <freqNumber>, For example /freq 3", plr, 255, 0, 0) end local freq = "( "..getElementData(plr, "freq").." )" local message = table.concat({...}, " ") local fullMessage = freq.." "..getPlayerName(plr)..": "..message:gsub("#%x%x%x%x%x%x", "") for i, v in ipairs(getElementsByType("player")) do if (getElementData(v, "freq") == getElementData(plr, "freq")) then outputChatBox(fullMessage, v, 255, 255, 255, true) end end end addCommandHandler("fc", freqChat) Note: I didn't test the code
  15. LOT_NUM_LIMIT = 10 -- What is the higher lottery number .
  16. Hello Community, Hello Legends, How you doing, I hope you're all alright. Well am gonna directly talk hh I've been playing MTA for 10 years since 2010 to 2020 and like most of you we've started like newbies then we upgrade ourselves by the time. As you know most of ppl are focusing on FiveM, no comparison here, quality, cars models and reality..etc. Well I had a server before, I was having fun, we all grown up with MTA and we all have memories, we've made a lot of friends, we've got virtual relations and some ppl got a real one. Well as I can see there's nothing new in MTA, I've spent a lot of time playing and scripting, I made new graphic mods to make the game enjoyable but no results, What I would say that day by day this game is dying, We may have to support the community to improve the game performance, Some ads may help too. Am a lover and a supporter, I would like to get back but work and responsibilities took all ma'time so A message to the community admins, please survive the game and thanks. - Best regards
  17. Seriously you're selling this simple script for $7 I'll make it for free if someone requested !
  18. xMKHx

    Train Barriers

    createObject createColRectangle onColShapeHit setTrainSpeed
  19. xMKHx

    [HELP]GridList

    You can take a look on DGS, Actually am using it in my server
  20. About the community: UDC is a project which has been developed since probably 3 year. It's a CnR/RPG/RP project, in this server we're trying to make things as much realistic as we can, we try to give the player the best RP experience in a RPG/CnR server. We can say this server is based on CIT (Community of Integrity and Transparency) but we got our unique ideas and code. Our goal is the make a completely enjoyable atmosphere for our players to enjoy and not get fed up. Nevertheless, we won't hide the truth that we got some scripts from MTA community (not more that 3 tho). Objectives: Reach a decent amount of players. Make realistic scripts and improve the gameplay. Make this community to the top. Create a funny and enjoyable atmosphere for the players. Features: Login panel: An advanced UI and simple interface to make it easier for the players. Vehicles System: An advanced and Realistic vehicles system that hasn't been used in any other servers before. Spawners System: An advanced vehicles system, it's not really realistic but does the job. Jobs/Employment System: An advanced employment system which contains "SOME" of the jobs as we're still developing the rest of the jobs, you can find jobs all around SA marked with blips in the map. Groups System: DGS UI that allows players to understand the system faster, it contains a lot of features for the leaders, and will be improved in further versions. Rules Panel (F1): DGS UI which contains all server rules, commands and jobs information. Banking System: Realistic banking system, which offers different payment methods (using UDC Card) which is a unique idea that hasn't been used before, the banking system is synchronised with players' accounts using a specific PIN Code that the player should enter. Turfing System: for a better CnR experience we offer you the best choice which is turfing, actually it might be only for criminals since police officers can't turf, but this feature is well designed and has a lot of perks. Fuel System: We tried to make this as much realistic as we could so we made a fuel system which synchronizes fuel refilling with vehicles type (i.e: a truck pays more than a bike to refill) Customs Shop (Credits: Al3grab): While searching the community to gain time, we found this epic modshop resource made by @Al3grab Housing System: Make your own real estate, or have your own house, this system isn't finished, but V1.0 is ready to be launched (in further versions you'll be able to buy apartments and add your own furniture). Fast Food: Heal yourself by buying some pizza hot. Drugs System: Improve your health and movements. Animations: Make some animations by pressing F7 Phone System: Transfer money, send PMs, Take a selfie, Clock, Weather, Note, GPS, Calculator and settings Other Features: Criminal Boss Police Chief JFM Bankrob Stores Rob Civilians Job (Taxi, Pizzaboy, Bus Driver, Fisherman, Rescue Man, Pilot, Ferry Captain..) Vehicles Repair System Stats Panel Settings System HD Radar Walking Style System VIP System Ammunation Teleport System Drugs Store Medkits Repair Kits Armed Robberies LAW/Gangsters Skills Safe Zones Score System Skin Shop Taser/Arrest System Quiz System Social Links: Forums Discord Official Trailer:
  21. Try this addEventHandler("onClientPlayerWasted", localPlayer, function() local name = getPlayerName(localPlayer) setTimer(function () triggerServerEvent("spawnWastedPlayer", resourceRoot, name) end, 60000, 1) end) addEvent("spawnWastedPlayer", true) addEventHandler("spawnWastedPlayer", resourceRoot, function (name) spawnPlayer(getPlayerFromName(name), 0, 0, 0) end)
  22. addEventHandler("onClientPlayerWasted", localPlayer, function() setTimer(function () triggerServerEvent("spawnWastedPlayer", resourceRoot) end, 60000, 1) end) addEvent("spawnWastedPlayer", true) addEventHandler("spawnWastedPlayer", resourceRoot, function () spawnPlayer(source, 0, 0, 0) end) Non tested
  23. untested fix = { {1606.1678466797, -1712.462890625, 13.593994140625 }, {1609.2961425781, -1712.462890625, 13.593994140625}, } for _, v in pairs(fix) do JailEscapeMarker = createMarker(v[1], v[2], v[3] + 1, "arrow", 1.5, 255, 255, 0, 150) setElementInterior(JailEscapeMarker, 0) setElementDimension(JailEscapeMarker, 0) end
×
×
  • Create New...