-
Posts
148 -
Joined
-
Last visited
About xMKHx
- Birthday 04/02/2000
Details
-
Gang
NoGang
-
Location
Tunisia
-
Occupation
Lua Programmer
-
Interests
Nothing :)
Recent Profile Visitors
3,415 profile views
xMKHx's Achievements
Busta (15/54)
22
Reputation
-
Hello, can you please post your code.
-
Check if the problem in the host or your resources
-
Client and server sides and meta.xml
-
Post your code and meta please
-
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)
-
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)
-
There is a lot of examples on wiki https://wiki.multitheftauto.com/wiki/AddDebugHook
-
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
-
What do you exactly want to do ?
-
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)
-
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 )
-
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