Jump to content

MohamedZeka

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by MohamedZeka

  1. i'm new to mta i'm not coder or like that i don't under stand
  2. when i make my script it doesn't work message shown [14:21:25] WARNING: test\c_fly.lua:15: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] [14:21:25] WARNING: test\c_fly.lua:15: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] [14:21:25] ERROR: test\c_fly.lua:17: attempt to concatenate local 'accName' (a boolean value) it's flying mode car i made it by my self s_fly.lua function enableCarFlight() outputChatBox("#ffff00Car flight is now enabled.", source, 255, 255, 255, true) end addEvent("carFlightOn", true) addEventHandler("carFlightOn", getRootElement(), enableCarFlight) function disableCarFlight(thePlayer) outputChatBox("#ffff00Car flight is now disabled.", source, 255, 255, 255, true) end addEvent("carFlightOff", true) addEventHandler("carFlightOff", getRootElement(), disableCarFlight) c._fly.lua carsCanFly = false function toggleCarFlight() local accName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then -- Never evaluates to 'true' when 'Admin' if (carsCanFly == false) then carsCanFly = true setWorldSpecialPropertyEnabled("aircars", true) triggerServerEvent("carFlightOn", getLocalPlayer()) else carsCanFly = false setWorldSpecialPropertyEnabled("aircars", false) triggerServerEvent("carFlightOff", getLocalPlayer()) end else outputChatBox("#ffff00Dude, only admins can do that.", source, 255, 255, 255) -- Never gets displayed when 'Default' end end addCommandHandler("zekafly", toggleCarFlight) meta file <meta> <info author="zeka" type="script" version="1.1.0" description="Flying Admins" /> <script src="s_fly.lua" type="client" /> <script src="c_fly.lua" type="server" /> </meta> please tell me how to solve this problem
×
×
  • Create New...