Jump to content

Give weapon [HELP ME]


Recommended Posts

I tried to make a script to give a taser but its not working. Help me please

CODE:

function giveTaser (player) 
    team = getPlayerTeam ( giveTaser ) 
if getTeamName ( team ) ~= "Police" then return end 
       giveWeapon ( source , 23,700 ) 
       outputChatBox("Vous vous êtes equipé du Taser !",player) 
end 
addCommandHandler("equipertaser",giveTaser) 
  

Link to comment

addCommandHandler ('equipertaser', 
function ( ) 
if getTeamName(getPlayerTeam(source)) == getTeamFromName('Police') then 
   giveWeapon ( source, 23, 700 ) 
   outputChatBox("Vous vous êtes equipé du Taser !",source, 255, 255, 0 ) 
  end 
end 
) 
Link to comment
addCommandHandler ( "equipertaser", 
    function ( player ) 
        if ( getPlayerTeam ( player ) ) then 
            if ( getPlayerTeam ( player ) == getTeamFromName ( "Police" ) ) then 
                giveWeapon ( player, 23, 700 ) 
                outputChatBox ( "Vous vous êtes equipé du Taser !", player, 255, 255, 0 ) 
            end 
        end 
    end 
) 

Edited by Guest
Link to comment
addCommandHandler ('equipertaser', 
function ( ) 
if getTeamName(getPlayerTeam(source)) == getTeamFromName('Police') then 
   giveWeapon ( source, 23, 700 ) 
   outputChatBox("Vous vous êtes equipé du Taser !",source, 255, 255, 0 ) 
  end 
end 
) 

Is an error :

[03:50:31] WARNING: @Taser_equipe\server.lua:3: Bad argument @ 'getPlayerTeam'

[03:50:31] WARNING: @Taser_equipe\server.lua:3: Bad argument @ 'getTeamName'

[03:50:36] WARNING: @Taser_equipe\server.lua:3: Bad argument @ 'getPlayerTeam'

[03:50:36] WARNING: @Taser_equipe\server.lua:3: Bad argument @ 'getTeamName'

[03:50:02] WARNING: @Taser_equipe\server.lua:3: Bad argument @ 'getPlayerTeam'

[03:50:02] WARNING: @Taser_equipe\server.lua:3: Bad argument @ 'getTeamName'

[03:50:02] WARNING: @Taser_equipe\server.lua:4: Bad argument @ 'giveWeapon' [Expected element at argument 1, got nil]

Link to comment

Try this

addCommandHandler ('equipertaser', 
function ( ) 
if (getTeamName(getPlayerTeam(source)) == "Police") then 
   giveWeapon ( source, 23, 700 ) 
   outputChatBox("Vous vous êtes equipé du Taser !",source, 255, 255, 0 ) 
  end 
end 
) 

Edited by Guest
Link to comment
addCommandHandler ( "equipertaser",
    function ( player )
        if ( getPlayerTeam ( player ) ) then
            if ( getPlayerTeam ( player ) == getTeamFromName ( "Police" ) ) then
                giveWeapon ( player, 23, 700 )
                outputChatBox ( "Vous vous êtes equipé du Taser !", player, 255, 255, 0 )
            end
        end
    end
)

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...