AlvareZ_ Posted January 3, 2013 Posted January 3, 2013 Buenas, quisiera saber como agregar varios skins a getElementModel como por ejemplo: if getElementModel( thePlayer ) == 29 then
Alexs Posted January 3, 2013 Posted January 3, 2013 Algo así? models = {} models[29] = true --así los vas agregando models[31] = true if models[getElementModel( thePlayer)] then --así compruebas si esta en la lista.
AlvareZ_ Posted January 3, 2013 Author Posted January 3, 2013 se puede con otra forma es q no me anda con lo q lo adjusto
AlvareZ_ Posted January 3, 2013 Author Posted January 3, 2013 asi empiesa el script addEventHandler( 'onColShapeHit', root, function( thePlayer ) donde lo agrego
Alexs Posted January 3, 2013 Posted January 3, 2013 Quieres que la función solo se ejecute si el jugador tiene uno de los skins especificados? models = {} models[29] = true --así los vas agregando models[31] = true addEventHandler( 'onColShapeHit', root, function( thePlayer ) if models[getElementModel( thePlayer)] then --así compruebas si esta en la lista.
AlvareZ_ Posted January 3, 2013 Author Posted January 3, 2013 No anda models = {} models[29] = true --así los vas agregando models[31] = true addEventHandler( 'onColShapeHit', root, function( thePlayer ) if models[getElementModel( thePlayer)] then
Alexs Posted January 3, 2013 Posted January 3, 2013 Por que no es un código completo, solo lo agregue a lo que tu me diste.
NodZen Posted January 3, 2013 Posted January 3, 2013 Màs skins?... Puedes usar una tabla o asì if getElementModel( thePlayer ) == 29 or 30 or 31 then
Alexs Posted January 3, 2013 Posted January 3, 2013 Màs skins?... Puedes usar una tabla o asì if getElementModel( thePlayer ) == 29 or 30 or 31 then Creo que seria: if getElementModel( thePlayer ) == 29 or getElementModel( thePlayer ) == 30 or getElementModel( thePlayer ) == 31 then
AlvareZ_ Posted January 3, 2013 Author Posted January 3, 2013 Gracias alex me funciono! Gracias a ti tambien NOD
NodZen Posted January 3, 2013 Posted January 3, 2013 Gracias alex me funciono! Gracias a ti tambien NOD ok
Alexs Posted January 3, 2013 Posted January 3, 2013 Lo probé y funciono, jamas lo había visto funcionar en otros lenguajes. No lo usaría mucho, existen métodos mas eficientes.
AlvareZ_ Posted January 4, 2013 Author Posted January 4, 2013 ahm y me ayudarian a calcular esto: createRadarArea createColCuboid una forma para calcularla rapido y sin problemas
Alexs Posted January 4, 2013 Posted January 4, 2013 Para crear uno? yo uso el coleditor. https://community.multitheftauto.com/index.php?p= ... ls&id=3804
Recommended Posts