Jump to content

spawn 50p + script shooter ( spawnpoint )


PhantomDamn

Recommended Posts

Porque no probas con esto?

  
vehicle = createVehicle ( id, x, y, z  ) 
  
function addPlayerToVehicle( source ) 
local team = getTeamFromName ( "NOMBRE DEL TEAM" ) 
if team then 
setElementPosition ( vehicle ) 
end 
end 
addEventHandler ( "onPlayerSpawn", getElementRoot(), addPlayerToVehicle ) 

Decime si esta bien, aunque no creo que deba usar ese setElementPosition pero no se cual otra funcion hay, probalo..

Link to comment
addEventHandler ( "onPlayerSpawn", getRootElement(), 
function ( source ) 
if ( getPlayerTeam(source) == "Nombre del Team" ) then 
   local x, y, z = getElementPosition(source) 
   local carro = createVehicle ( id, x, y, z  + 10) 
   warpPedIntoVehicle(source, carro) 
 end 
end) 

Link to comment
addEventHandler ( "onPlayerSpawn", getRootElement(), 
function ( source ) 
if ( getPlayerTeam(source) == "Nombre del Team" ) then 
   local x, y, z = getElementPosition(source) 
   local carro = createVehicle ( id, x, y, z  + 10) 
   warpPedIntoVehicle(source, carro) 
 end 
end) 

Tienes dos errores, 'getPlayerTeam' no devuelve un 'string' y 'source' no debe ir en la función, tambien te aconsejo usar root en vez de 'getRootElement'.

Link to comment

Ami me parece que esta Bien, y seria lo mismo source que thePlayer y root es lo mismo que getRootElement(), :) pero bueno como quieras:

addEventHandler ( "onPlayerSpawn", getRootElement(), 
function ( thePlayer ) 
local teamaa = getPlayerTeam(thePlayer) 
if ( teamaa  == "Nombre del Team" ) then 
   local x, y, z = getElementPosition(thePlayer) 
   local carro = createVehicle ( id, x, y, z  + 10) 
   warpPedIntoVehicle(thePlayer, carro) 
 end 
end) 

Link to comment
Ami me parece que esta Bien, y seria lo mismo source que thePlayer y root es lo mismo que getRootElement(), :) pero bueno como quieras:
addEventHandler ( "onPlayerSpawn", getRootElement(), 
function ( thePlayer ) 
local teamaa = getPlayerTeam(thePlayer) 
if ( teamaa  == "Nombre del Team" ) then 
   local x, y, z = getElementPosition(thePlayer) 
   local carro = createVehicle ( id, x, y, z  + 10) 
   warpPedIntoVehicle(thePlayer, carro) 
 end 
end) 

Casi los mismos errores: 'thePlayer' es un 'float', no un jugador; 'teamaa' es un 'team', no un 'string' y 'getRootElement' consume mas que root, cosa que en el lado del servidor debería preocuparte.

Link to comment

Intenta :/

addEventHandler ( "onPlayerSpawn", getRootElement(), 
function ( source ) 
local teams =  getPlayerTeam(source) 
if (getTeamName(teams)  == "Nombre del Team" ) then 
   local x, y, z = getElementPosition(source) 
   local carro = createVehicle ( id, x, y, z  + 10) 
   warpPedIntoVehicle(source, carro) 
 end 
end) 

Link to comment

:roll:

Usa esto:

addEventHandler( 'onPlayerSpawn', root, 
  function(_,_,_,_,theTeam) 
    if getTeamName( theTeam ) == "NOMBRE" then 
      local x, y, z = getElementPosition( source ) 
      warpPedIntoVehicle( source, createVehicle( MODELO, x, y, z + 1.75 ) ) 
    end 
  end 
) 

Link to comment

No funciona yo lo Probe, Intenta esto:

addEventHandler( "onPlayerSpawn", root, 
  function(source) 
         local theTeam = getPlayerTeam(source) 
        if theTeam and getTeamName(theTeam) == "NOMBRE" then 
      local x, y, z = getElementPosition( source ) 
      warpPedIntoVehicle( source, createVehicle( ID, x, y, z + 1.75 ) ) 
    end 
  end 
) 

Link to comment
No funciona yo lo Probe, Intenta esto:
addEventHandler( "onPlayerSpawn", root, 
  function(source) 
         local theTeam = getPlayerTeam(source) 
        if theTeam and getTeamName(theTeam) == "NOMBRE" then 
      local x, y, z = getElementPosition( source ) 
      warpPedIntoVehicle( source, createVehicle( ID, x, y, z + 1.75 ) ) 
    end 
  end 
) 

Por ultima vez: 'source' no va en los argumentos.

De paso probé el mio y si funciona!

addEventHandler( 'onPlayerSpawn', root, 
  function(_,_,_,_,theTeam) 
    outputChatBox( tostring(getTeamName( theTeam ) or 'NONE') ) 
    if getTeamName( theTeam ) == "NOMBRE" then 
      local x, y, z = getElementPosition( source ) 
      warpPedIntoVehicle( source, createVehicle( MODELO or 411, x, y, z + 1.75 ) ) 
    end 
  end 
) 
  

Le puse un 'outputChatBox' para que revises tu 'team'.

Edited by Guest
Link to comment

probar este

local VeiculosT = {} 
  
addEventHandler( "onPlayerSpawn", getRootElement(), 
  function() 
   if (getPlayerTeam(source) == getTeamFromName("TuTeamExemplo")) then 
      local x, y, z = getElementPosition( source ) 
      VeiculosT[source] = createVehicle( MODELO, x, y, z + 1.75 ) 
      warpPedIntoVehicle( source,VeiculosT[source]) 
    end 
  end 
) 
  

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...