Jump to content

[help]Caer piso


Recommended Posts

Bueno pues tengo un script que lo que hace es que si estas en el team de policia te tira al suelo con una sola bala yo quiero que cuando tengas poca vida ocurra la animacion crack y sin ser policia que todos puedan usarla trate de usar root para que todos puedan pero aun asi solo los policias pueden 

clientside


    addEventHandler("onClientPlayerDamage", localPlayer,
function(attacker, weapon, bodypart, loss)
team = getPlayerTeam(attacker)
    if (attacker and getElementType(attacker) == "player" and weapon == 30 and team and getTeamName(team) == "Police") then -- Policia
        

            triggerServerEvent("police:crim", localPlayer, attacker) -- Manda el Evento hacia el serverside
    end
end)

serverside

addEvent("police:crim", true)
addEventHandler("police:crim", root,
function (police)
if ( getPlayerWantedLevel (source) >= 2) then  --- mayor de 2 wanted tiene que tener el jugador para usar el arma
		setPedAnimation ( source, "CRACK", "crckidle2")
else
outputChatBox ( "No es muy buscado", police, 0, 0, 255, true ) -- Dee lo contrario  si no tiene 2 wanted 

end
end)

 

Edited by Angel Carvajal
Link to comment
9 hours ago, Angel Carvajal said:

Bueno pues tengo un script que lo que hace es que si estas en el team de policia te tira al suelo con una sola bala yo quiero que cuando tengas poca vida ocurra la animacion crack y sin ser policia que todos puedan usarla trate de usar root para que todos puedan pero aun asi solo los policias pueden 

clientside


    addEventHandler("onClientPlayerDamage", localPlayer,
function(attacker, weapon, bodypart, loss)
team = getPlayerTeam(attacker)
    if (attacker and getElementType(attacker) == "player" and weapon == 30 and team and getTeamName(team) == "Police") then -- Policia
        

            triggerServerEvent("police:crim", localPlayer, attacker) -- Manda el Evento hacia el serverside
    end
end)

serverside


addEvent("police:crim", true)
addEventHandler("police:crim", root,
function (police)
if ( getPlayerWantedLevel (source) >= 2) then  --- mayor de 2 wanted tiene que tener el jugador para usar el arma
		setPedAnimation ( source, "CRACK", "crckidle2")
else
outputChatBox ( "No es muy buscado", police, 0, 0, 255, true ) -- Dee lo contrario  si no tiene 2 wanted 

end
end)

 

I think i understand what do you mean by Google translate

You need only to do it in one side.
Server side: 

 

addEventHandler("onPlayerDamage", root,
	function(attacker, weapon, bodypart, loss)
		if (attacker and getElementType(attacker) == "player" )then
			local team = getPlayerTeam(attacker)
			if (weapon == 30 and team and getTeamName(team) == "Police") then
				if ( getPlayerWantedLevel (source) >= 2 ) then  
					setPedAnimation ( source, "CRACK", "crckidle2")
				end
			end
		end
	end
)



And in next time please speak English and post it Here https://forum.multitheftauto.com/forum/71-scripting/ !

@!#NssoR_)

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