Mc_Trekkie Posted February 24, 2012 Share Posted February 24, 2012 Server: createTeam ( "Medic", 200, 0, 100 ) addEventHandler( 'onPlayerDamage',root, function( attacker, weapon, bodypart, loss ) local health = getElementHealth( source ) if isElement( attacker ) and attacker ~= source and weapon == 41 and health < 100 then local team = getPlayerTeam( attacker ) if team then if getTeamName( team ) == 'Medic' then local money = getPlayerMoney( source ) if money >= 10 then givePlayerMoney( attacker,10 ) takePlayerMoney( source,10 ) setElementHealth( source,getElementHealth( source ) + 10 ) end end end end end ) Client: addEventHandler( 'onClientPlayerDamage',localPlayer, function( attacker, weapon, bodypart, loss ) local health = getElementHealth( source ) if isElement( attacker ) and attacker ~= source and weapon == 41 and health < 100 then local team = getPlayerTeam( attacker ) if team then if getTeamName( team ) == 'Medic' then if getPlayerMoney( ) >= 10 then cancelEvent( ) end end end end end ) Link to comment
Mc_Trekkie Posted February 24, 2012 Author Share Posted February 24, 2012 Не работает) Link to comment
Mc_Trekkie Posted February 24, 2012 Author Share Posted February 24, 2012 Молчит,зараза. Link to comment
Mc_Trekkie Posted February 24, 2012 Author Share Posted February 24, 2012 Там всё верно,проверка на команды делается,но хп и бабло не убавляется/прибавляется. Link to comment
TwiX! Posted February 24, 2012 Share Posted February 24, 2012 проверяй тогда каждую строчку выводом сообщения, других путей не вижу Link to comment
Mc_Trekkie Posted February 24, 2012 Author Share Posted February 24, 2012 Спс кэп,уже как бэ давно всё проверял ошибка со строки 5:) 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