MedKhiti Posted May 16, 2014 Share Posted May 16, 2014 can any one tell me how to create object 1247 star/wanted object on the head of player when a player is wanted and it removes when a player get unwanted ? Link to comment
Snow-Man Posted May 16, 2014 Share Posted May 16, 2014 (edited) can any one tell me how to create object 1247 star/wanted object on the head of player when a player is wanted and it removes when a player get unwanted ? use createObject attachElements getPlayerWantedLevel destroyElement edited : thanks csmit195 Edited May 16, 2014 by Guest Link to comment
codeluaeveryday Posted May 16, 2014 Share Posted May 16, 2014 Don't use getElementPosition, use: getPedBonePosition Link to comment
MedKhiti Posted May 16, 2014 Author Share Posted May 16, 2014 can u simple it to me ? with a simple code ?. Link to comment
#RooTs Posted May 16, 2014 Share Posted May 16, 2014 Script in Team I not know to the "Protex" not group ACL local Timer = {} Bribe = {} xMain_ = function( ) for index,v in ipairs (getElementsByType("player")) do xWanted_(v) end end addEventHandler("onResourceStart", resourceRoot, xMain_); xWanted_ = function(v) if not isElement(v) then return end Timer[v] = setTimer( function(player) if isElement(player) then local team = getPlayerTeam(player) if ( team and getTeamName(team) == "Police" ) then return end local Wanted = getPlayerWantedLevel ( player ); local x,y,z = getElementPosition ( player ); local Name = getPlayerName ( player ); if ( Wanted >= 1 ) then if Bribe[player] and isElement(Bribe[player]) then return end Bribe[player] = createObject(1247,x,y,z); attachElements (Bribe[player],player,0,0,1.6) ; outputChatBox(" [ "..Name.." ] Have [ "..Wanted.." ] Wanted Level! ",v,255,0,0,true); elseif ( Wanted == 0 and Bribe[player] and isElement(Bribe[player]) ) then destroyElement(Bribe[player]); Bribe[player] = nil end end end ,5000,0,v); end xJoin_ = function ( ) xWanted_(source); end addEventHandler("onPlayerJoin",root,xJoin_); xWantedDestroy_ = function ( ) if Timer[source] and isTimer(Timer[source]) then killTimer(Timer[source]); Timer[source] = nil end; if Bribe[source] and isElement(Bribe[source]) then destroyElement(Bribe[source]); Bribe[source] = nil end end addEventHandler("onPlayerQuit",root,xWantedDestroy_); 1 Link to comment
#RooTs Posted May 18, 2014 Share Posted May 18, 2014 this is prestege Script which? 1 Link to comment
Snow-Man Posted May 18, 2014 Share Posted May 18, 2014 Script in TeamI not know to the "Protex" not group ACL local Timer = {} Bribe = {} xMain_ = function( ) for index,v in ipairs (getElementsByType("player")) do xWanted_(v) end end addEventHandler("onResourceStart", resourceRoot, xMain_); xWanted_ = function(v) if not isElement(v) then return end Timer[v] = setTimer( function(player) if isElement(player) then local team = getPlayerTeam(player) if ( team and getTeamName(team) == "Police" ) then return end local Wanted = getPlayerWantedLevel ( player ); local x,y,z = getElementPosition ( player ); local Name = getPlayerName ( player ); if ( Wanted >= 1 ) then if Bribe[player] and isElement(Bribe[player]) then return end Bribe[player] = createObject(1247,x,y,z); attachElements (Bribe[player],player,0,0,1.6) ; outputChatBox(" [ "..Name.." ] Have [ "..Wanted.." ] Wanted Level! ",v,255,0,0,true); elseif ( Wanted == 0 and Bribe[player] and isElement(Bribe[player]) ) then destroyElement(Bribe[player]); Bribe[player] = nil end end end ,5000,0,v); end xJoin_ = function ( ) xWanted_(source); end addEventHandler("onPlayerJoin",root,xJoin_); xWantedDestroy_ = function ( ) if Timer[source] and isTimer(Timer[source]) then killTimer(Timer[source]); Timer[source] = nil end; if Bribe[source] and isElement(Bribe[source]) then destroyElement(Bribe[source]); Bribe[source] = nil end end addEventHandler("onPlayerQuit",root,xWantedDestroy_); 1 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