SoiiNoob Posted March 7, 2012 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)
Castillo Posted March 7, 2012 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) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted March 7, 2012 Posted March 7, 2012 Show us your meta.xml. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
SoiiNoob Posted March 7, 2012 Author Posted March 7, 2012 <meta> <info name="peds" author=" " version="1.2" type="script"/> <script src="peds.lua" type="server" /> </meta>
Castillo Posted March 7, 2012 Posted March 7, 2012 What exactly doesn't work? the ped is created? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Haze Posted March 7, 2012 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 Ingame nick: FWC>Haze Server I play: FWCentral Job: FWCentral Developer Website: fwcentral.net
JR10 Posted March 7, 2012 Posted March 7, 2012 Not necessarily, Castillo's code should work. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
SoiiNoob Posted March 7, 2012 Author 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)
Castillo Posted March 7, 2012 Posted March 7, 2012 Yes, that's it, remove that and it has to work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
SoiiNoob Posted March 7, 2012 Author Posted March 7, 2012 I know but i want the peds with no voice, it can be possible?
Castillo Posted March 7, 2012 Posted March 7, 2012 You can trigger the ped to the client side and then set the voice? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted March 8, 2012 Posted March 8, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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