28WL Posted January 2, 2014 Share Posted January 2, 2014 How to make a ped holding weapon? Just I need this thing. Link to comment
qaisjp Posted January 2, 2014 Share Posted January 2, 2014 giveWeapon to give the ped a weapon SetPedWeaponSlot to change the slot (from fist to the slot the weapon is in, should automatically be done iirc) Link to comment
28WL Posted January 3, 2014 Author Share Posted January 3, 2014 How to make that command only to groups: Owner, Admin. How it should look like? ped = createPed ( 285, -2001, 122, 5001, 0, 0, 0) addCommandHandler( "weaponped", function ( player, command, id, amount ) if not tonumber ( id ) then return end if not tonumber ( amount ) then amount = 1 end giveWeapon( ped, id, amount, true ) end ) function isAccountInGroup ( groups, account ) local theGroup = false for _, group in ipairs ( groups ) do if isObjectInACLGroup ( "user.".. account, aclGetGroup ( group ) ) then theGroup = group break end end return theGroup end === How I need to do? As you see there are something wrong: addCommandHandler( "weaponped", function ( player, command, id, amount ------- cmdweaponped?) if isAccountInGroup ( { "Owner", "Admin" }, getAccountName ( getPlayerAccount ( cmdweaponped ) ) ) then addCommandHandler( "weaponped", if not tonumber ( id ) then return end if not tonumber ( amount ) then amount = 1 end giveWeapon( ped, id, amount, true ) end else outputChatBox ("* You have no acces to that command.", cmdweaponped ) end end ) Link to comment
Castillo Posted January 3, 2014 Share Posted January 3, 2014 Can you please start using the correct sections? addCommandHandler ( "weaponped", function ( player, command, id, amount ) if isAccountInGroup ( { "Owner", "Admin" }, getAccountName ( getPlayerAccount ( player ) ) ) then if ( not tonumber ( id ) ) then return end if ( not tonumber ( amount ) ) then amount = 1 end giveWeapon( player, id, amount, true ) else outputChatBox ("* You have no acces to that command.", player ) end end ) Link to comment
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