Jump to content

Como puedo Privatisar Autos para los clanes?


PaoloPG

Recommended Posts

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

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

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

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

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
  • Recently Browsing   0 members

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