Alexs Posted August 28, 2012 Posted August 28, 2012 Hola a Todos, hoy desperté de uno de mis letargos sin memoria y tenia esto anotado en mi cuaderno: function isPlayerInParty( thePlayer ) local inf = getElementData( thePlayer, "player.party") if ( inf == true ) then return inf end end Esto serviria para comprobar si "player.party" esta en true?, jamas use el return
Castillo Posted August 28, 2012 Posted August 28, 2012 function isPlayerInParty ( thePlayer ) return getElementData ( thePlayer, "player.party" ) end Es mucho mas facil eso, deberia devolver: true o false.
Alexs Posted August 28, 2012 Author Posted August 28, 2012 function isPlayerInParty ( thePlayer ) return getElementData ( thePlayer, "player.party" ) end Es mucho mas facil eso, deberia devolver: true o false. Ok, creo que inconscientemente soy complicado, Gracias. PD: La "mía" debería funcionar de igual manera?
Castillo Posted August 28, 2012 Posted August 28, 2012 Funcionaria solo si el resultado es "true", pero lo mejor es directamente devolver el resultado.
Alexs Posted August 28, 2012 Author Posted August 28, 2012 Funcionaria solo si el resultado es "true", pero lo mejor es directamente devolver el resultado. Ok, en ese caso esto debería funcionar... function isPlayerInParty ( thePlayer ) return getElementData ( thePlayer, "player.party" ) end addEventHandler("onPlayerSpawn", getRootElement(), function() if isPlayerInParty(source) then killPed(source, source) end end ) ...Verdad?
Recommended Posts