Jump to content

Give package


Farhan

Recommended Posts

Posted

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

Posted

We are not your selve also you didn't read the forum rules we are here to help you with your code not make it if you want a resource go to community site search it and simple download it

Posted

It may be worth checking the MTA Community site to see whether such resource already exists. As aforesaid, we are happy to point you in the right direction and fix any minor bugs, but we do not create scripts on demand.

Posted

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

Posted
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

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