Jump to content

Radar Script help


HoLsTeN

Recommended Posts

Try this (not tested):

cover = false 
  
function zzz( player ) 
local team = getPlayerTeam(player) 
if team then 
local playerBlip = createBlipAttachedTo ( player, 22, 1, 255, 255, 0, 255 ) 
stophelp = setTimer ( fff, 10000, 1, playerBlip ) 
setElementVisibleTo ( playerBlip, getRootElement(), false) 
for i,v in pairs(getPlayersInTeam(team)) do 
setElementVisibleTo ( playerBlip, v, true)  
outputChatBox (getPlayerName (player) .. ":HELP ME Help Me !!!",v,255,255,0,true) 
    end 
  end 
end 
  
  
----------- 
function fff(theblip) 
    destroyElement (theblip) 
end 
  
function bindKey ( player, commandName ) 
    if (cover == false)then 
    cover = true 
    bindKey ( player, "z", "down", zzz ) 
    outputChatBox ( "**oN PRESS [z] to use**", player, 255, 255, 0 ) 
    else 
    cover = false 
    unbindKey ( player, "z", "down", zzz ) 
    outputChatBox ( "** OFF **", player, 255, 255, 0 ) 
    end 
end 
addCommandHandler ( "hl", bindKey ) 

Link to comment

Castill the code it is not work no error show

edit:Thanks i test it is work but i whant ask u see this code i whant the bind key with no command

function bindKey ( player ) 
    bindKey ( player, "z", "down", zzz ) 
end 

and not work

Link to comment

Try this:

cover = false 
  
function zzz( player ) 
local team = getPlayerTeam(player) 
if team then 
local playerBlip = createBlipAttachedTo ( player, 22, 1, 255, 255, 0, 255 ) 
stophelp = setTimer ( fff, 10000, 1, playerBlip ) 
setElementVisibleTo ( playerBlip, getRootElement(), false) 
for i,v in pairs(getPlayersInTeam(team)) do 
setElementVisibleTo ( playerBlip, v, true) 
outputChatBox (getPlayerName (player) .. ":HELP ME Help Me !!!",v,255,255,0,true) 
    end 
  end 
end 
  
function fff(theblip) 
    destroyElement (theblip) 
end 
  
function bindKeys ( player, commandName ) 
    if (cover == false)then 
    cover = true 
    bindKey ( player, "z", "down", zzz ) 
    outputChatBox ( "**oN PRESS [z] to use**", player, 255, 255, 0 ) 
    else 
    cover = false 
    unbindKey ( player, "z", "down", zzz ) 
    outputChatBox ( "** OFF **", player, 255, 255, 0 ) 
    end 
end 
addCommandHandler ( "hl", bindKeys ) 

Link to comment
  
function zzz( player ) 
local team = getPlayerTeam(player) 
if team then 
local playerBlip = createBlipAttachedTo ( player, 22, 1, 255, 255, 0, 255 ) 
stophelp = setTimer ( fff, 10000, 1, playerBlip ) 
setElementVisibleTo ( playerBlip, getRootElement(), false) 
for i,v in pairs(getPlayersInTeam(team)) do 
setElementVisibleTo ( playerBlip, v, true) 
outputChatBox (getPlayerName (player) .. ":HELP ME Help Me !!!",v,255,255,0,true) 
    end 
  end 
end 
  
function fff(theblip) 
    destroyElement (theblip) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), 
function () 
    for index, player in ipairs ( getElementsByType ( "player" ) ) do 
    bindKey ( player, "Z", "down", zzz ) 
    end 
end) 
  
addEventHandler ( "onPlayerJoin", getRootElement(),  
function () 
    bindKey ( source, "Z", "down", zzz ) 
end) 

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