[ STOCK/INC ] Find player in box

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1189
Gender:
United States of America

[ STOCK/INC ] Find player in box

Post by Archive-Poster »

.: Find player in box :.

Hello, I've made this simple stock to find alive players in a imaginary box. Box color is white as default.

Usage:

Code: Select all

/* Find player in box
 *
 * @param (float/vector) flVecBoxOrigin   Origin of the box at where will be created
 * @param (float) flBoxSize                        Size of the box
 * @param (int) iDisplayBox               Time in 0.1s that the box will be stay displayed (0 doesn't show)
 * @param (int) iIgnoredPlayer            Player index that won't will be checked (0 doesn't skip anyone)
 * 
 * @return (int)    First player found index, 0 if no one was  found.
 */
stock findPlayerInBox(const Float:flVecOrigin[3], Float:flBoxSize, iDisplayBox=0, iIgnoredPlayer=0)
There are several ways to customize this code, such as store all players in an array, get entities instead of players, get players on a specific team...
Attachments
find_player_in_box.inc.zip
(1.01 KiB) Downloaded 6 times

Who is online

Users browsing this forum: No registered users and 1 guest