Destroyer.- Posted July 8, 2014 Posted July 8, 2014 Hola me podrian ayudar con el job este de medico es que cura cuando pegas con el spray pero cuando roseas tose y le duele aca el code Teame = createTeam("Medico", 0, 255, 255) CT = { [Teame] = true } CV = { [596] = true } function MedicSet () local team = getTeamFromName ( "Medico" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 255, 255 ) setElementModel(source, 275) giveWeapon ( source, 41, 9999) setElementData( source, "Ocupacion", "Paramedico.", true ) outputChatBox("[EMPLEO]Ahora sos Paramedico",thePlayer,0,255,255) else local teamx = getTeamFromName ( "Medico" ) if teamx then cancelEvent() outputChatBox("You do not need to use this again!", thePlayer) end end end addEvent("Medic.saPDj", true) addEventHandler("Medic.saPDj", root, MedicSet ) local skin = {[275] = true} --Script by Catch22 --Please do not copy this --This IS my first script --Enjoy!!! --Medic function healFlowers (attacker, attackerweapon, bodypart, loss) theHealth = getElementHealth (source) if not skin[getElementModel(attacker)] then return end --checks attackers skin if ( theHealth > 95 ) then --checks clients health if (getPlayerMoney(attacker) < 200) then --checks attacker money setPlayerMoney (attacker, 0) else takePlayerMoney (attacker, 200) --takes attackers money for DMing to earn more outputChatBox("Hospital: Don't DM to get more money. Your pay has been lowered.",attacker,0,255,255) --info in chatbox end else if (attackerweapon == 41) and (loss > 1) and ( theHealth < 95 ) then setElementHealth ( source, theHealth+17 ) --sets clients health+17 givePlayerMoney (attacker, 200) --pays the medic -- you can change the 1.7 to another number or the whole equation to make a different payout end end addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) --Medic vehicle lock medicVehicles = { [416]=true } --sets the medic vehicles medicSkins = { [275]=true } -- sets the medic skins function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] ) and ( not medicSkins[getElementModel ( player )] ) and ( seat == 0 ) then --checks player skin cancelEvent() outputChatBox ( "*You must be a medic to use this vehicle.", player ) --info in chatbox end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle ) Ayuda pls
Sergioks Posted July 8, 2014 Posted July 8, 2014 Prueba poniendo un: cancelEvent() donde se define el arma del medico, a ver si te funciona.. Es decir.. asi: function healFlowers (attacker, attackerweapon, bodypart, loss) theHealth = getElementHealth (source) if not skin[getElementModel(attacker)] then return end --checks attackers skin if ( theHealth > 95 ) then --checks clients health if (getPlayerMoney(attacker) < 200) then --checks attacker money setPlayerMoney (attacker, 0) else takePlayerMoney (attacker, 200) --takes attackers money for DMing to earn more outputChatBox("Hospital: Don't DM to get more money. Your pay has been lowered.",attacker,0,255,255) --info in chatbox end else if (attackerweapon == 41) and (loss > 1) and ( theHealth < 95 ) then cancelEvent() setElementHealth ( source, theHealth+17 ) --sets clients health+17 givePlayerMoney (attacker, 200) --pays the medic -- you can change the 1.7 to another number or the whole equation to make a different payout end end addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) a ver que tal.
BorderLine Posted July 9, 2014 Posted July 9, 2014 me parece que cancelEvent sobre onPlayerDamage, solo funciona en clientside. Deberas hacer un trigger o algo
Tomas Posted July 10, 2014 Posted July 10, 2014 No puedes cancelar el DMG en server-side. No es necesario hacer triggers ni nada, simplemente lo cancelas en clientside y listo.
Recommended Posts