Raised This Month: $ Target: $400
 0% 

what problem on this code? thanks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lovemf
BANNED
Join Date: May 2009
Old 07-04-2009 , 11:08   what problem on this code? thanks
Reply With Quote #1

Code:
tankcheck()
{
 decl String:player_name[65];
 new numTank;
 for(new i=1; i <= MaxClients; i++)
 {
  GetClientName(i, player_name, sizeof(player_name));
  if (StrEqual(player_name,"Tank"))
  numTank++;
 }
 
 return numTank;
}
Code:
PrintToChatAll("\x03server spawned %i \x03",tankcheck());


when the printToChatALL will not show..
lovemf is offline
almcaeobtac
Senior Member
Join Date: Nov 2008
Location: Florida
Old 07-04-2009 , 15:05   Re: what problem on this code? thanks
Reply With Quote #2

for(new i=1; i <= MaxClients; i++)

should be

for(new i=1; i <= GetMaxClients(); i++)
__________________
almcaeobtac is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 07-04-2009 , 15:08   Re: what problem on this code? thanks
Reply With Quote #3

No it shouldnt. Thats old coding method. MaxClients is the magical newer method of that.
retsam is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 07-04-2009 , 15:59   Re: what problem on this code? thanks
Reply With Quote #4

I just don't understand the question. Code won't tell us anything if you won't describe what you are expecting from it.
__________________
For admins: My plugins

For developers: Colors library

Last edited by exvel; 07-05-2009 at 05:25.
exvel is offline
Send a message via ICQ to exvel
voogru
Inspector Javert
Join Date: Oct 2004
Old 07-04-2009 , 16:59   Re: what problem on this code? thanks
Reply With Quote #5

your checking if the players name is tank.

would assume you need to check the players class not their name.

dont know what this is called in l4d but in tf2 it's playerclass.
voogru is offline
lovemf
BANNED
Join Date: May 2009
Old 07-05-2009 , 02:25   Re: what problem on this code? thanks
Reply With Quote #6

thanks all.
lovemf is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:54.


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