SoiiNoob Posted March 7, 2012 Share Posted March 7, 2012 I want to set a weapon to a ped but don't work function pedLoad () s1 = createPed ( 33, 2348.8999023438, 2452.8000488281, 14.60000038147, 90) giveWeapon( s1, 31, 5, true ) setTimer( giveWeapon, 1000, 1, s1, 2) end addEventHandler('onClientResourceStart', getResourceRootElement(), pedLoad) ERROR: peds\peds.lua:52: attempt to call global 'giveWeapon' (a nil value) Link to comment
Castillo Posted March 7, 2012 Share Posted March 7, 2012 Maybe because giveWeapon is a server side only function? function pedLoad () s1 = createPed ( 33, 2348.8999023438, 2452.8000488281, 14.60000038147, 90) setTimer( giveWeapon, 1000, 1, s1, 31, 5, true) end addEventHandler('onResourceStart', resourceRoot, pedLoad) Link to comment
SoiiNoob Posted March 7, 2012 Author Share Posted March 7, 2012 <meta> <info name="peds" author=" " version="1.2" type="script"/> <script src="peds.lua" type="server" /> </meta> Link to comment
Castillo Posted March 7, 2012 Share Posted March 7, 2012 What exactly doesn't work? the ped is created? Link to comment
Haze Posted March 7, 2012 Share Posted March 7, 2012 Solidsnake maybe he need to Call the giveweapon from Server side and Create ped on Client Side but it dose not make any sens to create both of Sids for 2 lien or 1 Link to comment
JR10 Posted March 7, 2012 Share Posted March 7, 2012 Not necessarily, Castillo's code should work. Link to comment
SoiiNoob Posted March 7, 2012 Author Share Posted March 7, 2012 maybe don't work bcuz this code in server-side I use setPedVoice setPedVoice(ped, "PED_TYPE_DISABLED") ERROR:peds\peds.lua:9: attemp to call global 'setPedVoice' (a nil value) Link to comment
Castillo Posted March 7, 2012 Share Posted March 7, 2012 Yes, that's it, remove that and it has to work. Link to comment
SoiiNoob Posted March 7, 2012 Author Share Posted March 7, 2012 I know but i want the peds with no voice, it can be possible? Link to comment
Castillo Posted March 7, 2012 Share Posted March 7, 2012 You can trigger the ped to the client side and then set the voice? Link to comment
SoiiNoob Posted March 8, 2012 Author Share Posted March 8, 2012 nevermind, thanks you guys 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