Jamie_Mews Posted January 22, 2011 Posted January 22, 2011 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
Castillo Posted January 22, 2011 Posted January 22, 2011 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.
Jamie_Mews Posted January 22, 2011 Author Posted January 22, 2011 it did not work, when i try the command in the game, nothing happens, is there anything else i can try
Aibo Posted January 22, 2011 Posted January 22, 2011 check if you typed the name right, getPlayerFromName() needs a full player name. and names are case-sensitive. also /debugscript 3
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now