Jump to content

تصحيح كود بسيط


Recommended Posts

السلام عليكم

ابي تصحيح للكود ذا لانة مايشتغل

ابي لما شخص يقتل شخص يجي مثلا

man killed by sam

 

ياريت تصحيح

addEventHandler("onPlayerWasted", root,
function(_,killer)
    outputChatBox( killer .. " من قبل" .. getPlayerName(source) .. " لقد قُتل الاعب" )
end)

 

Link to comment
addEventHandler ( "onPlayerWasted" , root , function ( _ , killer ) 
if ( killer and isElement ( killer ) and getElementType ( killer ) == "player" ) then 
outputChatBox ( getPlayerName ( source ) .. " killed by "..getPlayerName(killer) )
end
end ) 

 

Link to comment
13 minutes ago, Trefeor said:

addEventHandler ( "onPlayerWasted" , root , function ( _ , killer ) 
if ( killer and isElement ( killer ) and getElementType ( killer ) == "player" ) then 
outputChatBox ( getPlayerName ( source ) .. " killed by "..getPlayerName(killer) )
end
end ) 

 

لازم يكون فيه تحقق ان القاتل ماهو السورس

لأن اللاعب لو انتحر بيطلع له انه قتل نفسه بنفسه

  • Like 2
Link to comment

@N3xT مشكور على التنبيه

addEventHandler ( "onPlayerWasted" , root , function ( _ , killer ) 
if ( killer and isElement ( killer ) and getElementType ( killer ) == "player" and killer ~= source ) then 
outputChatBox ( getPlayerName ( source ) .. " killed by "..getPlayerName(killer) )
end
end ) 

 

  • Like 1
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...