-.Paradox.- Posted October 29, 2013 Posted October 29, 2013 (edited) Hello, can somebody help me fixing this no errors in debug, this suppose to add +1 point for every weapon stat when you kill a player, like example when i kill somebody with m4 i earn 1 point to m4 etc here is the code and thanks addEventHandler("onZombieWasted", root, function (killer, weapon ,bodypart) if (killer and getElementType(killer) == "player" and killer ~= source) then local Acc = getAccountName ( acc ) for i = 21 , 25 do getPedStat(source,i,getAccountData(Acc, "stat."..i)) end for i = 69 , 79 do getPedStat(source,i,getAccountData(Acc, "stat."..i)) end for i = 21 , 25 do setPedStat(source,i,+1) end for i = 69 , 79 do setPedStat(source,i,+1) end end end) Edited October 30, 2013 by Guest If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted October 29, 2013 Posted October 29, 2013 You must get the current stat, then set it + 1. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted October 29, 2013 Author Posted October 29, 2013 Can you fix it to me please? Sorry for annoying If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted October 29, 2013 Posted October 29, 2013 addEventHandler ( "onPlayerWasted", root, function ( killer, weapon ,bodypart ) if ( killer and getElementType ( killer ) == "player" and killer ~= source ) then for i = 21, 25 do setPedStat ( source, i, getPedStat ( source, i ) + 1 ) end for i = 69 , 79 do setPedStat ( source, i, getPedStat ( source, i ) + 1 ) end end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted October 29, 2013 Author Posted October 29, 2013 Thank you, i will try it C: If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted October 29, 2013 Posted October 29, 2013 Did it work? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted October 30, 2013 Author Posted October 30, 2013 no nothing If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted October 30, 2013 Posted October 30, 2013 Oh, I forgot about something at getPedStat, copy the code again. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted October 30, 2013 Author Posted October 30, 2013 Still not working i tried with onZombieWasted too and nothing happened If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted October 30, 2013 Posted October 30, 2013 Any errors? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted October 30, 2013 Author Posted October 30, 2013 Nothing on debug If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted October 30, 2013 Posted October 30, 2013 Try debugging the script, add chat box outputs to help spot the error. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted October 31, 2013 Author Posted October 31, 2013 Idk where is the error it should work and it's server side. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
3NAD Posted November 1, 2013 Posted November 1, 2013 addEventHandler ( "onPlayerWasted", root, function ( killer, weapon, bodypart ) if killer then if getElementType ( killer ) == "player" then if killer ~= source then for i = 21, 25 do setPedStat ( killer, i, getPedStat ( killer, i ) + 1 ) end for i = 69 , 79 do setPedStat ( killer, i, getPedStat ( killer, i ) + 1 ) end end end end end )
-.Paradox.- Posted November 3, 2013 Author Posted November 3, 2013 This add +1 for all stats, and i want to add only for the weapon i killed with the player/zombie If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
3NAD Posted November 4, 2013 Posted November 4, 2013 Stats = { [22] = { 69 }; [23] = { 70 }; [24] = { 71 }; [25] = { 72 }; [26] = { 73 }; [27] = { 74 }; [28] = { 75 }; [29] = { 76 }; [30] = { 77 }; [31] = { 78 }; [34] = { 79 }; }; addEventHandler ( "onPlayerWasted", root, function ( ammo, killer, weapon, bodypart ) if killer then if getElementType ( killer ) == "player" then if killer ~= source then if Stats[tonumber(weapon)] then setPedStat ( killer, Stats[tonumber(weapon)][1], getPedStat ( killer, Stats[tonumber(weapon)][1] ) + 1 ) end end end end end )
-.Paradox.- Posted November 4, 2013 Author Posted November 4, 2013 Thanks working perfect If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
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