Behnam Posted July 26, 2018 Share Posted July 26, 2018 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 ! Link to comment
DiGiTal Posted July 26, 2018 Share Posted July 26, 2018 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
Behnam Posted July 27, 2018 Author Share Posted July 27, 2018 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 ! Link to comment
Erknneto Posted July 27, 2018 Share Posted July 27, 2018 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
Behnam Posted July 27, 2018 Author Share Posted July 27, 2018 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 Link to comment
Erknneto Posted July 27, 2018 Share Posted July 27, 2018 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
Behnam Posted July 27, 2018 Author Share Posted July 27, 2018 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. Link to comment
Dimos7 Posted July 27, 2018 Share Posted July 27, 2018 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
N3xT Posted July 28, 2018 Share Posted July 28, 2018 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. 1 Link to comment
MTA Anti-Cheat Team Dutchman101 Posted July 31, 2018 MTA Anti-Cheat Team Share Posted July 31, 2018 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 1 Link to comment
Recommended Posts