PhantomDamn Posted August 21, 2013 Posted August 21, 2013 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... |El Sabio no tiene intereses propios, hace suyos los intereses del pueblo| (scripting= -20%)
manawydan Posted August 21, 2013 Posted August 21, 2013 I think so "Querer não é poder, mas tentar é avançar"!
Atouk Posted August 21, 2013 Posted August 21, 2013 ya que el spawn de 50p es por teams podrias hacerlo que cuando ese jugador esta el team 'Shooter' Lo respawneas en ese vehiculo..
PhantomDamn Posted August 21, 2013 Author Posted August 21, 2013 seccion spanish |El Sabio no tiene intereses propios, hace suyos los intereses del pueblo| (scripting= -20%)
PhantomDamn Posted August 21, 2013 Author Posted August 21, 2013 le corrigo al primer post que me respondio para que sepa que es la seccion español.. y como lo hago? |El Sabio no tiene intereses propios, hace suyos los intereses del pueblo| (scripting= -20%)
Atouk Posted August 21, 2013 Posted August 21, 2013 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..
AlvareZ_ Posted August 21, 2013 Posted August 21, 2013 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)
Alexs Posted August 21, 2013 Posted August 21, 2013 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'. Developer @ MYVAL
AlvareZ_ Posted August 21, 2013 Posted August 21, 2013 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)
Alexs Posted August 21, 2013 Posted August 21, 2013 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. Developer @ MYVAL
AlvareZ_ Posted August 22, 2013 Posted August 22, 2013 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)
Alexs Posted August 22, 2013 Posted August 22, 2013 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 ) Developer @ MYVAL
PhantomDamn Posted August 25, 2013 Author Posted August 25, 2013 bueno no me funciono thePlayer getRootElement root trate de hacer varias cosas pero no me salio .___. |El Sabio no tiene intereses propios, hace suyos los intereses del pueblo| (scripting= -20%)
Alexs Posted August 25, 2013 Posted August 25, 2013 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'? Developer @ MYVAL
AlvareZ_ Posted August 25, 2013 Posted August 25, 2013 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 )
Alexs Posted August 25, 2013 Posted August 25, 2013 (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 August 25, 2013 by Guest Developer @ MYVAL
Alexs Posted August 25, 2013 Posted August 25, 2013 Igual funcionaria!!! No, incluso lo probé y dice 'Bad argument @ getPlayerTeam'; Es tan sencillo como que creer que tienes la razón no te hace tener la razón. Developer @ MYVAL
Alexs Posted August 25, 2013 Posted August 25, 2013 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. Tu error: Developer @ MYVAL
PhantomDamn Posted August 25, 2013 Author Posted August 25, 2013 .___. |El Sabio no tiene intereses propios, hace suyos los intereses del pueblo| (scripting= -20%)
manawydan Posted August 25, 2013 Posted August 25, 2013 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 ) "Querer não é poder, mas tentar é avançar"!
EstrategiaGTA Posted August 25, 2013 Posted August 25, 2013 seccion spanish Es de Brasil, algo de español entenderá (ya que el portugués es parecido ^^)
Recommended Posts