Hey,
ich möchte einen Ped dazu bringen zu schießen, doch ich kann ihm keine Waffe geben ..
Wie kann ich das machen? Momentan habe ich es so vesucht:
Clientside:
addEventHandler("onClientResourceStart",getRootElement(),function()
ped1 = createPed(100,0,5,5)
ped2 = createPed(101,0,7,5)
ped3 = createPed(102,0,9,5)
ped4 = createPed(103,0,11,5)
end)
addCommandHandler("guns",function(playerid,cmdtext)
triggerServerEvent("givePedsM4",localPlayer,ped)
triggerServerEvent("givePedsM4",localPlayer,ped)
triggerServerEvent("givePedsM4",localPlayer,ped)
triggerServerEvent("givePedsM4",localPlayer,ped)
end)
addCommandHandler("aim",function(playerid,cmdtext)
local x,y,z = getElementPosition(playerid)
setPedAimTarget(ped1,x,y,z)
setPedAimTarget(ped2,x,y,z)
setPedAimTarget(ped3,x,y,z)
setPedAimTarget(ped4,x,y,z)
end)
addCommandHandler("fire",function(playerid,cmdtext)
setPedControlState(ped1,"fire",true)
setPedControlState(ped2,"fire",true)
setPedControlState(ped3,"fire",true)
setPedControlState(ped4,"fire",true)
end)
Serverside:
addEvent("givePedsM4", true)
addEventHandler("givePedsM4",getRootElement(),function(ped)
setTimer(giveWeapon,1000,1,ped,31,500,true)
end)