Jump to content

[HELP]Helpme For Fix My Script


.Mr.

Recommended Posts

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 by .Mr.
Link to post

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 post
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 post
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 post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...