View Single Post
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-15-2024 , 17:12   Re: Choosing a random player
Reply With Quote #3

Quote:
Originally Posted by tedaimlocks View Post
Can someone help with the code below?I dont know how to get a random player and give them the stuff

Spoiler
Code:
public ChooseHero() {     // Choose a random player every round and give them the stuff under         new players[32], num; get_players(players, num, "a")         new id = players[random(num)]         set_user_armor(id, get_user_armor(id) + 150)     set_user_health(id, get_user_health(id) + 150)         give_item(id, "weapon_hegrenade")     give_item(id, "weapon_flashbang")         new szName[32]; get_user_name(id, szName, charsmax(szName))         ColorChat(0, GREEN, "^x01[^x04SPK ZM^x01]^x04 %s ^x03was chosen to be the ^x04Hero ^x03of the round! They have got ^x04+150HP+150AP+MULTIJUMPS", szName) }
__________________
mlibre is offline