^Dev-PoinT^ Posted November 5, 2011 Share Posted November 5, 2011 Hi all i have made This with Benjmex but the error is when The Player Die he Explode right but the Players next the Player who Explode the die To i need the damge to the Player who die only function onKill(ammo, killer, weapon, bodypart) if killer and killer ~= source and getElementType ( killer ) == "player" then local x, y, z = getElementPosition(source) createExplosion (x, y, z, 10) outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) end end addEventHandler("onPlayerWasted", getRootElement(), onKill) Sry for My Bad english Link to comment
Aibo Posted November 5, 2011 Share Posted November 5, 2011 you didnt make this. all your recents post revolve around the (slightly changed) same piece of code. and how (and why) are you supposed to damage the player that is already wasted? anyway: https://wiki.multitheftauto.com/wiki/CreateExplosion see client-side parameter for damage. Link to comment
^Dev-PoinT^ Posted November 5, 2011 Author Share Posted November 5, 2011 No Abio i say i made Half and Benjamex made Half but when i kill a Player He Explode and me ExPlode i wnat Only him Explode the other Player dont get Damge you get it? Link to comment
Aibo Posted November 5, 2011 Share Posted November 5, 2011 i do, you don't. because you can't script for shit. just wait for someone to figure that out for you, i'm not doing it. just passing by. Link to comment
BinSlayer1 Posted November 5, 2011 Share Posted November 5, 2011 I believe you have to create the explosion clientside only for the 'source' --serverside function onKill(ammo, killer, weapon, bodypart) if killer and killer ~= source and getElementType ( killer ) == "player" then local x, y, z = getElementPosition(source) --createExplosion (x, y, z, 10) triggerClientEvent(source, "explodeMe", source, x, y, z, 10) outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) end end addEventHandler("onPlayerWasted", getRootElement(), onKill) --clientside addEvent('explodeMe', true) addEventHandler('explodeMe', getRootElement(), function(x,y,z,type) createExplosion (x, y, z, type) end ) Link to comment
^Dev-PoinT^ Posted November 5, 2011 Author Share Posted November 5, 2011 why need addEvent and how did you Prevent the explode from other Player? Link to comment
BinSlayer1 Posted November 5, 2011 Share Posted November 5, 2011 I prevented it because any other player would not be aware of the explosion except the source of the onPlayerWasted (to whom I'm triggering the event to create an explosion to) You need to understand the difference between clientside and serverside before you learn anymore of scripting 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