Jump to content

Help


Recommended Posts

  • Moderators
4 minutes ago, kevincouto6 said:

Oops, maybe you should have got it wrong, wanted to add example missions kills 300 peds

If you want to make an example, then isn't it correct of me to give you the right syntax for it? :o ???

 

 

 

Link to comment
15 minutes ago, IIYAMA said:

If you want to make an example, then isn't it correct of me to give you the right syntax for it? :o ???

 

 

 

Example I want to create a mission where you must kill 300 ped "zombies" for when you complete receive rewards and money

Link to comment
  • Moderators
1 minute ago, kevincouto6 said:

Example I want to create a mission where you must kill 300 ped "zombies" for when you complete receive rewards and money

Yes, I understand that already. So I helped you a bit with it.

Now start with writing your example.

Link to comment
  • Moderators
addEventHandler("onPedWasted", root,
function (_, killer)
	-- a ped died
end)

 

Start with /\

 

I will help you more if you actually put energy in it yourself, which you are not doing at the moment.

Good luck.

Link to comment
1 hour ago, IIYAMA said:

addEventHandler("onPedWasted", root,
function (_, killer)
	-- a ped died
end)

 

Start with /\

 

I will help you more if you actually put energy in it yourself, which you are not doing at the moment.

Good luck.

Hello, I can not do anything I'm not understanding things, I think there's another way you can help me, is there any video or tutorial explaining this?

Link to comment
--UNTESTED!

zombiesKilled = 0

function ZedMissionWin ()
	zombiesKilled = 0
	outputChatBox("Good job, mission completed!")
	removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill)
end

function ZedMissionCheckKill (killer,weapon)

	local zed = getElementData(source,"zombie")

  	if zed == true and killer == localPlayer then 
		zombiesKilled = zombiesKilled+1 
		outputDebugString("A zed was killed, "..(300-zombiesKilled).." zeds left.")
	end

	if zombiesKilled >= 300 then 
		ZedMissionWin() 
	end
end

function startZedMission()
	addEventHandler("onClientPedWasted",root,ZedMissionCheckKill)
end

addCommandHandler("startzedmission", startZedMission)

^ It's bare bones, but this simple client-side script should get you started; read it from bottom up and try to understand how it works, then modify/add stuff one at a time, followed by testing and reverting if you break something. For instance, you can add a HUD kill counter, or a money reward for completing the mission. People will assist if you give it a try yourself, nobody will just do all the work for you. Good luck!

Edited by Zorgman
Link to comment

I'm in doubt that something is going wrong when I try to just complete the mission in 4 zombies, and money and Xp are not working anyone could help me?

--UNTESTED!

zombiesKilled = 15

function ZedMissionWin ()
	zombiesKilled = 15
	outputChatBox("Good job, mission completed!")
    givePlayerMoney ( 100000 )
	givePlayerXp ( 1500 )
	removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill)
end
 
function onlyPedforMisson ()
   local getValidPedModels = {
	( 22 )
	( 34 )
	( 48 )
	( 45 )
}
end

function = getMoneyAndXpAfhterComplet
    givePlayerMoney ( 100000 )

function ZedMissionCheckKill (killer,weapon)

	local zed = getElementData(source,"zombie")

  	if zed == true and killer == localPlayer then 
		zombiesKilled = zombiesKilled+1 
		outputDebugString("A zed was killed, "..(300-zombiesKilled).." zeds left.")
	end

	if zombiesKilled >= 300 then 
		ZedMissionWin() 
	end
end

function startZedMission()
	addEventHandler("onClientPedWasted",root,ZedMissionCheckKill,onlyPedforMisson)
end

addCommandHandler("startzedmission", startZedMission)

 

Link to comment

@Zorgman

Can anyone help me with this

zombiesKilled = 5

function ZedMissionWin ()
	zombiesKilled = 5
	outputChatBox("Good job, mission completed!")
	givePlayerMoney ( 50000 )
	removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill)
end

function pedID
	getElementsByType ( "ped",15,25)
end

function ZedMissionCheckKill (killer,weapon)

	local zed = getElementData(source,"pedID")

  	if zed == true and killer == localPlayer then 
		zombiesKilled = zombiesKilled+1 
		outputDebugString("A zed was killed, "..(5-zombiesKilled).." zeds left.")
	end

	if zombiesKilled >= 5 then 
		ZedMissionWin() 
	end
end

function startZedMission()
	outputChatBox("mission")
	addEventHandler("onClientPedWasted",root,ZedMissionCheckKill)
end

addCommandHandler("mis", startZedMission)

 

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