Is possible to see the hp of players in menu?
I'm talking about this:
PHP Code:
public menu(id){
new menu = menu_create("\wPlayers Menu", "handler")
new players[32], pnum, tempid
new szName[32], szTempid[10]
get_players(players, pnum)
for( new i; i<pnum; i++ ){
tempid = players[i]
get_user_name(tempid, szName, charsmax(szName))
num_to_str(tempid, szTempid, charsmax(szTempid))
menu_additem(menu, szName, szTempid, 0)
}
menu_display(id, menu, 0)
}
public handler(id, menu, item){
new data[6], szName[64], access, callback
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
new tempid = str_to_num(data);
if( is_user_alive(tempid) ){
new spower[32]
read_argv(2, spower, 31)
new damage = str_to_num(spower)
user_slap(tempid, damage)
}
}
What I need is this:
Player name [%s HP]
another player [%s HP]
etc [%s HP]
Every time you slap some player, in the menu the hp will refresh to see the left hp