Jump to content

help


Apo

Recommended Posts

Posted

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)

 

only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله

Posted

jacked is not defined in call911 function and i don't think it's a good idea to overwrite call function. you might want to change the table name to wantedPlayers or something

Posted (edited)

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

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted (edited)
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

~ Shaio Fencski

n-560x95_FFFFFF_FFFFFF_000000_000000.png
Posted

all not work guys in need setwanted for jaked by command 911 if player jacked other player in car

only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله

Posted
2 minutes ago, Apo said:

all not work guys in need setwanted for jaked by command 911 if player jacked other player in car

try my code

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted (edited)
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

only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله

Posted
16 minutes ago, Apo said:

not work i am call911 and no give wanted for jaker

/debugscript 3

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
48 minutes ago, Walid said:

/debugscript 3

not error

only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله

Posted (edited)

Shouldn't it be:

if theTable[thePlayer] == 'jacker' then 
        setPlayerWantedLevel (thePlayer, 6)

instead of:

if isElement(theTable[thePlayer]) then 
        setPlayerWantedLevel (theTable[thePlayer], 6)

 

edit: I read it wrong, ignore.

Edited by quindo
My bad

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