Resmurf Posted April 19, 2011 Share Posted April 19, 2011 ok here is the problem when i get in marker it spawn one but if u get alot it creates alot of cars reaally fast idk why is that heres my cose local myMarker = createMarker( 1676.86, -2328, 12.54, 'cylinder', 2.0, 0, 0, 255, 150 ) function MarkerHit( hitElement, matchingDimension ) createVehicle ( 468, 1676.86, -2331.48, 13.54 + 1 ) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) and my other problem is when i spawn i want it to join a default team (civilians) but it ignores the command here the code function joinHandler() local x = 1686.04 local y = -2333.92 local z = 13.54 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to SALP:RPG", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam ( hitElement, teamcivilian) Link to comment
Kenix Posted April 19, 2011 Share Posted April 19, 2011 ok here is the problem when i get in marker it spawn one but if u get alot it creates alot of cars reaally fast idk why is thatheres my cose local myMarker = createMarker( 1676.86, -2328, 12.54, 'cylinder', 2.0, 0, 0, 255, 150 ) function MarkerHit( hitElement, matchingDimension ) createVehicle ( 468, 1676.86, -2331.48, 13.54 + 1 ) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) and my other problem is when i spawn i want it to join a default team (civilians) but it ignores the command here the code function joinHandler() local x = 1686.04 local y = -2333.92 local z = 13.54 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to SALP:RPG", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) setPlayerTeam" class="kw6">setPlayerTeam ( hitElement, teamcivilian) 1. do not quite understand you want to join the team when you are join on the server or marker hit? local myMarker = createMarker( 1676.86, -2328, 12.54, 'cylinder', 2.0, 0, 0, 255, 150 ) teamcivilian = createTeam ( "Civilians", 0, 255, 0 ) function MarkerHit( hitElement, matchingDimension ) createVehicle ( 468, 1676.86, -2331.48, 13.54 + 1 ) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function joinHandler() local x = 1686.04 local y = -2333.92 local z = 13.54 spawnPlayer(source, x, y, z) setPlayerTeam" class="kw6">setPlayerTeam ( source, teamcivilian) -- or market hit? fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to SALP:RPG", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 2.when you enter the marker will be create the same vehicles as you join in marker. Link to comment
Resmurf Posted April 19, 2011 Author Share Posted April 19, 2011 nope i meant when the player join the server and they are 2 different scripts Link to comment
Kenix Posted April 19, 2011 Share Posted April 19, 2011 nope i meant when the player join the server and they are 2 different scripts I do not understand you please explain better. Link to comment
Resmurf Posted April 20, 2011 Author Share Posted April 20, 2011 i want the first script, make when a user join the SERVER, MOVE to civilian team and i dont know why not working and the second script i dont know it spawn massive cars Link to comment
Castillo Posted April 20, 2011 Share Posted April 20, 2011 (edited) function joinHandler() local x = 1686.04 local y = -2333.92 local z = 13.54 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to SALP:RPG", source) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam(source, getTeamFromName("Civilians")) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) In the second script you spawn 1 vehicle every time you hit the marker. Edited April 25, 2011 by Guest Link to comment
Resmurf Posted April 24, 2011 Author Share Posted April 24, 2011 not working check it again Link to comment
Kenix Posted April 25, 2011 Share Posted April 25, 2011 try this Full code. local myMarker = createMarker( 1676.86, -2328, 12.54, 'cylinder', 2.0, 0, 0, 255, 150 ) teamcivilian = createTeam ( "Civilians", 0, 255, 0 ) function MarkerHit( hitElement, matchingDimension ) createVehicle ( 468, 1676.86, -2331.48, 13.54 + 1 ) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function joinHandler() local x = 1686.04 local y = -2333.92 local z = 13.54 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to SALP:RPG", source) setPlayerTeam" class="kw6">setPlayerTeam(source, teamcivilian) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) Link to comment
Castillo Posted April 25, 2011 Share Posted April 25, 2011 My code didn't work? if so, maybe was because your team name is "Civilians". 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