Wei Posted July 8, 2012 Share Posted July 8, 2012 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
50p Posted July 8, 2012 Share Posted July 8, 2012 Check if the hit element is "you". Since you seem to do it client-side then check if the hit element is localPlayer. Link to comment
Wei Posted July 8, 2012 Author Share Posted July 8, 2012 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 Posted July 8, 2012 Share Posted July 8, 2012 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
Guest Guest4401 Posted July 8, 2012 Share Posted July 8, 2012 Get the wanted player of every player serverside, and then trigger it clientside. Link to comment
Wei Posted July 8, 2012 Author Share Posted July 8, 2012 how can I set screen blur level ? Link to comment
Jaysds1 Posted July 8, 2012 Share Posted July 8, 2012 (edited) setBlurLevel or setPlayerBlurLevel Edited July 9, 2012 by Guest Link to comment
Wei Posted July 8, 2012 Author Share Posted July 8, 2012 But it's allways the same... Link to comment
Jaysds1 Posted July 9, 2012 Share Posted July 9, 2012 What value's have you used? Try experimenting and setting the blur level 255 then 0 and see the difference. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now