Jump to content

Giving a ped a weapon


Xeno

Recommended Posts

From my last post you no that im making a ped window, i finaly figured how to spawn a ped by a button, but now i need to give the already spawned ped a weapon, i have tried and here it is so far.

Client

function givem4()
	if source == givem4 then
 
		triggerServerEvent ( "givem4", gMe )                    
                       guiSetVisible( wdwLogin, false)
		showCursor( false )
		outputChatBox("Your ped has been given an M4!", gMe)	
end
end
 
 
addEventHandler ( "onClientGUIClick", getRootElement(), givem4 )

function makeped()
   ped1 = createPed(164,0,0,5)   
end   
 
function givem4 ()
giveWeapon(ped1, 31, 50000)
end
 
-------------------------ADD THE EVENTS!
addEvent("makeped", true)
addEvent("givem4", true)
 
 
 
---------------------ACTIVATE AND LINK THE EVENTS!
addEventHandler("makeped", getRootElement(), makeped)
addEventHandler("givem4", getRootElement(), givem4)

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