Hello!
I am trying to figure out how to make a get_players stock which can be used like so
PHP Code:
new players
public plugin_init() {
register_clcmd("say /test","TestStock")
}
public TestStock(id){
if(!is_user_alive(id) || !is_user_connected(id)) return
get_them_players("ae","TERRORIST")
set_user_health(players, 20)
}
stock get_them_players(szFlags[] = "", szTeam[] = ""){
players = -1
new iPlayers[32], iPnum
get_players(iPlayers, iPnum, szFlags, szTeam)
for(new i;i< iPnum;i++)
players = iPlayers[i]
}
From the above code the goal is to set the HP of all the T players using the stock to 20 by calling the stock,
tho as i test it, it sets the hp to 20 on random T players, not on all of them.
I would appreciate if somebody could lay some wisdom.