AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   plugin only works for ct team when wanted for both (https://forums.alliedmods.net/showthread.php?t=87740)

vivalavida 03-15-2009 20:03

plugin only works for ct team when wanted for both
 
hey guys im having trouble with a code, it only gives the plugin to someone on the ct team, when i want it on the t team as well. heres a snip

get_players_distance(origin,players,num,"aeij ",id,"CT")
}
else
{
get_players_distance(origin,players,num,"aeij ",id,"TERRORIST")
}
if(num)

AntiBots 03-15-2009 20:07

Re: plugin only works for ct team when wanted for both
 
get_players_distance is a stock?

vivalavida 03-15-2009 20:10

Re: plugin only works for ct team when wanted for both
 
i have completely no idea lol. i had the plugin custom made and they guy who made it hasnt been online so i have no way of contacting him.

Bugsy 03-15-2009 20:11

Re: plugin only works for ct team when wanted for both
 
Try

PHP Code:

get_players_distanceorigin players num "aij" id 

Quote:

Originally Posted by AntiBots (Post 781515)
get_players_distance is a stock?

It's in the chr_engine include.

Code:

get_players_distance(const Float:origin[3],players[32], &num,flags[]="",index=0,team[]="")
/*
*
*  Returns indexes of players in order according
*  to how close they are to "origin". Indexes are
*  stored in "players[32]" and the number of
*  indexes returned is stored in num. team[] is
*  used only if flag 'e' is passed.
*
*  Flags:
*  "a" - Don't return dead players
*  "b" - Don't return alive players
*  "c" - Skip bots
*  "d" - Skip real players
*  "e" - Match with passed team
*  "h" - Skip HLTV
*  "i" - Is in Viewcone
*  "j" - Is Visible
*
*  If flag 'i' is passed, you must specify into
*  variable "index" who's viewcone to check if
*  the returned players are in.
*
*/


vivalavida 03-15-2009 20:14

Re: plugin only works for ct team when wanted for both
 
this is what i found

// Taken from chr_engine.inc
stock get_players_distance(const Float:origin2[3],players[32], &num,const flags[]="",index=0,const team[]="")
{
new bool:flag1, bool:flag2
if(containi(flags,"j")!=-1) flag2 = true
if(containi(flags,"i")!=-1)
{
if(!pev_valid(index))
return 0;
flag1 = true
}

static Float:origin[3]
origin[0] = origin2[0]
origin[1] = origin2[1]
origin[2] = origin2[2]

static players2[32]
new num2
arrayset(players2,0,32)
get_players(players2,num2,flags,team)
static Float:origin3[3]
static Float:distance[32]
for(new i=0;i<32;i++) distance[i]=0.0
num = num2

static Float:hit[3]
new bool:continuea=true
for(new i=0;i<num2;i++)


All times are GMT -4. The time now is 09:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.