DefearT Posted September 9, 2012 Share Posted September 9, 2012 Hola, una ayuda con este script, yo quiero que regrese a su skin original cuando uso el spawn! Me refiero a que me matan los zombies, y cambia de skin a un zombie y si uso la cura cambia al skin de Cj, yo no quiero que pase eso! Quiero que cuando use la cura vuelva al skin que tenia antes de ser zombie! De paso que cuando me da un golpe me combierte en zombie, y deberia ser que cuando te matan ellos! teamzombie = createTeam ( "Zombie", 250, 0, 0 ) function rewardOnWasted ( attacker, attackerweapon, bodypart, loss ) if(attackerweapon == 0) and getElementData(attacker,"zombie") then if not getElementData (source,"zombie") then givePlayerMoney ( attacker, 5000 ) setElementData ( source, "zombie", true ) setPlayerTeam ( source, teamzombie ) setPedSkin ( source, 13 ) setPedHeadless ( source, false ) end end end addEventHandler ( "onPlayerDamage", getRootElement(), rewardOnWasted ) infection = createPickup (2577.66, 2841.528, 10.82, 3, 1242, 15000 ) function infected ( thePlayer ) setPlayerTeam ( thePlayer, teamzombie ) setPedSkin ( thePlayer, 13 ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", true ) end addEventHandler ( "onPickupUse", infection, infected ) cure = createPickup (2572.37, 2841.50, 10.82, 3, 1240, 15000 ) function cured ( thePlayer ) setPedSkin ( thePlayer, 0 ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", false ) end addEventHandler ( "onPickupUse", cure, cured ) Link to comment
Arsilex Posted September 9, 2012 Share Posted September 9, 2012 usa Skin = getElementModel ( thePlayer ) y despues cuando se coja la cura pones setElementModel ( thePlayer,Skin ) Link to comment
DefearT Posted September 9, 2012 Author Share Posted September 9, 2012 Ok; asi? teamzombie = createTeam ( "Zombie", 250, 0, 0 ) function rewardOnWasted ( attacker, attackerweapon, bodypart, loss ) if(attackerweapon == 0) and getElementData(attacker,"zombie") then if not getElementData (source,"zombie") then givePlayerMoney ( attacker, 5000 ) setElementData ( source, "zombie", true ) setPlayerTeam ( source, teamzombie ) setPedSkin ( source, 13 ) setPedHeadless ( source, false ) end end end addEventHandler ( "onPlayerDamage", getRootElement(), rewardOnWasted ) Skin = getElementModel ( thePlayer ) infection = createPickup (2577.66, 2841.528, 10.82, 3, 1242, 15000 ) function infected ( thePlayer ) setPlayerTeam ( thePlayer, teamzombie ) setPedSkin ( thePlayer, 13 ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", true ) end addEventHandler ( "onPickupUse", infection, infected ) cure = createPickup (2572.37, 2841.50, 10.82, 3, 1240, 15000 ) function cured ( thePlayer ) setElementModel ( thePlayer,Skin ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", false ) end addEventHandler ( "onPickupUse", cure, cured ) Link to comment
Arsilex Posted September 9, 2012 Share Posted September 9, 2012 no entiendo una cosa de ese script si dice que cuando el jugador muera por que usas "onPlayerDamage" y no asi no eso lo tienes que poner en la funcion que ejecutas al morir osea ponerlo dentro de rewardOnWasted lo de get Link to comment
DefearT Posted September 9, 2012 Author Share Posted September 9, 2012 No aun sigue igual, solo que esta vez no cambio ni al de cj! teamzombie = createTeam ( "Zombie", 250, 0, 0 ) function rewardOnWasted ( attacker, attackerweapon, bodypart, loss ) if(attackerweapon == 0) and getElementData(attacker,"zombie") then if not getElementData (source,"zombie") then givePlayerMoney ( attacker, 5000 ) setElementData ( source, "zombie", true ) Skin = getElementModel ( thePlayer ) setPlayerTeam ( source, teamzombie ) setPedSkin ( source, 13 ) setPedHeadless ( source, false ) end end end addEventHandler ( "onPlayerDamage", getRootElement(), rewardOnWasted ) infection = createPickup (2577.66, 2841.528, 10.82, 3, 1242, 15000 ) function infected ( thePlayer ) setPlayerTeam ( thePlayer, teamzombie ) setPedSkin ( thePlayer, 13 ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", true ) end addEventHandler ( "onPickupUse", infection, infected ) cure = createPickup (2572.37, 2841.50, 10.82, 3, 1240, 15000 ) function cured ( thePlayer ) setElementModel ( thePlayer,Skin ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", false ) end addEventHandler ( "onPickupUse", cure, cured ) Link to comment
Arsilex Posted September 9, 2012 Share Posted September 9, 2012 por que no pusiste el getElementModel.... Link to comment
DefearT Posted September 9, 2012 Author Share Posted September 9, 2012 Si lo puse mira: Y como hacer para que cuando tome la cure regrese tambien a su team.. es casi lo mismo creoo? teamzombie = createTeam ( "Zombie", 250, 0, 0 ) function rewardOnWasted ( attacker, attackerweapon, bodypart, loss ) if(attackerweapon == 0) and getElementData(attacker,"zombie") then if not getElementData (source,"zombie") then givePlayerMoney ( attacker, 5000 ) setElementData ( source, "zombie", true ) Skin = getElementModel ( thePlayer ) setPlayerTeam ( source, teamzombie ) setPedSkin ( source, 13 ) setPedHeadless ( source, false ) end end end addEventHandler ( "onPlayerDamage", getRootElement(), rewardOnWasted ) infection = createPickup (2577.66, 2841.528, 10.82, 3, 1242, 15000 ) function infected ( thePlayer ) setPlayerTeam ( thePlayer, teamzombie ) setPedSkin ( thePlayer, 13 ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", true ) end addEventHandler ( "onPickupUse", infection, infected ) cure = createPickup (2572.37, 2841.50, 10.82, 3, 1240, 15000 ) function cured ( thePlayer ) setElementModel ( thePlayer,Skin ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", false ) end addEventHandler ( "onPickupUse", cure, cured ) Link to comment
BorderLine Posted September 9, 2012 Share Posted September 9, 2012 mira de partida en ese getElementModel, no as definido thePlayer debes usar getElementModel(source) Link to comment
DefearT Posted September 9, 2012 Author Share Posted September 9, 2012 el debug me dice que setElementModel es un mal argumento @ Link to comment
Arsilex Posted September 9, 2012 Share Posted September 9, 2012 estas seguro que pusiste Skin = getElementModel ( source ) Link to comment
DefearT Posted September 9, 2012 Author Share Posted September 9, 2012 Asi esta! EL script, y si mejor invento algo mejor? No se podra usar el chaleco(armor) para la infeccion? Me refiero a que cada vez que los zombies ataken al jugador le den armor y le quiten la vida porsupuesto, pero al reves para que cuando el armor llege a 100 se combierta en zombie... Creo que es mas facil??? teamzombie = createTeam ( "Zombie", 250, 0, 0 ) function rewardOnWasted ( attacker, attackerweapon, bodypart, loss ) if(attackerweapon == 0) and getElementData(attacker,"zombie") then if not getElementData (source,"zombie") then givePlayerMoney ( attacker, 5000 ) setElementData ( source, "zombie", true ) Skin = getElementModel ( source ) setPlayerTeam ( source, teamzombie ) setPedSkin ( source, 13 ) setPedHeadless ( source, false ) end end end addEventHandler ( "onPlayerDamage", getRootElement(), rewardOnWasted ) infection = createPickup (2577.66, 2841.528, 10.82, 3, 1242, 15000 ) function infected ( thePlayer ) setPlayerTeam ( thePlayer, teamzombie ) setPedSkin ( thePlayer, 13 ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", true ) end addEventHandler ( "onPickupUse", infection, infected ) cure = createPickup (2572.37, 2841.50, 10.82, 3, 1240, 15000 ) function cured ( thePlayer ) setElementModel ( thePlayer,Skin ) setPedHeadless ( thePlayer, false ) setElementData ( thePlayer, "zombie", false ) end addEventHandler ( "onPickupUse", cure, cured ) Link to comment
BorderLine Posted September 9, 2012 Share Posted September 9, 2012 podrias usar setElementData con algo acerca de infeccion y que cada vez que te golpee un zombie le de +5 y un getElementData verificando if (getElementData(infection) => 100 ) then ... Link to comment
Recommended Posts