Jump to content

[REQ]Little Func


Gastonito

Recommended Posts

DELETED

17 minutes ago, CodyJ(L) said:

function exitingVehicle(player)
 if player == localPlayer then
	cancelEvent()
	end
end



addEventHandler("onClientVehicleStartExit", getRootElement(), exitingVehicle)

Or if you want globally


addEventHandler("onVehicleStartExit", getRootElement(), cancelEvent)

 

Cody i want it on this structure : 

addEvent("eventFeezePlayers", true)
function eventFeezePlayers()
	for eventPlayers in pairs(WrapedPlayers) do	
		toggleAllControls ( eventPlayers, false )
		exports.SAEGcommands:sendMessage(getPlayerName(client).." Has Frozen You !", 255, 0, 0,eventPlayers)
	end
	end
addEventHandler("eventFeezePlayers", root, eventFeezePlayers )

So how will it be ? :D

Edited by Angel02
Link to comment
?

    addEvent("eventFeezePlayers", true)
    function eventFeezePlayers()
		addEventHandler("onVehicleStartExit", getRootElement(), cancelEvent)
    	for eventPlayers in pairs(WrapedPlayers) do	
    		toggleAllControls ( eventPlayers, false )
    		exports.SAEGcommands:sendMessage(getPlayerName(client).." Has Frozen You !", 255, 0, 0,eventPlayers)
    	end
    	end
    addEventHandler("eventFeezePlayers", root, eventFeezePlayers )

That's assuming it's all players.

Link to comment
2 minutes ago, CodyJ(L) said:

?

    addEvent("eventFeezePlayers", true)
    function eventFeezePlayers()
		addEventHandler("onVehicleStartExit", getRootElement(), cancelEvent)
    	for eventPlayers in pairs(WrapedPlayers) do	
    		toggleAllControls ( eventPlayers, false )
    		exports.SAEGcommands:sendMessage(getPlayerName(client).." Has Frozen You !", 255, 0, 0,eventPlayers)
    	end
    	end
    addEventHandler("eventFeezePlayers", root, eventFeezePlayers )

That's assuming it's all players.

No no u dont undrestand, i want the function of disabling vehicle exit to be with the same structure as the other one :v

Link to comment
  noExit = {}

addEvent("eventNoVehiclePlayers", true)
    function eventNoVehiclePlayers()
    	for eventPlayers in pairs(WrapedPlayers) do	
    		 noExit[eventPlayers] = true
    		exports.SAEGcommands:sendMessage(getPlayerName(client).." Has removed yeah ability to exit vehicle !", 255, 0, 0,eventPlayers)
    	end
    	end
    addEventHandler("eventNoVehiclePlayers", root, eventNoVehiclePlayers )
	
	
	function noExitAye(player)
		if noExit[player] then 
			cancelEvent()
		end
	end

	addEventHandler("onVehicleStartExit", getRootElement(), noExitAye)

 

Edited by CodyJ(L)
Link to comment
4 minutes ago, CodyJ(L) said:

  noExit = {}

addEvent("eventNoVehiclePlayers", true)
    function eventNoVehiclePlayers()
    	for eventPlayers in pairs(WrapedPlayers) do	
    		 noExit[eventPlayers] = true
    		exports.SAEGcommands:sendMessage(getPlayerName(client).." Has removed yeah ability to exit vehicle !", 255, 0, 0,eventPlayers)
    	end
    	end
    addEventHandler("eventNoVehiclePlayers", root, eventNoVehiclePlayers )
	
	
	function noExitAye(player)
		if noExit[player] then 
			cancelEvent()
		end
	end

	addEventHandler("onVehicleStartExit", getRootElement(), noExitAye)

 

Yeah this is it, thx, going to try it :D

15 minutes ago, CodyJ(L) said:

  noExit = {}

addEvent("eventNoVehiclePlayers", true)
    function eventNoVehiclePlayers()
    	for eventPlayers in pairs(WrapedPlayers) do	
    		 noExit[eventPlayers] = true
    		exports.SAEGcommands:sendMessage(getPlayerName(client).." Has removed yeah ability to exit vehicle !", 255, 0, 0,eventPlayers)
    	end
    	end
    addEventHandler("eventNoVehiclePlayers", root, eventNoVehiclePlayers )
	
	
	function noExitAye(player)
		if noExit[player] then 
			cancelEvent()
		end
	end

	addEventHandler("onVehicleStartExit", getRootElement(), noExitAye)

 

It shows up an error saying Table index is nil :(

Link to comment
On 23/01/2017 at 21:41, CodyJ(L) said:

  noExit = {}

addEvent("eventNoVehiclePlayers", true)
    function eventNoVehiclePlayers()
    	for eventPlayers in pairs(WrapedPlayers) do	
    		 noExit[eventPlayers] = true
    		exports.SAEGcommands:sendMessage(getPlayerName(client).." Has removed yeah ability to exit vehicle !", 255, 0, 0,eventPlayers)
    	end
    	end
    addEventHandler("eventNoVehiclePlayers", root, eventNoVehiclePlayers )
	
	
	function noExitAye(player)
		if noExit[player] then 
			cancelEvent()
		end
	end

	addEventHandler("onVehicleStartExit", getRootElement(), noExitAye)

 

@idarrr This is it :v

Link to comment
10 hours ago, idarrr said:

Where is  WrapedPlayers table?

No, Thats not the problem.

It got fixed by @Simple01

Final And FIXED Code : 

local noExit = {}
 
addEvent("eventNoVehiclePlayers", true)
function eventNoVehiclePlayers()
    local eventManager = getAccountName(getPlayerAccount(source))
    if ( eventVehicles[eventManager] ) then
        for eventPlayer in pairs(WrapedPlayers) do
            noExit[ eventPlayer ] = true
            exports.SAEGcommands:sendMessage(getPlayerName(client).." Has removed your ability to exit vehicle !", 255, 0, 0,eventPlayers)
        end
    end
end
    addEventHandler("eventNoVehiclePlayers", root, eventNoVehiclePlayers )

   
   
function noExitAye(player)
    if noExit[player] then
        cancelEvent()
    end
end
addEventHandler("onVehicleStartExit", root, noExitAye)

 

Link to comment

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