Jump to content

help


golanu21

Recommended Posts

peds = createPed(7, -1560.013671875, 660.078125, 7.0390625) 
marke = createMarker(-1559.30859375, 654.59375, 7.0390625 -1, "cylinder", 2, 255, 0, 0, 100) 
  
function shotplayer ( hitPlayer, matchingDimension ) 
        if hitPlayer == localPlayer then 
localPlayer = getLocalPlayer() 
x, y, z = getElementPosition(localPlayer) 
setPedAimTarget(peds, x, y, z) 
setPedLookAt(peds, x, y, z) 
end 
end 
addEventHandler("onClientMarkerHit", marke, shotplayer) 

i make that is working but the ped is not look at the player for unlimited time ...

Link to comment
peds = createPed(7, -1560.013671875, 660.078125, 7.0390625) 
marke = createMarker(-1559.30859375, 654.59375, 7.0390625 -1, "cylinder", 2, 255, 0, 0, 100) 
  
function shotplayer ( hitPlayer, matchingDimension ) 
        if hitPlayer == localPlayer then 
localPlayer = getLocalPlayer() 
x, y, z = getElementPosition(localPlayer) 
setPedAimTarget(peds, x, y, z) 
setPedLookAt(peds, x, y, z) 
count= setTimer(shotplayer ,50,0) 
end 
end 
addEventHandler("onClientMarkerHit", marke, shotplayer) 

Maybe a timer like this could help

Link to comment
peds = createPed(7, -1560.013671875, 660.078125, 7.0390625) 
marke = createMarker(-1559.30859375, 654.59375, 7.0390625 -1, "cylinder", 2, 255, 0, 0, 100) 
  
function shotplayer ( hitPlayer, matchingDimension ) 
        if hitPlayer == localPlayer then 
localPlayer = getLocalPlayer() 
x, y, z = getElementPosition(localPlayer) 
setPedAimTarget(peds, x, y, z) 
setPedLookAt(peds, x, y, z,-1) 
end 
end 
addEventHandler("onClientMarkerHit", marke, shotplayer) 

Maybe this one'll be good.

Because:

bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000 [, int blend = 1000 ], element target = nil ] ) 

"time: the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat.A negative time will make the ped look at the target indefinitely."

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