Jump to content

Problems


Jaysds1

Recommended Posts

  • Replies 365
  • Created
  • Last Reply

Top Posters In This Topic

Actually, that depends. For race I'd suggest 36, so other players won't have an advantage with a better pc (FPS difference really matters!), for deathmatch pretty much the same. Freeroam however, can easily be set to 100 indeed although I prefer 60 myself because this seems to be somewhat more stable.

Link to comment

Hi all,

I was having a problem with this isInsideRadarArea function,

Every time a person goes in the Col Shape, it's suppose to check if the player is inside a Radar Area, but it says that there's a nil for argument 1 which is the radar area:

createRadarArea(2428.345703125,-1628.1298828125,200,-110,0,255,0,100) 
createColRectangle(2444.5830078125,-1719.29296875, 190,105) 
  
addEventHandler("onClientColShapeHit",getRootElement(), 
function(theElement,theArea,matchingDimension) 
    if (theElement == getLocalPlayer()) and (matchingDimension == 0) then 
        if (getPlayerTeam(theElement) == getTeamFromName("Grove Street Famillies") or getTeamFromName("Ballas") or getTeamFromName("Varous Los Aztecas") or getTeamFromName("Los Santos Vagos")) then 
            x,y = getElementPosition(theElement) 
            if (isInsideRadarArea(theArea,x,y) == true) then 
                r,g,b = getTeamColor(getPlayerTeam(theElement)) 
                rr,gg,bb = getRadarAreaColor(theArea) 
                if (r == rr and g == gg and b == bb) then 
                    outputChatBox("*TURF*: You entered your gangs territory.",r,g,b) 
                else 
                    outputChatBox("*TURF*: YOU HAVE ENTERED ANOTHER GANGS TERRITORY, STAY IN THIS TERITORY FOR 22 SECONDS OR KILL A GANG MEMBER TO TRIGGER A WAR!",255,0,0) 
                    triggerEvent("war",getLocalPlayer()) 
                end 
            end 
        elseif (getPlayerTeam(theElement) == getTeamFromName("Los Santos Police Department")) then 
            outputChatBox("*TURF*: YOU HAVE ENTERED A GANGS TERRITORY, IT MIGHT BE UNDER WAR",100,0,0) 
        end 
    end 
end) 

Link to comment

hi all,

I want to know how to update this label,

When the cars are respawning this label comes up and shows how much seconds is left to respawn all the vehicles

but the seconds don't get updated:

-- Server-side 
function respawn(command) 
outputChatBox("RESPAWNING ALL UNOCCUPIED VEHICLES IN 30Secs") 
outputDebugString("Cars Respawning") 
    rspwn = setTimer(function () 
    local vehicles = getElementsByType ( "vehicle" ) -- Return all the vehicles in a table 
    for k, vehicle in ipairs ( vehicles ) do -- For every vehicle do the following... 
    if isEmpty( vehicle ) then 
    local seats = getVehicleMaxPassengers(vehicle) 
                resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time 
                respawnVehicle ( vehicle ) 
            end 
        end 
outputDebugString("Cars Respawned") 
outputChatBox("ALL UNOCCUPIED VEHICLES RESPAWNED") 
triggerClientEvent("r_close",getRootElement()) 
    end,30000, 1) 
remaining = getTimerDetails(rspwn) 
triggerClientEvent("r_open",getRootElement(),remaining) 
    if (command) then 
        resetTimer(auto) 
        outputDebugString("Timer Reset") 
    end 
end 
  
-- Client-side 
addEvent("r_open",true) 
addEventHandler("r_open",getRootElement(),function(remaining)   rlbl = guiCreateLabel(13,572,106,15,"Respawning cars in: ",false)   guiSetAlpha(rlbl,1) rlbl2 = guiCreateLabel(123,572,25,15,tostring(remaining),false) guiSetAlpha(rlbl2,1)    end) 
  
addEvent("r_close",true) 
addEventHandler("r_close",getRootElement(),function() destroyElement(rlbl)  destroyElement(rlbl2)   end) 
  

Link to comment
-- Server-side 
function respawn(command) 
outputChatBox("RESPAWNING ALL UNOCCUPIED VEHICLES IN 30Secs") 
outputDebugString("Cars Respawning") 
    rspwn = setTimer(function () 
    local vehicles = getElementsByType ( "vehicle" ) -- Return all the vehicles in a table 
    for k, vehicle in ipairs ( vehicles ) do -- For every vehicle do the following... 
        if isEmpty( vehicle ) then 
            local seats = getVehicleMaxPassengers(vehicle) 
            resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time 
            respawnVehicle ( vehicle ) 
        end 
    end 
    outputDebugString("Cars Respawned") 
    outputChatBox("ALL UNOCCUPIED VEHICLES RESPAWNED") 
    triggerClientEvent("r_close",getRootElement()) 
end,30000,1) 
triggerClientEvent("r_open",getRootElement(),remaining) 
update = setTimer(function () remaining = getTimerDetails(rspwn) triggerClientEvent("r_open",getRootElement(),remaining) end, 1000, 30) 
    if (command) then 
        resetTimer(rspwn) 
        resetTimer(update) 
        outputDebugString("Timer Reset") 
    end 
end 

-- Client-side 
addEvent("r_open",true) 
addEventHandler("r_open",getRootElement(), 
function(remaining) 
    if isElement(rlbl) and isElement(rlbl2) then 
        guiSetText(rlbl2,tostring(remaining)) 
    else 
        rlbl = guiCreateLabel(13,572,106,15,"Respawning cars in: ",false) 
        rlbl2 = guiCreateLabel(123,572,25,15,tostring(remaining),false) 
        guiSetAlpha(rlbl,1) 
        guiSetAlpha(rlbl2,1) 
    end 
end) 
  
addEvent("r_close",true) 
addEventHandler("r_close",getRootElement(), 
function() 
    if isElement(rlbl) and isElement(rlbl2) then 
        destroyElement(rlbl) 
        destroyElement(rlbl2) 
    end 
end) 

Try it, I'm not sure if it'll work, the code is a bit messed.

Link to comment

Hi all,

I was having a problem with my script for the past few days,

When the player kills the ped, there suppose to warp to another Position, but After the player kills the ped an error message comes up and they don't move anywhere:

  
    t1 = createPed(23,-3666.6447753906,-2015.8166503906,11.793441772461,124.23803710938,true) 
    setElementFrozen(t1,true) 
    addEventHandler("onPedWasted",getRootElement(), 
    function(killer) 
        if (getElementModel(source) == 23)  
        if (getElementType(killer) == "player") then 
            if (source == t1) then 
                outputChatBox("",killer,100,0,0) 
                t2 = createPed(23,-3660.0227050781,-2013.6018066406,9.9486846923828,124.23803710938,true) 
                setElementFrozen(t2,true) 
            elseif (source == t2) then 
                outputChatBox("",killer,137,0,0) 
                t3 = createPed(23,-3652.7902832031,-2014.0773925781,8.7459049224854,124.23803710938,true) 
                setElementFrozen(t3,true) 
            elseif (source == t3) then 
                outputChatBox("",killer,137,0,0) 
                triggerEvent("finish1",killer) 
                setTimer(outputChatBox,7000,1,"",killer,137,0,0) 
                t4 = createPed(23,-3609.2392578125,-2068.7431640625,6.6531052589417,118.68984985352,true) 
            elseif (source == t4) then 
                outputChatBox("",137,0,0) 
                t5 = createPed(23,-3600.7316894531,-2065.0659179688,6.3656249046326,123.07897949219,true) 
            elseif (source == t5) then 
                outputChatBox("",137,0,0) 
                t6 = createPed(23,-3590.8957519531,-2061.6762695313,6.3656249046326,126.83633422852,true) 
            elseif (source == t6) then 
                outputChatBox("",137,0,0) 
                t7 = createPed(23,-3585.2629394531,-2059.3198242188,6.2059550285339,122.42526245117,true) 
            elseif (source == t7) then 
                outputChatBox("",killer,137,0,0) 
                triggerEvent("finish2",killer) 
                setTimer(outputChatBox,7000,1,"",killer,137,0,0) 
            end 
        end 
        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...