Jump to content

Help, Guys pelase


AjaxFTW

Recommended Posts

Post the whole code because that's impossbile, or just a part when you used this function.

for eample this code

   local level = getPlayerWantedLevel ( localPlayer ) 
    if ( level > 0 ) then 
    toggleControl(localPlayer, "sprint", false) 
    end 

was working with me since 2 days ago 100%

Now it's not working and all th scripts which have code toggle not working and these scripts all was working 100% good.

Link to comment
It should be like that,
  local level = getPlayerWantedLevel () 
    if ( level > 0 ) then 
    toggleControl("sprint", false) 
    end 

Bro it's part of full code here you are the full code

function enterSafeZone(element, matchingDimension) 
   local level = getPlayerWantedLevel ( localPlayer ) 
    if ( level > 0 ) then 
    toggleControl(localPlayer, "sprint", false) 
    end 
    if (element ~= localPlayer or not matchingDimension) then return end 
    if (getElementDimension(element) ~= 0) then return end 
    if (isPlayerInTeam(localPlayer, "Staff")) then return end 
    if (isTimer(leaveTimer)) then killTimer(leaveTimer) end 
    if getElementHealth(localPlayer) <= 30 then 
       setElementHealth(localPlayer, 0) 
       exports.CORtexts:output("you have been killed for camping!", 255, 0, 0) end 
    if (isPlayerInTeam(localPlayer, "Police Force") or isPlayerInTeam(localPlayer, "Police") or isPlayerInTeam(localPlayer, "Government") or isPlayerInTeam(localPlayer, "SWAT")) then 
        exports.CORtexts:output("You have entered a no-camping zone.", 0, 255, 0) 
        setPedWeaponSlot(localPlayer, 0) 
        exports.CIFhelp:modTextBar("campHandler", "Protected, no camp area", 0, 255, 0) 
    else 
        setPedWeaponSlot(localPlayer, 0) 
        exports.CIFhelp:modTextBar("campHandler", "Protected, no camp area", 0, 255, 0) 
    end 
end 
  

Link to comment
function enterSafeZone(element, matchingDimension) 
   local level = getPlayerWantedLevel () 
    if ( level > 0 ) then 
    toggleControl("sprint", false) 
    end 
    if (element ~= localPlayer or not matchingDimension) then return end 
    if (getElementDimension(element) ~= 0) then return end 
    if (isPlayerInTeam(localPlayer, "Staff")) then return end 
    if (isTimer(leaveTimer)) then killTimer(leaveTimer) end 
    if getElementHealth(localPlayer) <= 30 then 
       setElementHealth(localPlayer, 0) 
       exports.CORtexts:output("you have been killed for camping!", 255, 0, 0) end 
    if (isPlayerInTeam(localPlayer, "Police Force") or isPlayerInTeam(localPlayer, "Police") or isPlayerInTeam(localPlayer, "Government") or isPlayerInTeam(localPlayer, "SWAT")) then 
        exports.CORtexts:output("You have entered a no-camping zone.", 0, 255, 0) 
        setPedWeaponSlot(localPlayer, 0) 
        exports.CIFhelp:modTextBar("campHandler", "Protected, no camp area", 0, 255, 0) 
    else 
        setPedWeaponSlot(localPlayer, 0) 
        exports.CIFhelp:modTextBar("campHandler", "Protected, no camp area", 0, 255, 0) 
    end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...