Jump to content

help


Apo

Recommended Posts

hi in need call911 and set wanted for jacked

 

local call = {} 
  
function vehicleExitJack ( thePlayer, seat, jacked ) 
if jacked then 
call[thePlayer] = true 
setTimer ( kill911, 60000, 1, thePlayer ) 
end 
end 
 addEventHandler ( "onVehicleExit", getRootElement(), vehicleExitJack )  
function kill911 (thePlayer) 
call[thePlayer] = false 
end 
  


function call911(thePlayer)

if call[thePlayer] == true then 

 setPlayerWantedLevel ( jacked, 6 )
end
end
addCommandHandler("call911",call911)

 

Link to comment

Call it's an mta sa function

local theTable = {} 
  
function vehicleExitJack (thePlayer, seat, jacker) 
    if jacker then 
        theTable[thePlayer] = jacker
    end 
end 
 addEventHandler ("onVehicleExit",root, vehicleExitJack)  
 
function call911(thePlayer)
    if isElement(theTable[thePlayer]) then 
        setPlayerWantedLevel (theTable[thePlayer], 6)
        theTable[thePlayer] = nil
    end
end
addCommandHandler("call911",call911)

 

Edited by Walid
Link to comment
local wanted = {} 
  
function vehicleExitJack(player,seat,jacked) 
	if jacked then
		wanted[player] = {level = 6}
		setTimer(kill911,60000,1,player)
	end
end
addEventHandler("onVehicleExit",getRootElement(),vehicleExitJack)

function setWanted(player,otherPlayer)
	if wantedPlayers == true then 
		local wantedPlayer = getPlayerFromName(otherPlayer)
		setPlayerWantedLevel(wantedPlayer,6)
		wanted[player] = {level = 6}
		setTimer(kill911,60000,1,wantedPlayer)
	end
end
addCommandHandler("911",setWanted)

function updateWanted()
	for i,plr in pairs(getElementsByType("player")) do
		if wanted[plr] then
			setPlayerWantedLevel(plr,wanted[plr].level)
		end
	end
end
setTimer(updateWanted,1000,0)

function kill911(player)
	wanted[player] = nil
end

 

Made this simple code for you, so that the player gets a wanted level when he/she is in a stolen vehicle, or called on at 911, and they cannot get out of it.

Edited by shaio
Link to comment
13 hours ago, Walid said:

Call it's an mta sa function


local theTable = {} 
  
function vehicleExitJack (thePlayer, seat, jacker) 
    if jacker then 
        theTable[thePlayer] = jacker
    end 
end 
 addEventHandler ("onVehicleExit",root, vehicleExitJack)  
 
function call911(thePlayer)
    if isElement(theTable[thePlayer]) then 
        setPlayerWantedLevel (theTable[thePlayer], 6)
        theTable[thePlayer] = nil
    end
end
addCommandHandler("call911",call911)

 

 

not work i am call911 and no give wanted for jaker

Edited by Apo
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...