From player to one guy

Posts 15 of 5 · Page 1 of 1
From player to one guy
As I dont want to bump my own threads, heres a question again:

So, to do for example an ammo box, i need two things:
Foreach(player in level.players){
and
if(Distance(pos, player.origin) <= 75){
where pos, is obviously a coord.

However, if lets say i used 'player iPrintLnBold("Test");
it would appear 18 times if it was 18 players on the map. How the heck can I change it to only happen for the one guy that buys it?
I'm sorry if this problem is already solved - but as I know:

Code:
while(1)
{
	foreach(player in level.players)
	{
		if(distance(pos, player.origin) <= 75)
		{
			player giveMaxAmmo( player getCurrentWeapon() );
			player iPrintlnBold("Current Ammo Refilled!");
		}
	}
	wait 0.45;
}
That would work, sorry if your problem has been solved tho :P
I already got it, but no, that wouldn't work perfectly
Quote Originally Posted by Arasonic View Post
I already got it, but no, that wouldn't work perfectly
Of course it would work...
Posts 15 of 5 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?