View Single Post
Author Message
Crackhead69
Member
Join Date: Feb 2021
Old 04-24-2021 , 12:07   Get_players stock
Reply With Quote #1

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(players20)
}

stock get_them_players(szFlags[] = ""szTeam[] = ""){
    
players = -1
    
    
new iPlayers[32], iPnum
    get_players
(iPlayersiPnumszFlagsszTeam)
    
    for(new 
i;iiPnum;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.
Crackhead69 is offline