Here's an attempted eventscripts version (python) if you want to take a look...this crashes the server though because it's trying to force the kills to not come up as skull kills (which is what im looking for). You add the user by typing add_user steamid
# ./cstrike/addons/eventscripts/
damage/damage.py
import
es, cPickle, playerlib, os.
path
admins =
['STEAM_
0:
0:
234932', 'STEAM_
0:
0:
11089864', 'STEAM_
0:
0:
11089864'
]
use_est =
1 #
if one, est will be used to deal
damage, that way
if the player kills them witht he extra
damage, it doesn't show as a skull
player_data =
{}
abcdamage =
1
def
load():
if not
es.exists
('clientcommand', 'add_user'
):
es.regclientcmd
('add_user', '
damage/add_user'
)
player_db =
es.getAddonPath
('
damage'
) + '/players.db'
if os.
path.isfile
(player_db
):
global player_data
players =
open(player_db
)
player_data = cPickle.
load(players
)
players.
close()
def
unload():
if es.exists
('clientcommand', 'add_user'
):
es.unregclientcmd
('add_user'
)
save_data
def add_user
():
userid =
es.getcmduserid
()
try:
es.getargs
().split
(' '
)
except:
es.tell
(userid, '#multi', '#greenInvalid Syntax -- #lightgreenadd_user <player> <damage>'
)
return
if es.getplayersteamid
(userid) in admins:
if len
(es.getargs
().split
(' '
)) >=
2:
target =
es.getargs
().split
(' '
)[0]
amount =
es.getargs
().split
(' '
)[1]
if es.getuserid
(target
):
global player_data
if isfloat
(amount
):
amount =
float(amount
)
if amount >
0:
player_data
[es.getplayersteamid
(es.getuserid
(target
))] = amount
es.tell
(userid, '#multi', '#greenYou have made #lightgreen%s#green a
user with #lightgreen%s%#green extra
damage!'%
(playerlib.getPlayer
(es.getuserid
(target
)).get
('
name'
), amount
))
else:
del player_data
[es.getplayersteamid
(es.getuserid
(target
))]
save_data
()
else:
es.tell
(userid, '#green', 'Please input a
float or integer above
0!
0 is to delete
user'
)
else:
es.tell
(userid, '#multi', '#greenSorry, #lightgreen%s#green is an invalid player'%target
)
else:
es.tell
(userid, '#multi', '#greenInvalid Syntax -- #lightgreenadd_user <player> <damage>'
)
else:
es.tell
(userid, '#green', 'You are not an admin!'
)
def isfloat
(amount
):
if amount.isdigit
():
return
1
index = amount.
find('.'
)
if not index == -
1:
if str
(amount
[0:amount.
find('.'
)]).isdigit
():
if str
(amount
[amount.
find('.'
) +
1:
]).isdigit
():
return
1
return
0
def save_data
():
player_db =
open(es.getAddonPath
('
damage'
) + '/players.db', 'w'
)
cPickle.dump
(player_data, player_db
)
player_db.
close()
def
player_hurt(ev
):
if not ev
['
attacker'
] == ev
['
userid'
] and not ev
['
weapon'
] == 'point_hurt':
if player_data.has_key
(es.getplayersteamid
(ev
['
attacker'
])):
damage =
int(ev
['dmg_health'
]) *
(player_data
[es.getplayersteamid
(ev
['
attacker'
])] /
100.
0)
if use_est:
if abcdamage:
es.server.queuecmd
('
est_damage %s %s %s'%
(ev
['
attacker'
], ev
['
userid'
],
damage))
global abcdamage
abcdamage =
0
gamethread.delayed
(0, un_make_damage
)
else:
es.server.queuecmd
('
damage %s %s
32 %s'%
(ev
['
userid'
],
damage, ev
['
attacker'
]))
def un_make_damage
():
global abcdamage
abcdamage =
1