PaoloPG Posted March 29, 2013 Share Posted March 29, 2013 Hola, quiero saver como privatisar los autos para los clanes ai un script o algo ? se puede juntar con gang system de castillo ? Link to comment
Alexs Posted March 29, 2013 Share Posted March 29, 2013 Nunca use el recurso de @Solidsnake14, pero si tiene alguna función para conseguir tu 'gang' actual, se puede, solo añade un estamento al subirse al vehículo (el evento es "onVehicleStartEnter") y si es distinto al 'gang' que puede subir a los vehiculos, cancelas el evento (cancelEvent). Ejemplo (por Teams): addEventHandler( "onVehicleStartEnter", root, function ( thePlayer ) if getTeamName( getPlayerTeam( thePlayer ) ) ~= "TEAM" then cancelEvent() end end ) Este ejemplo no deja subir a ningún vehículo a los jugadores que no estén en el team llamado "TEAM". Link to comment
Alexs Posted March 29, 2013 Share Posted March 29, 2013 Donde pongo eso e_e En algún recurso. Link to comment
FraN-724 Posted March 29, 2013 Share Posted March 29, 2013 Puedes utilizar createVehicle isObjectInACLGroup Si los clanes los tienes hechos por la ACL o puedes usar la función que te dio Alexs que es por Team Y si lo quieres por el gang system debes utilizar esta línea. if getElementData(localPlayer,"gang") == "CLAN" then Link to comment
Sasu Posted March 29, 2013 Share Posted March 29, 2013 Puedes utilizar createVehicle isObjectInACLGroup Si los clanes los tienes hechos por la ACL o puedes usar la función que te dio Alexs que es por Team Y si lo quieres por el gang system debes utilizar esta línea. if getElementData(localPlayer,"gang") == "CLAN" then localPlayer es una variable de client-side. Link to comment
Sasu Posted March 30, 2013 Share Posted March 30, 2013 Yo te hare este script. Privatizará el vehiculo Infernus para el gang "FBI" . Tu se lo cambias. function privatizar( thePlayer ) if getElementModel( source ) == 411 then if getElementData( thePlayer, "gang" ) == "FBI" then outputChatBox("Bienvenido al auto de FBI", thePlayer, 0, 255, 0, false) else cancelEvent() end end end addEventHandler("onVehicleStartEnter", getRootElement(), privatizar) Link to comment
PaoloPG Posted April 7, 2013 Author Share Posted April 7, 2013 Ok esta es la parte de privatizar tengo k poner cordernadas para donde aparesca el auto ? function privatizar( thePlayer ) if getElementModel( source ) == 411 then if getElementData( thePlayer, "gang" ) == "CACA" then outputChatBox("esteauto", thePlayer, 0, 255, 0, false) else cancelEvent() end end end addEventHandler("onVehicleStartEnter", getRootElement(), privatizar) Link to comment
Sasu Posted April 7, 2013 Share Posted April 7, 2013 No. Esto privatiza cualquier auto que sea infernus. Link to comment
Alexs Posted April 7, 2013 Share Posted April 7, 2013 Para que aparezca el auto tienes que usar: createVehicle y comprobar que el vehículo creado sea al que te estas subiendo, si no, los que no estén en el 'clan' no podrán subir a ningún infernus. Ejemplo: local lol = createVehicle( 411, 0, 0, 10 ) function privatizar( thePlayer ) if source == lol then if getElementData( thePlayer, "gang" ) == "CACA" then outputChatBox("esteauto", thePlayer, 0, 255, 0, false) else cancelEvent() end end end addEventHandler("onVehicleStartEnter", getRootElement(), privatizar) Link to comment
PaoloPG Posted April 7, 2013 Author Share Posted April 7, 2013 Se puede Privatizar por mapa ? yo no ago esta pregunta mi Jefe del server me dice k pregunte Link to comment
FraN-724 Posted April 7, 2013 Share Posted April 7, 2013 A qué te refieres con Privatizar por mapa?, no entendí. Link to comment
RekZ Posted April 8, 2013 Share Posted April 8, 2013 se entiende perfectamente creo ke dice de poner los autos con el editor de mta y ese mapa privatizar los vehiculos que se encuentre en el yo tengo eso para los clanes , pero no es un map es un archivo xml Link to comment
FraN-724 Posted April 8, 2013 Share Posted April 8, 2013 Creo que le podría servir esta función getElementByID Link to comment
Recommended Posts