Raised This Month: $ Target: $400
 0% 

ehm... i dunno, just a simple question.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-05-2006 , 11:56   ehm... i dunno, just a simple question.
Reply With Quote #1

i just wondered would this start with client_print(0,... or client_print(1,...?
Code:
for ( new a = 0 ; a < get_playersnum() ; a++ )     client_print(i, print_chat, "msg")
[ --<-@ ] Black Rose is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-05-2006 , 12:06  
Reply With Quote #2

It would start with 0.
client_print(0, whatever) prints to all clients (IIRC).

Player indices are 1-32. Also, note that if there are 5 players on the server, it doesn't mean that they will have the indices 1, 2, 3, 4, and 5. If there are 6 players with 1,2,3,4,5,6 and then the one with 3 leaves, there are 5 players with 1,2,4,5,6 now... You get the idea.

to get the indices of all players, use get_players.
__________________
hello, i am pm
PM is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-05-2006 , 12:11  
Reply With Quote #3

thank you PM

Edit: this would work, right?
Code:
new Player[32] new playerCount get_players(Player, playerCount, "c") for (new i = 0; i < playerCount; i++ )     client_print(Player[i], print_chat, "lol")
[ --<-@ ] Black Rose is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-05-2006 , 12:28  
Reply With Quote #4

Quote:
Originally Posted by [ --<-@
Black Rose]thank you PM

Edit: this would work, right?
Code:
new Player[32] new playerCount get_players(Player, playerCount, "c") for (new i = 0; i < playerCount; i++ )     client_print(Player[i], print_chat, "lol")
I guess it would, yes well, testing it is the best way to find out.
__________________
hello, i am pm
PM is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-05-2006 , 12:30  
Reply With Quote #5

why not just do
Code:
client_print(0 , print_chat, "lol")
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-05-2006 , 12:42  
Reply With Quote #6

im not using it for client_cmd

and what i meant with the post was is this gonna show to all players first and then continue to player 1 player 2.......?
for (new i = 0; i < playerCount; i++ )
[ --<-@ ] Black Rose is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-05-2006 , 13:29  
Reply With Quote #7

Yes, i is incremented after the first loop run
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 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 20:22.


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