Jump to content

giveWeapon problem


SoiiNoob

Recommended Posts

Posted

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)

Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Show us your meta.xml.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

What exactly doesn't work? the ped is created?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

Ingame nick: FWC>Haze

Server I play: FWCentral

Job: FWCentral Developer

Website: fwcentral.net

276473_205836092791903_297368_n.jpg

default.png?k=0e33bf78535ebcd5e63c863cd33516c6&10966802

default.png?k=557262ebc578ba0f5fbb0b9176e6820e&10966803

Posted

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)

Posted

Yes, that's it, remove that and it has to work.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You can trigger the ped to the client side and then set the voice?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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