.Mr. Posted October 21, 2018 Share Posted October 21, 2018 (edited) Hi Guys I Have One Problem In My Script How Set My Script For Acl? My Code : -- Do not allow the following IDs to be spawned local forbiddenCars = { [435] = true, [441] = true, [449] = true, [450] = true, [464] = true, [465] = true, [501] = true, [537] = true, [538] = true, [564] = true, [569] = true, [570] = true, [584] = true, [590] = true, [591] = true, [594] = true, [606] = true, [607] = true, [608] = true, [610] = true, [611] = true } local cmdVehRoot = createElement("commandVehicles") -- Dummy element containing the cars that this command has created addCommandHandler("spveh", function(player, cmd, modelID, x, y, z, platetext) -- Check whether arguments are correct local modelID, x, y, z = tonumber(modelID), tonumber(x), tonumber(y), tonumber(z) if modelID and x and y and z then -- Do not continue if we shouldn't if forbiddenCars[modelID] then outputChatBox("#ff0000In Mashin Ra Nemishe Sakht!", player, 255, 0, 0, true) return end local platetext = type(platetext) == "string" and platetext or "PRIVATE" -- Create the actual vehicle and set it as a children of our dummy element setElementParent(createVehicle(modelID, x, y, z, 0, 0, 0, platetext), cmdVehRoot) -- Inform the player about what we did outputChatBox("#ffffffShoma Mashine : (#00ff00" .. getVehicleNameFromModel(modelID) .. " #ffffffBa ID #00ff00" .. modelID .. "#ffffff) #ffffffDar Position : [#00ff00" .. table.concat({ x, y, z }, ", ") .. "#ffffff] Ba Pelak : (#00ff00" .. platetext .. "#ffffff) Sakhtid!", player, 0, 255, 0, true) else outputChatBox ("#DAA520SYNTAX: /"..cmd.." (Model ID) (x) (y) (z) (Pelak)", player, 255, 255, 255, true) end end ) -- If a vehicle that has been created using the command blows up, respawn it where it was created addEventHandler("onVehicleExplode", cmdVehRoot, function() respawnVehicle(source) end ) Edited October 21, 2018 by .Mr. Link to comment
WorthlessCynomys Posted October 21, 2018 Share Posted October 21, 2018 Next time use code mode for codes. It's the "<>" button. I'll do it for you this time and I'll get back to the topic later to see if I can help. -- Do not allow the following IDs to be spawned local forbiddenCars = { [435] = true, [441] = true, [449] = true, [450] = true, [464] = true, [465] = true, [501] = true, [537] = true, [538] = true, [564] = true, [569] = true, [570] = true, [584] = true, [590] = true, [591] = true, [594] = true, [606] = true, [607] = true, [608] = true, [610] = true, [611] = true } local cmdVehRoot = createElement("commandVehicles") -- Dummy element containing the cars that this command has created addCommandHandler("spveh", function(player, cmd, modelID, x, y, z, platetext) -- Check whether arguments are correct local modelID, x, y, z = tonumber(modelID), tonumber(x), tonumber(y), tonumber(z) if modelID and x and y and z then -- Do not continue if we shouldn't if forbiddenCars[modelID] then outputChatBox("#ff0000In Mashin Ra Nemishe Sakht!", player, 255, 0, 0, true) return end local platetext = type(platetext) == "string" and platetext or "PRIVATE" -- Create the actual vehicle and set it as a children of our dummy element setElementParent(createVehicle(modelID, x, y, z, 0, 0, 0, platetext), cmdVehRoot) -- Inform the player about what we did outputChatBox("#ffffffShoma Mashine : (#00ff00" .. getVehicleNameFromModel(modelID) .. " #ffffffBa ID #00ff00" .. modelID .. "#ffffff) #ffffffDar Position : [#00ff00" .. table.concat({ x, y, z }, ", ") .. "#ffffff] Ba Pelak : (#00ff00" .. platetext .. "#ffffff) Sakhtid!", player, 0, 255, 0, true) else outputChatBox ("#DAA520SYNTAX: /"..cmd.." (Model ID) (x) (y) (z) (Pelak)", player, 255, 255, 255, true) end end ) -- If a vehicle that has been created using the command blows up, respawn it where it was created addEventHandler("onVehicleExplode", cmdVehRoot, function() respawnVehicle(source) end ) Link to comment
.Mr. Posted October 21, 2018 Author Share Posted October 21, 2018 53 minutes ago, WorthlessCynomys said: Next time use code mode for codes. It's the "<>" button. I'll do it for you this time and I'll get back to the topic later to see if I can help. -- Do not allow the following IDs to be spawned local forbiddenCars = { [435] = true, [441] = true, [449] = true, [450] = true, [464] = true, [465] = true, [501] = true, [537] = true, [538] = true, [564] = true, [569] = true, [570] = true, [584] = true, [590] = true, [591] = true, [594] = true, [606] = true, [607] = true, [608] = true, [610] = true, [611] = true } local cmdVehRoot = createElement("commandVehicles") -- Dummy element containing the cars that this command has created addCommandHandler("spveh", function(player, cmd, modelID, x, y, z, platetext) -- Check whether arguments are correct local modelID, x, y, z = tonumber(modelID), tonumber(x), tonumber(y), tonumber(z) if modelID and x and y and z then -- Do not continue if we shouldn't if forbiddenCars[modelID] then outputChatBox("#ff0000In Mashin Ra Nemishe Sakht!", player, 255, 0, 0, true) return end local platetext = type(platetext) == "string" and platetext or "PRIVATE" -- Create the actual vehicle and set it as a children of our dummy element setElementParent(createVehicle(modelID, x, y, z, 0, 0, 0, platetext), cmdVehRoot) -- Inform the player about what we did outputChatBox("#ffffffShoma Mashine : (#00ff00" .. getVehicleNameFromModel(modelID) .. " #ffffffBa ID #00ff00" .. modelID .. "#ffffff) #ffffffDar Position : [#00ff00" .. table.concat({ x, y, z }, ", ") .. "#ffffff] Ba Pelak : (#00ff00" .. platetext .. "#ffffff) Sakhtid!", player, 0, 255, 0, true) else outputChatBox ("#DAA520SYNTAX: /"..cmd.." (Model ID) (x) (y) (z) (Pelak)", player, 255, 255, 255, true) end end ) -- If a vehicle that has been created using the command blows up, respawn it where it was created addEventHandler("onVehicleExplode", cmdVehRoot, function() respawnVehicle(source) end ) Okay Thanks You Link to comment
iPrestege Posted October 21, 2018 Share Posted October 21, 2018 Use isObjectInACLGroup Link to comment
.Mr. Posted October 21, 2018 Author Share Posted October 21, 2018 (edited) @Dimos7 @iMr.WiFi..! Edited October 21, 2018 by .Mr. Link to comment
Dimos7 Posted October 21, 2018 Share Posted October 21, 2018 We are not your selve also someone already give you what you need Link to comment
Storm-Hanma Posted October 22, 2018 Share Posted October 22, 2018 isObjectInACLGroup as above said do that it will be fixed Link to comment
iPrestege Posted October 22, 2018 Share Posted October 22, 2018 15 hours ago, .Mr. said: @Dimos7 @iMr.WiFi..! In scripting section you can not ask someone to write you a code we just give you what you need to get the job done so by asking someone for a full code that does not help you at all you will never learn programming and believe me you will not enjoy it if someone did your task for you so think about it twice and start coding even if you could not do it just post what you have tried and we will help. Start reading and learning and stop copying Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now