Jump to content

Give package


Farhan

Recommended Posts

Hi guys !

Please give me script for give package weapon and set armor 100% !

Weapon id : 30 - 29 - 32

for acl on group !

command : /package <playername>

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

chat box for admin:

you given package to <playername>

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

chat box for player:

admin <admin name> given packge to you !

 

please fast answer me !

thanks ...

Link to comment

I should not make a script for you, but here it is

--[[
Weapon id : 30 - 29 - 32

for acl on group !

command : /package <playername>
]]--
	
	local aclname = "Admin"
	
function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end
	
function getPlayerFromPartialName(name) 
	local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil 
	if name then 
		for _, player in ipairs(getElementsByType("player")) do 
			local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() 
			if name_:find(name, 1, true) then 
				return player
			end 
		end 
	end
end

function givePackage(thePlayer, cmd, ...)
  if isPlayerInACL(thePlayer, aclname) then
  	local targetPlayer = table.concat({...}, " ")
  
  	local weps = {30, 29, 32} --I dont really understand how you want this..
  	local target = getPlayerFromPartialName(targetPlayer)
  	
  	if target then
  		for _, k in pairs(weps) do
  			givePedWeapon(target, k)
  		end
  		setPedArmor(target, 100)
  		
  		outputChatBox("Successfully given a package to : ".. getPlayetName(target), thePlayer, 255, 255, 255, true) --Admin chat
  		outputChatBox("You have been given a package by : ".. , getPlayerName(thePlayer), target, 255, 255, 255, true) --Player chat
  	end
  end
end
addCommandHandler("package", givePackage, false, false)

Not 100% sure if this works, found it in one of my old scripts

Link to comment
On 8/8/2018 at 00:58, Gaborboy95 said:

I should not make a script for you, but here it is


--[[
Weapon id : 30 - 29 - 32

for acl on group !

command : /package <playername>
]]--
	
	local aclname = "Admin"
	
function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end
	
function getPlayerFromPartialName(name) 
	local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil 
	if name then 
		for _, player in ipairs(getElementsByType("player")) do 
			local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() 
			if name_:find(name, 1, true) then 
				return player
			end 
		end 
	end
end

function givePackage(thePlayer, cmd, ...)
  if isPlayerInACL(thePlayer, aclname) then
  	local targetPlayer = table.concat({...}, " ")
  
  	local weps = {30, 29, 32} --I dont really understand how you want this..
  	local target = getPlayerFromPartialName(targetPlayer)
  	
  	if target then
  		for _, k in pairs(weps) do
  			givePedWeapon(target, k)
  		end
  		setPedArmor(target, 100)
  		
  		outputChatBox("Successfully given a package to : ".. getPlayetName(target), thePlayer, 255, 255, 255, true) --Admin chat
  		outputChatBox("You have been given a package by : ".. , getPlayerName(thePlayer), target, 255, 255, 255, true) --Player chat
  	end
  end
end
addCommandHandler("package", givePackage, false, false)

Not 100% sure if this works, found it in one of my old scripts

this code is very easy

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