Raised This Month: $12 Target: $400
 3% 

client_print


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 11-15-2014 , 10:37   client_print
Reply With Quote #1

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.
Kazalu is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-15-2014 , 10:49   Re: client_print
Reply With Quote #2

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)
__________________

Last edited by HamletEagle; 11-15-2014 at 10:50.
HamletEagle is online now
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 11-15-2014 , 10:54   Re: client_print
Reply With Quote #3

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?

Last edited by Kazalu; 11-15-2014 at 10:55.
Kazalu is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-15-2014 , 11:56   Re: client_print
Reply With Quote #4

Quote:
Originally Posted by Kazalu View Post
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 View Post
client_print(index, print_type, "message" )

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Reply


Thread Tools
Display Modes

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 06:49.


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