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

Args - Help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-B1ng0-
Member
Join Date: Nov 2009
Old 06-15-2011 , 05:57   Args - Help!
Reply With Quote #1

Hello guys.

ex: i write in game chat: B1ng0 is here

in plugin i have: read_args(message, charsmax(message))

How i can get from message just first word "B1ng0"
-B1ng0- is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 06-15-2011 , 06:41   Re: Args - Help!
Reply With Quote #2

you could just do:
read_argv(1,message,charsmax(message))

or use strbreak or something to break the message from read_args apart to get the first word
jimaway is offline
-B1ng0-
Member
Join Date: Nov 2009
Old 06-15-2011 , 08:41   Re: Args - Help!
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
you could just do:
read_argv(1,message,charsmax(message))

or use strbreak or something to break the message from read_args apart to get the first word

with read_argv(1,message,charsmax(message)) dont work...

but second variant i dont know how to use...
-B1ng0- is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-15-2011 , 09:04   Re: Args - Help!
Reply With Quote #4

You can use parse()

PHP Code:
new szString[] = "Drekes is here";

new 
szFirst[10], szSecond[10];
parse(szStringszFirstcharsmax(szFirst), szSecondcharsmax(szSecond));

// szFirst = "Drekes"
// szSecond = "is here" 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
-B1ng0-
Member
Join Date: Nov 2009
Old 06-15-2011 , 09:27   Re: Args - Help!
Reply With Quote #5

Quote:
Originally Posted by drekes View Post
You can use parse()

PHP Code:
new szString[] = "Drekes is here";

new 
szFirst[10], szSecond[10];
parse(szStringszFirstcharsmax(szFirst), szSecondcharsmax(szSecond));

// szFirst = "Drekes"
// szSecond = "is here" 
Don't work...

new said[192];
read_args(said, charsmax(said));

if (!said[0])
return PLUGIN_CONTINUE;

new msg1[32], msg2[32];

parse(said, msg1, charsmax(msg1), msg2, charsmax(msg));

if i write: hello b1ng0

msg1 show me : hello b1ng0
msg2 dont show nothing...
-B1ng0- is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 06-15-2011 , 09:36   Re: Args - Help!
Reply With Quote #6

add remove_quotes(said) after read_args(said, charsmax(said))
Nyuszy is offline
-B1ng0-
Member
Join Date: Nov 2009
Old 06-15-2011 , 09:44   Re: Args - Help!
Reply With Quote #7

#drekes & #Nyuszy ty guys, works perfectly!
-B1ng0- 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:42.


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