Jump to content

spawn 50p + script shooter ( spawnpoint )


PhantomDamn

Recommended Posts

Posted

hola quisiera saber si con el spawn de 50p puedo crear una categoria ejemplo "Shooter" que al entrar a unos de los team de cierta categoria haga spawnpoin en un auto directamente...

Posted

ya que el spawn de 50p es por teams podrias hacerlo que cuando ese jugador esta el team 'Shooter' Lo respawneas en ese vehiculo..

Posted

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

Posted
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) 

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

Posted

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) 

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

Posted

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) 

Posted

: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 
) 

Posted
bueno no me funciono
 thePlayer  
getRootElement 
root   

trate de hacer varias cosas pero no me salio .___.

¿Error en el debug? ¿Probaste ver si 'team' existe y es un 'team'? ¿Cambiaste 'NOMBRE' y 'MODELO'?

Posted

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 
) 

Posted (edited)
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
Posted
Y por alguna razón editaste el tuyo ?, HAHA!

¿El mio? el mio sigue igual... solo agregue la etiqueta de 'wiki' a 'getPlayerTeam' por una cosa de costumbre y añadí un par de cosas para que al probar si funciona no falle, revisa y veras que es exactamente igual.

DrHouseFacepalm-tile.jpg

:roll:

Tu error:

Sintiacutetulo-3_zps96e113bd.png

Posted

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 
) 
  

  • Recently Browsing   0 members

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