Jump to content

Errors please help


Resmurf

Recommended Posts

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
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 ( 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
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 by Guest
Link to comment

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

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