Jump to content

MTA Help Faction Command


Jamie_Mews

Recommended Posts

What is wrong with this, im trying to make it so that whilst in the paramedic faction, typing "heal" followed by a nickname will heal the player.

  
-- /heal 
addCommandHandler( "heal", 
    function( thePlayer, commandName ) 
        if exports.players:isLoggedIn( thePlayer ) then 
            local inPD, factionID, factionName, factionTag = exports.factions:isPlayerInFactionType( thePlayer, 2 ) 
            if inPD and factionTag then 
                setElementHealth ( getPlayerFromNick, 100 ) 
            else 
                outputChatBox( "(( You are not in a Government faction. ))", thePlayer, 255, 0, 0 ) 
            end 
        end 
    end 
) 

-----------------------

getplayerfromnick , i thought that would be correct, what should i type where

Link to comment

you got things wrong here o_O,

addCommandHandler( "heal", 
function( thePlayer, commandName, who ) 
if exports.players:isLoggedIn( thePlayer ) then 
local inPD, factionID, factionName, factionTag = exports.factions:isPlayerInFactionType( thePlayer, 2 ) 
if inPD and factionTag then 
setElementHealth ( getPlayerFromName(who), 100 ) 
else 
outputChatBox( "(( You are not in a Government faction. ))", thePlayer, 255, 0, 0 ) 
end 
end 
end 
) 

try that code above.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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