HoLsTeN Posted May 11, 2011 Share Posted May 11, 2011 (edited) hi all edit: Thank for Castillo he help me Edited May 11, 2011 by Guest Link to comment
Castillo Posted May 11, 2011 Share Posted May 11, 2011 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
HoLsTeN Posted May 11, 2011 Author Share Posted May 11, 2011 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
Castillo Posted May 11, 2011 Share Posted May 11, 2011 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
HoLsTeN Posted May 11, 2011 Author Share Posted May 11, 2011 Thanks i test it is work but i whant ask u see this code i whant the bind key with no command Link to comment
Castillo Posted May 11, 2011 Share Posted May 11, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now