Jump to content

setPedControlState problem


Recommended Posts

Posted

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) 

Posted

Post your meta.xml ..

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted (edited)

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

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

Maybe another part of the code is missing it up, Show your full code ..

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted (edited)

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

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted
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:

CiTLh.png

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