Jump to content

stopping vehicle , Staff Team


Annas

Recommended Posts

Posted

i need a stuff for STAFF TEAM ..

when i click "C" Bind , the vehicle stoped in 1sec in it PLACE .

(i need it only team named "Staff" can do this ..)

Thx.

Posted
i need a stuff for STAFF TEAM ..

when i click "C" Bind , the vehicle stoped in 1sec in it PLACE .

(i need it only team named "Staff" can do this ..)

Thx.

use

setElementFrozen () 

Posted

it can be like this:

function stopVehicle(player) 
    if (getTeamName(getPlayerTeam(player)) == "Staff") then 
    local vehicles = getElementsByType("vehicle") 
        for i , vehicle in pairs (vehicles) do 
        local Freeze = isElementFrozen (vehicle) 
        local newStatus = not Freeze 
        setElementFrozen (vehicle, newStatus ) 
        end 
    end  
end  
addCommandHandler("stop", stopVehicle) 

Posted

I don't think you can use "/stop", since it's a MTA hard coded command ( for stopping resources ).

Change the vehicle to something else, such as "freezevehs".

Posted
:~ not work ..

i make it CLEINT SIDE = not work

SERVER SIDE = Not Work

pls help me ..

it's server side code, replace /stop with any other command it's just an example.

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