dazzlepoint Posted May 23, 2013 Share Posted May 23, 2013 what did i wrong i would make a marker and blip visible for the player that starts the busjob. every one can see the blips and markers local marker = createMarker(2121, 1402,10,"cylinder",2,0,255,0) addEventHandler("onMarkerHit",marker, function ( player ) if getElementType ( player ) == "player" then bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170 ) blip1 = createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255 ) name = getPlayerName ( source ) setElementVisibleTo ( myMarker, getRootElement ( ), false ) setElementVisibleTo ( myMarker, source, true ) end end,false) Link to comment
Moderators IIYAMA Posted May 23, 2013 Moderators Share Posted May 23, 2013 addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170 ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, player) --name = getPlayerName ( source ) setElementVisibleTo ( myMarker, root, false ) setElementVisibleTo ( myMarker, player, true ) end end,false) Link to comment
TAPL Posted May 23, 2013 Share Posted May 23, 2013 @IIYAMA visibleDistance: The maximum distance from the camera at which the blip is still visible (0 - 65535). if you set the visible distance to more than 65535, you will have some trouble with the blip visible. Link to comment
dazzlepoint Posted May 23, 2013 Author Share Posted May 23, 2013 hi, its a very good script but every player can see the marker, is the login system not good ? is this for client ? THANX addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170 ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, player) --name = getPlayerName ( source ) setElementVisibleTo ( myMarker, root, false ) setElementVisibleTo ( myMarker, player, true ) end end,false) Link to comment
TAPL Posted May 23, 2013 Share Posted May 23, 2013 Use visibleTo argument for the marker. https://wiki.multitheftauto.com/wiki/CreateMarker Link to comment
dazzlepoint Posted May 23, 2013 Author Share Posted May 23, 2013 Use visibleTo argument for the marker.https://wiki.multitheftauto.com/wiki/CreateMarker do you mean this ? addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170 ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, player) --name = getPlayerName ( source ) visibleTo ( myMarker, root, false ) visibleTo ( myMarker, player, true ) end end,false) Link to comment
Jacob Lenn Posted May 23, 2013 Share Posted May 23, 2013 addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170, player ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, player) --name = getPlayerName ( source ) end end,false) Link to comment
dazzlepoint Posted May 23, 2013 Author Share Posted May 23, 2013 do i change things in this script, "no" then it's not working maybe we have to change the hole script ps i want that nobody can see the marker of another player THANX addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170, player ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, player) --name = getPlayerName ( source ) end end,false) Link to comment
Jacob Lenn Posted May 23, 2013 Share Posted May 23, 2013 addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers" ) for k,v in ipairs (getElementsByType("player")) do if v == player then local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170, ) createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999) end end --name = getPlayerName ( source ) end end,false) Link to comment
dazzlepoint Posted May 23, 2013 Author Share Posted May 23, 2013 i think we have to close this topic ( on my server it's not working ) everyone did his best but if you have an working example post it ... THANX Link to comment
Castillo Posted May 24, 2013 Share Posted May 24, 2013 I suggest you to do the script client side. Link to comment
Booo Posted May 24, 2013 Share Posted May 24, 2013 (edited) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170,) unexpected symbol near ')' try this Body :: _M = createMarker(2121, 1402,10,"cylinder",2,255,0,255,255) mybus = {} myMarker = {} myBlip = {} addEventHandler("onPlayerMarkerHit",root, function ( _m ) if _M == _m then if isPedInVehicle(source) then removePedFromVehicle (source) end local mybus[source] = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( source, mybus[source] ) outputChatBox ( "you can earn money by driving to the markers",source) myMarker[source] = createMarker ( 2038.26, 1514.01, 9, "cylinder",2, 255, 255, 0, 170,source ) myBlip[source] = createBlip ( 2038, 1514, 13, 41, 0, 0, 0, 255, 0, 99999, source) setElementVisibleTo ( _m, source, false ) addEventHandler("onPlayerMarkerHit",root, function ( _m2 ) if _m2 == myMarker[source] then givePlayerMoney(source,1000000) destroyElement(_m2) destroyElement(myBlip[source]) destroyElement(mybus[source]) setElementVisibleTo ( _m, source, true ) end end) end end) Edited May 25, 2013 by Guest Link to comment
iPrestege Posted May 24, 2013 Share Posted May 24, 2013 @ Booo your code has some errors . @ SolidSnake If he do it client side the vehicle will be a fake vehicle and you know that . Link to comment
Booo Posted May 24, 2013 Share Posted May 24, 2013 @ Booo your code has some errors . ? Link to comment
dazzlepoint Posted May 24, 2013 Author Share Posted May 24, 2013 hi is this why we make mistakes it's for server THANKS I suggest you to do the script client side. Link to comment
Moderators IIYAMA Posted May 24, 2013 Moderators Share Posted May 24, 2013 It was server side.... and you didn't tell us what went wrong. "on my server it's not working" We can't do anything with this information. Link to comment
dazzlepoint Posted May 24, 2013 Author Share Posted May 24, 2013 ok yes when is use the script and i load and a random player starts busjob then every body can see the marker. THANKS is there a bug in the account system ? It was server side.... and you didn't tell us what went wrong."on my server it's not working" We can't do anything with this information. Link to comment
Moderators IIYAMA Posted May 24, 2013 Moderators Share Posted May 24, 2013 (edited) addEventHandler("onMarkerHit",createMarker(2121, 1402,10,"cylinder",2,0,255,0), function ( player ) if getElementType ( player ) == "player" then local bus = createVehicle ( 431, 2107, 1395, 10 ) warpPedIntoVehicle ( player, bus ) outputChatBox ( "you can earn money by driving to the markers",player )--< thx #Mr.Pres[T]ege (player) local myMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170,player ) local Blip = createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, player) end end,false) It must be working.... @IIYAMAvisibleDistance: The maximum distance from the camera at which the blip is still visible (0 - 65535). if you set the visible distance to more than 65535, you will have some trouble with the blip visible. Never had trouble with that, I only don't know what number it chooses, but I think the server will go for default. Edited May 24, 2013 by Guest Link to comment
dazzlepoint Posted May 25, 2013 Author Share Posted May 25, 2013 now there spawn two busses and there is an error "attempt to call a boolean value" and every player can also see the markers THANX Link to comment
Blaawee Posted May 25, 2013 Share Posted May 25, 2013 Try this : Server Side local jobMarker = createMarker( 2121, 1402, 10, "cylinder", 2, 0, 255, 0 ); local gVeh = {}; addEventHandler( "onMarkerHit", resourceRoot, function( element ) if source == jobMarker and getElementType ( element ) == "player" then if isElement( gVeh[ element ] ) then destroyElement( gVeh[ element ] ); end if isPedInVehicle( element ) then removePedFromVehicle( element ); end local gVeh[ element ] = createVehicle ( 431, 2107, 1395, 10 ); warpPedIntoVehicle ( element, gVeh[ element ] ); outputChatBox ( 'you can earn money by driving to the markers', element ); local arriveMarker = createMarker ( 2038.26, 1514.01, 9, "cylinder", 1.5, 255, 255, 0, 170, element ); local Blip = createBlip ( 2038.26, 1514.01, 13, 41, 0, 0, 0, 255, 0, 99999, element ); elseif source == arriveMarker then outputChatBox ( 'you arrived to the marker and you won $1000000', element ); givePlayerMoney( element, 1000000 ); destroyElement( source ); destroyElement( Blip ); if isElement( gVeh[ element ] ) then destroyElement( gVeh[ element ] ); end end end ); Link to comment
dazzlepoint Posted May 25, 2013 Author Share Posted May 25, 2013 mayby another person on another computer can test it, when i test it i use 2 accounts on my computer mayby there is the problem Link to comment
Booo Posted May 25, 2013 Share Posted May 25, 2013 now there spawn two busses and there is an error "attempt to call a boolean value"and every player can also see the markers THANX Copy my code again. Link to comment
dazzlepoint Posted May 25, 2013 Author Share Posted May 25, 2013 unexepted symbol near ' [ ' now there spawn two busses and there is an error "attempt to call a boolean value"and every player can also see the markers THANX Copy my code again. Link to comment
Moderators IIYAMA Posted May 25, 2013 Moderators Share Posted May 25, 2013 Did you ever tried to fix it by your self? Do even know how your own code works? Did you ever wrote a line by your self? and so "no" from who are those lines? Je probeert het niet eens, -__-" dan los je het zelf maar op. Link to comment
Booo Posted May 25, 2013 Share Posted May 25, 2013 unexepted symbol near ' [ ' now there spawn two busses and there is an error "attempt to call a boolean value"and every player can also see the markers THANX Copy my code again. 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