kevincouto6 Posted May 14, 2018 Share Posted May 14, 2018 (edited) Could someone help me I am not able to specify the PED ID that should be killed? zombiesKilled = 0 function ZedMissionWin () zombiesKilled = 0 outputChatBox("Good job, mission completed!") givePlayerMoney ( 50000 ) removeEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end function ZedMissionCheckKill (killer,weapon) local zed = getElementModel ( ped ) if id == 105 or id == 107 then if zed == true and killer == localPlayer then zombiesKilled = zombiesKilled+1 outputDebugString("A zed was killed, "..(0+zombiesKilled).." zeds left.") end end if zombiesKilled >= 5 then ZedMissionWin() end end function startZedMission() outputChatBox("Your Get Mission") addEventHandler("onClientPedWasted",root,ZedMissionCheckKill) end addCommandHandler("mission", startZedMission) Edited May 14, 2018 by kevincouto6 Link to comment
Addlibs Posted May 14, 2018 Share Posted May 14, 2018 (edited) local zed = getElementModel ( ped ) if id == 105 or id == 107 then Don't you mean local id = getElementModel( source ) -- source is the ped that was killed, killer is the ped/client that killed it if id == 105 or id == 107 then Also, afterwards you're checking whether zed == true but you don't define zed (well, you did, now I changed it, but you nevertheless loaded an integer into it [the model id] (or false if the function failed). It would never be equal to true) Edited May 14, 2018 by MrTasty Link to comment
kevincouto6 Posted May 14, 2018 Author Share Posted May 14, 2018 (edited) 51 minutes ago, MrTasty said: local zed = getElementModel ( ped ) if id == 105 or id == 107 then Don't you mean local id = getElementModel( source ) -- source is the ped that was killed, killer is the ped/client that killed it if id == 105 or id == 107 then Also, afterwards you're checking whether zed == true but you don't define zed (well, you did, now I changed it, but you nevertheless loaded an integer into it [the model id] (or false if the function failed). It would never be equal to true) But it is still not possible to complete the mission! META must be client or server Edited May 14, 2018 by kevincouto6 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now