Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 62 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Look Stats players
doctorpatton
General Member
Since: Feb 12, 2012
Posts: 8
Last: Jul 8, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Tuesday, Mar. 27, 2012 03:13 pm
Hi guys, I have a problem with this code, I can see the stats of another player, just looking into it, but I can see only a few, can not see all the players on my team! Can someone help me?
Code:
VerStatsJogadores()
{
self endon("disconnect");
level endon("stop_now");

verjogador = undefined;
for(;;)
{
players = getentarray("player", "classname");
for(x=0;x < players.size;x++)
{   
    player = players[x];
    if(self islookingat(player) && !isDefined(self.nomejogador))
    {
	verjogador = player; 
    }
    if(isDefined(verjogador) && verjogador.pers["team"]==self.pers["team"] && isAlive(verjogador) && !isDefined(self.lvljogador) )
    {
	self.nomejogador = newClientHudElem(self);
    self.nomejogador.x = 300;
    self.nomejogador.y = 200; 
    self.nomejogador.fontscale = 0.8;
    self.nomejogador setPlayerNameString(verjogador);
	
	self.lvljogador = newClientHudElem(self);
    self.lvljogador.x = 300;
    self.lvljogador.y = 210; 
    self.lvljogador.fontscale = 0.8;
	self.lvljogador dolabel(self,"lvl2");
	self.lvljogador setValue(verjogador.pers["lvl"]);
	
	self.dinheirojogador = newClientHudElem(self);
    self.dinheirojogador .x = 300;
    self.dinheirojogador .y = 220; 
    self.dinheirojogador .fontscale = 0.8;
	self.dinheirojogador dolabel(self,"cmoney2");
	self.dinheirojogador setvalue(verjogador.pers["money"]);

    }
    else
    {
	if(isDefined(self.nomejogador) )self.nomejogador destroy();
	if(isDefined(self.lvljogador) )self.lvljogador destroy();
	if(isDefined(self.dinheirojogador) )self.dinheirojogador destroy(); 
    }
	
}
wait .1;
}
}


"my art is to create!"
DoctorPattoN***
xfire = 91651527
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Mar. 27, 2012 06:47 pm
dont use islookingat
use this

Code:
PlayersSee()
{
while(isdefined(self))
{
trace=bullettrace(self geteye()+(0,0,20),self geteye()+(0,0,20)+maps\mp\_utility::vectorscale(anglestoforward(self getplayerangles()),99999),true,self);
if(isplayer(trace["entity"]))
{
if(!isdefined(self.info))
{
self.info = newClientHudElem(self);
self.info.alignx = "center";
self.info.x = 330;
self.info.y = 100; 
self.info.fontscale = 1.2;
self.info.label = &"score:";
self.info setValue(trace["entity"].score);
}
else
self.info setValue(trace["entity"].score);
}
else if(!isplayer(trace["entity"]) && isdefined(self.info))
self.info destroy();
wait 0.1;
}
}
Share |
doctorpatton
General Member
Since: Feb 12, 2012
Posts: 8
Last: Jul 8, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Wednesday, Mar. 28, 2012 02:36 pm
Oh, was perfect, thank you!
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»