Jump to content

danglong

Members
  • Posts

    4
  • Joined

  • Last visited

danglong's Achievements

Vic

Vic (3/54)

0

Reputation

  1. I finally change the function to this, but Ped still not spawn, what happen? It could run without error, but no ped spawn local x, y, z = 1700.55, -1500.46, 10 function taoPed() local x,y,z = getElementPosition ( source ) x = x + math.random ( 5, 10 ) y = y + math.random ( 5, 10 ) local pedVn = createPed (90,x,y,z) if ( pedVn == true ) then setTimer ( pedWeapon , 2500) setTimer ( taoPed, 2500, 1000) end end addEventHandler ( "onResourceStart", resourceRoot, taoPed) function pedWeapon() if ( taoPed ) then giveWeapon ( pedVn, 38, 1000, true ) setPedRotation( pedVn, 60) end end
  2. thePlayer is source? do i need to define it? thank for help, I am new bie, setPedControlState is client script. I see
  3. Thank for help, but It still get trouble, the server say:" bad Argument GetElementPosition" ??? "error in attemp x (boolean value)
  4. I have just done my scripting to spawn ped, give ped weapon and set ped target. How ever it have problem. My string: local x, y, z = 1700.55, -1500.46, 10 function taoPed() local x,y,z = getElementPosition ( thePlayer ) x = x + math.random ( 5, 10 ) y = y + math.random ( 5, 10 ) z = z + math.random ( 5, 10 ) local pedVn = createPed (29,x,y,z) if ( pedVn == true ) then giveweapon ( pedVn, 38, 1000 ) end end addEventHandler ( "onResourceStart", getRootElement(), taoPed ) function pedTarget() if ( taoPed ) then setPedTarget ( pedVn, thePlayer ) setPedControlState ( pedVn, forwards, true ) setPedControlState ( pedVn, fire, true ) end if ( getElementPosition ( thePlayer ) == getElementPosition ( pedVn ) ) then setPedControlState ( pedVn, forwards, false ) end end addEventHandler ( "onResourceStart", getRootElement(), pedTarget ) scripting team please help me
×
×
  • Create New...