AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_print (https://forums.alliedmods.net/showthread.php?t=251569)

Kazalu 11-15-2014 10:37

client_print
 
Hey guys.I was creating a plugin today and I got into a problem:
How am I supposed to use the "client_print" command to show a player a message, because it does not seem to work?

Code:<<
for( i = 1 ; i <= 32 ; i++ )
for( j = 1 ; j <= 32 ; j++ )
{
get_user_name( j, value, 17 );

client_print ( i, print_chat, "You are now fighting with %s.", value );
}
>>
The point is that it doesn't print any message at all.

Second question is: how can I move a player? I mean, like move him 5 meters left from his current position.

HamletEagle 11-15-2014 10:49

Re: client_print
 
Code:
client_print(index, print_type, "message" )

To print to all players use 0 as index. A problem in your code is that your name string has only 18 cells but it should have 32 cells, so increase it's size. Also, please post your full code, because we can't know what are you trying to do.

To move a player you need to play with his origins:
Code:
new Float: vecOrigin[ 3 ]; pev(index, pev_origin, vecOrigin)
Code:

vecOrigin[ 0 ] = X AXIS
vecOrigin[ 1 ] = Y AXIS
vecOrigin[ 2 ] = Z AXIS

Then, decide in which direction you want to move( x,y,z ) and increase the value by a(this is the number that you want to add). If you want to move in the X direction add a on his current position.
Code:
vecOrigin[ 0 ] += a set_pev(index, pev_origin, vecOrigin)

Kazalu 11-15-2014 10:54

Re: client_print
 
The rest of the code is not relevant at all actually.

Anyway, ontopic, thanks for your answer.And thanks for the "pev" thing, I did not know about it.I apreciate it!I think I understood the concept.

I have one further question if you don't mind.
What if I want to send a different message to each and every player?

wickedd 11-15-2014 11:56

Re: client_print
 
Quote:

Originally Posted by Kazalu (Post 2224514)
I have one further question if you don't mind.
What if I want to send a different message to each and every player?

Quote:

Originally Posted by HamletEagle (Post 2224511)
client_print(index, print_type, "message" )




All times are GMT -4. The time now is 17:34.

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