Jump to content

Fix all vehicle


Behnam

Recommended Posts

Posted

Hi all.

Please give me a fix all vehicle for admin acl group.

addCommandHandler : /fixall

And outputChatBox For All Players :

[ADM-Warn]:Admin Perfect Fixed All Vehicle!

Thanks !

Posted

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

Posted
2 hours ago, 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

Not Work !

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

Posted
5 minutes ago, 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.

Worked but dont have You dont have access to this command

please make it

Posted
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

Posted
3 minutes ago, 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

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)

5 minutes ago, 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)

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

Posted
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)

 

Posted
On ٢٧‏/٧‏/٢٠١٨ at 10: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)

 

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
  • MTA Team
Posted

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.

Locked

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

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