Jump to content

Team Medico


Sasu

Recommended Posts

function createMedicTeam () 
    MedicTeam = createTeam ("Medicos", 102, 255, 255) 
end 
  
addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) 
  
function joinMedic() 
     setPlayerTeam(source, MedicosTeam) 
     setElementModel(source,274) 
      giveWeapon ( source, 41, 9999 ) 
     setElementData( source, "Occupation", "Recluta Medico", true ) 
     outputChatBox("Ahora eres Recluta Medico",source,0,255,0) 
end 
  
addEvent("setMedic", true) 
addEventHandler("setMedic",root,joinMedic) 
addEvent("medic:healing", true) 
addEventHandler("medic:healing", root) 
  
function (medic) 
    if (getElementHealth(source) < 100) then end 
        local Heal = getElementHealth(source) + 5 -- New health 
        setElementHealth(source, Heal)  
        if (Heal > 100) then end 
             setElementHealth(source, 100) 
                givePlayerMoney(medic, 100)  
        takePlayerMoney(source, 100) -- Takes 100$ from the source when he get healed 
    end 

Me dice: SCRIPT ERROR: medico\medic-serverc.lua:20 ' expected near '<'

Lo dice 2 veces.

Link to comment

te falta un event en la function medic , y la tenias mal escrita tambien

    function createMedicTeam () 
        MedicTeam = createTeam ("Medicos", 102, 255, 255) 
    end 
      
    addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) 
      
    function joinMedic() 
         setPlayerTeam(source, MedicosTeam) 
         setElementModel(source,274) 
          giveWeapon ( source, 41, 9999 ) 
         setElementData( source, "Occupation", "Recluta Medico", true ) 
         outputChatBox("Ahora eres Recluta Medico",source,0,255,0) 
    end 
      
    addEvent("setMedic", true) 
    addEventHandler("setMedic",root,joinMedic) 
    addEvent("medic:healing", true) 
    addEventHandler("medic:healing", root) 
      
    function medic () 
        if (getElementHealth(source) < 100) then end 
            local Heal = getElementHealth(source) + 5 -- New health 
            setElementHealth(source, Heal) 
            if (Heal > 100) then end 
                 setElementHealth(source, 100) 
                    givePlayerMoney(medic, 100) 
            takePlayerMoney(source, 100) -- Takes 100$ from the source when he get healed 
        end 

Link to comment
  • Recently Browsing   0 members

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