Raised This Month: $ Target: $400
 0% 

Is this work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 09-26-2012 , 13:41   Is this work?
Reply With Quote #1

Eg question is: How long you play on this server
Answer must to be with 1 character..
PHP Code:
    if(!key[1])
    {
        
client_print(idprint_chat"You cant type more then 1 caracter")
        return 
PLUGIN_HANDLED
    

is this work?
__________________
Artifact is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 09-26-2012 , 13:51   Re: Is this work?
Reply With Quote #2

Try.
__________________
micapat is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 09-26-2012 , 14:22   Re: Is this work?
Reply With Quote #3

if( !key[ 0 ] || key[ 1 ] )
Backstabnoob is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 09-26-2012 , 14:26   Re: Is this work?
Reply With Quote #4

Without to know how the string is formatted it's useless to suggest some codes.
__________________
micapat is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-26-2012 , 14:32   Re: Is this work?
Reply With Quote #5

How do you retrieve key ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-26-2012 , 14:52   Re: Is this work?
Reply With Quote #6

i think if you dont want that [1] contains something then
if(key[1]) // if there are some value then function works
.Dare Devil. is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 09-26-2012 , 15:07   Re: Is this work?
Reply With Quote #7

PHP Code:
new char32 ];
if( 
strlenchar ) > ) {
  
// two or more characters reached
}

else {
  
// string is empty or contains one character
}

/* For numeric */
new iResult str_to_numchar );

if( 
iResult == ) {
  
// char is "2", iResult is 2 and char[ 0 ] is also 2

__________________

Last edited by claudiuhks; 09-26-2012 at 15:09.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Artifact
Veteran Member
Join Date: Jul 2010
Old 09-26-2012 , 15:09   Re: Is this work?
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
How do you retrieve key ?
by read_argv
__________________
Artifact is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-26-2012 , 16:27   Re: Is this work?
Reply With Quote #9

if( read_argv( ... ) == 1 )

But if you hook say or say_team commands you should use read_args + remove_quotes, then #3 seems the best way.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 09-26-2012 at 16:28.
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-26-2012 , 19:50   Re: Is this work?
Reply With Quote #10

Quote:
Originally Posted by Artifact View Post
Eg question is: How long you play on this server
Answer must to be with 1 character..
PHP Code:
    if(!key[1])
    {
        
client_print(idprint_chat"You cant type more then 1 caracter")
        return 
PLUGIN_HANDLED
    

is this work?
What does that question have to do with the code you posted?
__________________
fysiks 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 08:14.


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