Jump to content

Ryan167

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Ryan167's Achievements

Vic

Vic (3/54)

0

Reputation

  1. So I'm new into learning scripting if this script looks awful, that's why. What I'm trying to do is have a marker in dimension 11 and when the player joins the marker the player can't use a jetpack (it works but it stays working even outside the marker) and the weapons disabled, which works fine. Also with the dimensions, the marker only shows on dimension 11 but works in all dimensions, how could I make the marker only trigger on dimension 11? function createTheMarker () hMarker = createMarker (-10,-10,0, "cylinder", 55, 255, 12, 0, 100, getRootElement()) setElementDimension (hMarker, 11) end addEventHandler("onResourceStart", getRootElement(), createTheMarker) function markerHit (hitPlayer, matchingDimension) if (source == hMarker) then if (getElementType (hitPlayer) == "player") then if ( getElementDimension ( source ) == 11 ) then if ( not isPedWearingJetpack ( hitPlayer ) ) then else --create a check if player is using jetpack inside marker setTimer ( function(markerHit) setPedWearingJetpack ( hitPlayer, false ) end, 1000, 0 ) outputChatBox ( "#FF0000Jetpacks are not allowed, cheater.", hitPlayer, 255, 255, 255, true ) end end end end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) function markerHit (hitPlayer, matchingDimension) if (source == hMarker) then if (getElementType (hitPlayer) == "player") then if (getElementDimension (hitPlayer, 11)) then setPedWearingJetpack ( hitPlayer, false ) setPedWeaponSlot(hitPlayer, 0) toggleControl (hitPlayer, "fire", false) toggleControl (hitPlayer, "next_weapon", false) toggleControl (hitPlayer, "previous_weapon", false) toggleControl (hitPlayer, "aim_weapon", false) toggleControl (hitPlayer, "vehicle_fire", false) toggleControl (hitPlayer, "vehicle_secondarry_fire", false) toggleControl (hitPlayer, "vehicle_fire", false) elseif (getElementType (hitPlayer) == "vehicle") then destroyElement (hitPlayer) end end end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) function markerLeave (leavePlayer, matchingDimension) if (source == hMarker) then if (getElementType (leavePlayer) == "player") then toggleControl (leavePlayer, "fire", true) toggleControl (leavePlayer, "next_weapon", true) toggleControl (leavePlayer, "previous_weapon", true) toggleControl (leavePlayer, "aim_weapon", true) toggleControl (leavePlayer, "vehicle_fire", true) toggleControl (leavePlayer, "vehicle_secondarry_fire", true) toggleControl (leavePlayer, "vehicle_fire", true) end end end addEventHandler ("onMarkerLeave", getRootElement(), markerLeave) If someone could explain what I'm doing wrong, I'd greatly appreciate it!
  2. That one worked perfectly! I appreciated it
  3. I appreciate the fast response thank you, but that still doesn't work.
  4. local greenzone = createColRectangle ( 1995.224609375, 1516.697265625, 11, 45 ) local greenzoneradar = createRadarArea ( 1993.91796875, 1567.671875, 50, -100, 255, 255, 0, 150 ) local playerSource = getLocalPlayer function getThatMoney ( playerSource, matchingDimension ) local getmoney = getPlayerMoney ( playerSource ) if (getElementType(playerSource) == "player") then outputChatBox( "#FFFFFF* #00FF00You've entered the money zone!", playerSource, 255, 255, 109, true ) setRadarAreaFlashing ( greenzoneradar, true ) setPlayerMoney ( playerSource, getmoney +50 ) local setMoney = setPlayerMoney ( playerSource, getmoney + 5 ) setTimer (setMoney, 1000, 0) end end addEventHandler ( "onColShapeHit", root, getThatMoney ) function getThatMoneyExit ( playerSource, matchingDimension ) if (getElementType(playerSource) == "player") then outputChatBox ( "#FFFFFF* #FF0000You've left the money zone!", playerSource, 255, 255, 109, true ) setRadarAreaFlashing ( greenzoneradar, false ) end end addEventHandler ( "onColShapeLeave", greenzone, getThatMoneyExit ) ------------------------------------------------------------------------------------------------------------------------------------------------------- Hi everyone, I'm new to scripting but been playing the game off and on for 10 years and now wanting to get into learning more about scripting, so this script probably looks horrible to most. This script is supposed to have a green zone in a certain area and as the player stays in said zone should get $5 everyone second but I can't figure out the arguments on the setTimer, any help explaining what I'm doing wrong will be so helpful, thank you!
×
×
  • Create New...