Jump to content

Fix all vehicle


Behnam

Recommended Posts


function fix(plr,cmd)

  local accName = getAccountName ( getPlayerAccount ( plr ) ) -- get his account name
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
         
local vehicles = getElementsByType("vehicle")
for k, v in pairs(vehicles) do
	-- Fix the vehicle
	fixVehicle(vehicle)
     outputChatBox( "ADMIN-ALL CARS HAS BEEN FIXED")
	else outputChatBox( "You dont have access to this command",plr)

end
    end
  end
addCommandHandler( "fixall", fix)

@Behnam

Link to comment
  On 26/07/2018 at 22:28, DiGiTal said:

function fix(plr,cmd)

  local accName = getAccountName ( getPlayerAccount ( plr ) ) -- get his account name
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
         
local vehicles = getElementsByType("vehicle")
for k, v in pairs(vehicles) do
	-- Fix the vehicle
	fixVehicle(vehicle)
     outputChatBox( "ADMIN-ALL CARS HAS BEEN FIXED")
	else outputChatBox( "You dont have access to this command",plr)

end
    end
  end
addCommandHandler( "fixall", fix)

@Behnam

Expand  

Not Work !

Link to comment
function fixAllVehicles (source)
	local acc = getAccountName(getPlayerAccount(source))
	if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then
		for _,veh in ipairs(getElementsByType("vehicle")) do
			if ( veh ) then
				fixVehicle(veh)
			end
		end
		outputChatBox("The Admin "..getPlayerName(source).." fixed all the vehicles!",getRootElement(),0,255,0)
	end
end
addCommandHandler("fixall",fixAllVehicles)

Try this one.

Link to comment
  On 27/07/2018 at 01:16, Erknneto said:

function fixAllVehicles (source)
	local acc = getAccountName(getPlayerAccount(source))
	if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then
		for _,veh in ipairs(getElementsByType("vehicle")) do
			if ( veh ) then
				fixVehicle(veh)
			end
		end
		outputChatBox("The Admin "..getPlayerName(source).." fixed all the vehicles!",getRootElement(),0,255,0)
	end
end
addCommandHandler("fixall",fixAllVehicles)

Try this one.

Expand  

Worked but dont have You dont have access to this command

please make it

Link to comment
function fixAllVehicles (source)
	local acc = getAccountName(getPlayerAccount(source))
	if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then
		for _,veh in ipairs(getElementsByType("vehicle")) do
			if ( veh ) then
				fixVehicle(veh)
			end
		end
		outputChatBox("The Admin "..getPlayerName(source).." fixed all the vehicles!",getRootElement(),0,255,0)
	else
		outputChatBox("You don't have access to this command!",source,255,0,0)
	end
end
addCommandHandler("fixall",fixAllVehicles)

done

Link to comment
  On 27/07/2018 at 01:24, Erknneto said:

function fixAllVehicles (source)
	local acc = getAccountName(getPlayerAccount(source))
	if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then
		for _,veh in ipairs(getElementsByType("vehicle")) do
			if ( veh ) then
				fixVehicle(veh)
			end
		end
		outputChatBox("The Admin "..getPlayerName(source).." fixed all the vehicles!",getRootElement(),0,255,0)
	else
		outputChatBox("You don't have access to this command!",source,255,0,0)
	end
end
addCommandHandler("fixall",fixAllVehicles)

done

Expand  

Thanks.

I have one of my admin commands written in this way if it can be delivered to me in this way

function help(thePlayer)
    if not ( isPlayerOnGroup ( thePlayer ) ) then
        outputChatBox("#ff0000[Error]: #ffffffYou don't have access this command!", thePlayer, 255, 255, 255, true)
        return false
    end
        outputChatBox("#ffffffTest", thePlayer, 208, 0, 15,true)        
end
addCommandHandler("ahelp", help)

  On 27/07/2018 at 01:30, Behnam said:

Thanks.

I have one of my admin commands written in this way if it can be delivered to me in this way

function help(thePlayer)
    if not ( isPlayerOnGroup ( thePlayer ) ) then
        outputChatBox("#ff0000[Error]: #ffffffYou don't have access this command!", thePlayer, 255, 255, 255, true)
        return false
    end
        outputChatBox("#ffffffTest", thePlayer, 208, 0, 15,true)        
end
addCommandHandler("ahelp", help)

Expand  

Simple code for my admin system please fix /fixall command for my admin system.

Link to comment
function fixAllVehicles (thePlayer)
	if isPlayerOnGroup(thePlayer)  then
		for _,veh in ipairs(getElementsByType("vehicle")) do
			if ( veh ) then
				fixVehicle(veh)
			end
		end
		outputChatBox("The Admin "..getPlayerName(thePlayer).." fixed all the vehicles!",getRootElement(),0,255,0)
	else
		outputChatBox("You don't have access to this command!",source,255,0,0)
	end
end
addCommandHandler("fixall",fixAllVehicles)

 

Link to comment
  On 27/07/2018 at 07:58, Dimos7 said:
function fixAllVehicles (thePlayer)
	if isPlayerOnGroup(thePlayer)  then
		for _,veh in ipairs(getElementsByType("vehicle")) do
			if ( veh ) then
				fixVehicle(veh)
			end
		end
		outputChatBox("The Admin "..getPlayerName(thePlayer).." fixed all the vehicles!",getRootElement(),0,255,0)
	else
		outputChatBox("You don't have access to this command!",source,255,0,0)
	end
end
addCommandHandler("fixall",fixAllVehicles)

 

Expand  
function fixAllVehicles ( thePlayer )
	if ( isPlayerOnGroup ( thePlayer ) ) then
		for _,veh in ipairs(getElementsByType("vehicle")) do
			if ( veh ) then
				fixVehicle ( veh )
			end
		end
		outputChatBox("The Admin " .. getPlayerName ( thePlayer ) .. " fixed all the vehicles!", root, 0, 255, 0 )
	else
		outputChatBox("You don't have access to this command!", thePlayer, 255, 0, 0 )
	end
end
addCommandHandler("fixall",fixAllVehicles)

Line 10.

  • Like 1
Link to comment
  • MTA Anti-Cheat Team

Remind yourself of https://forum.multitheftauto.com/topic/94790-guidelines-and-formatting-for-this-section-read-before-posting/

  Quote

Conduct guidelines

The Scripting section is not meant for those unwilling to learn, whose only intent is to try get others to finish the scripts they need, line by line. Don't wait for others to finish your script line-by-line, without any efforts of your own @Behnam, because Scripting section isn't a free scripter service.

Expand  

Locked

  • Thanks 1
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...