Jump to content

setPedControlState problem


Recommended Posts

why it wouldnt work no errors

function blabla() 
fahrhauss = createPed (147,  -2460.5966796875, 777.271484375, 35.171875,-90) 
setTimer (function() 
setPedControlState(fahrhauss,"crouch", false ) 
setPedControlState(fahrhauss,"crouch", true ) 
end, 3000,1) 
end 
addEventHandler ("onClientResourceStart", getResourceRootElement(),blabla) 

Link to comment

try this:

addEventHandler("OnClientPlayerSpawn",resourceRoot,function() 
ped = createPed (147,  -2460.5966796875, 777.271484375, 35.171875,90) 
setTimer (setPedControlState,7000,1,ped,"crouch", true) 
end) 

EDITED!

Edited by Guest
Link to comment

or maybe he doesn't see when the ped crouches because after he stands up...

Try my code again, I've made it on when you spawn, the ped crouches. Try spawning as close to the ped!

if that doesn't work then try this:

addEventHandler("onClientPlayerSpawn",resourceRoot,function() 
ped = createPed (147,  -2460.5966796875, 777.271484375, 35.171875,90) 
setTimer (setPedControlState,10000,0,ped,"crouch", true) --every 10 secs the ped would crouch 
end) 

This code will make the ped continually crouch after 10 secs.

EDITED: Noob mistake

Thnx TAPL for correcting me!!!

Edited by Guest
Link to comment
or maybe he doesn't see when the ped crouches because after he stands up...

Try my code again, I've made it on when you spawn, the ped crouches. Try spawning as close to the ped!

if that doesn't work then try this:

addEventHandler("OnClientPlayerSpawn",resourceRoot,function() 
ped = createPed (147,  -2460.5966796875, 777.271484375, 35.171875,90) 
setTimer (setPedControlState,10000,0,ped,"crouch", true) --every 10 secs the ped would crouch 
end) 

This code will make the ped continually crouch after 10 secs.

I don't think there an event called "OnClientPlayerSpawn" and can be attached to "resourceRoot"? :shock:

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