Jump to content

Problem


Wei

Recommended Posts

Hi. I have problem. When I hit marker I start a route and when otheplayer hit it(he can't see it) then it starts again/(only for me). How can I fix?

CODE client:

function createHackerRoute() 
    if getElementData( localPlayer, "Role" ) == "Hacker" then 
        if not getElementData( localPlayer, "Route" ) then 
        outputChatBox("Your hacker route has been started", 255, 255, 0, true) 
        cMakerAndStartNewRoute() 
        setElementData( localPlayer, "Route", true ) 
        else 
        outputChatBox("You have allready started a route", 255, 255, 0, true) 
        end 
    end 
end 
addCommandHandler("hackerroute", createHackerRoute) 
  
function cMakerAndStartNewRoute() 
    local x,y,z = mathTheHackerRandomPosition() 
    hackerMarker = createMarker( x,y,z-1, "cylinder", 2 ) 
    hackerBlip = createBlipAttachedTo( hackerMarker, 19 ) 
    addEventHandler("onClientMarkerHit", hackerMarker, cTimerHacker) 
end 
  
function cTimerHacker() 
    theTimer = setTimer( checkIFisTimer , 30000, 1 ) 
    setElementFrozen( localPlayer, true ) 
    addEventHandler ( "onClientRender", root, createText ) 
end 

Link to comment
function refreshPoliceComputerGridList() 
guiGridListClear ( policeComputerGUI["PlayerGridList"] ) 
    for index, player in ipairs (getElementsByType("player")) do 
        if getPlayerWantedLevel( player ) >= 1 then 
        local row = guiGridListAddRow ( policeComputerGUI["PlayerGridList"] ) 
        guiGridListSetItemText ( policeComputerGUI["PlayerGridList"], row, policeComputerGUI["PlayerNameColumn"], getPlayerName ( player ), false, false ) 
        guiGridListSetItemText ( policeComputerGUI["PlayerGridList"], row, policeComputerGUI["PlayerWantedLevel"], "  "..getPlayerWantedLevel( player ), false, false ) 
        guiGridListSetItemText ( policeComputerGUI["PlayerGridList"], row, policeComputerGUI["MoneyBonus"], "  "..getPlayerWantedLevel( player )*15000, false, false ) 
        end 
    end 
end 

Why it adds all players and all players has the same wanted level as I ?

Link to comment
Guest Guest4401
int getPlayerWantedLevel ( ) 

Look at the getPlayerWantedLevel's syntax. If you're using it clientside, it only gets the wanted level of localPlayer.

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...