Raised This Month: $ Target: $400
 0% 

help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 05-05-2012 , 10:07   help
Reply With Quote #1

How to catch if is password removed??
PHP Code:
    new pass[32]
    if(
get_cvar_string("sv_password"passcharsmax(pass)) == "")
        return 
PLUGIN_HANDLED 
Code:
Error: Array must be indexed (variable "-unknown-") on line 55
__________________
Artifact is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-05-2012 , 10:27   Re: help
Reply With Quote #2

remove "charsmax(pass)" and just put 31
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-06-2012 , 03:55   Re: help
Reply With Quote #3

Quote:
Originally Posted by Liverwiz View Post
remove "charsmax(pass)" and just put 31
Really? You should NOT hardcode the array size and SHOULD use charsmax(). This is why you should start testing any code/changes you suggest.
__________________
fysiks is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-06-2012 , 04:36   Re: help
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Really? You should NOT hardcode the array size and SHOULD use charsmax(). This is why you should start testing any code/changes you suggest.
i seriously dont understand why they dont test their codes b4 posting ... , and changing charsmax to 31 .... is simply retarded ...
EpicMonkey is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 05-06-2012 , 06:17   Re: help
Reply With Quote #5

Quote:
Originally Posted by EpicMonkey View Post
i seriously dont understand why they dont test their codes b4 posting ... , and changing charsmax to 31 .... is simply retarded ...
He's not retarded, he only want to help but he dont know.. :p
__________________
Artifact is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-06-2012 , 07:38   Re: help
Reply With Quote #6

Quote:
Originally Posted by Artifact View Post
He's not retarded, he only want to help but he dont know.. :p
i never called anyone a retard , i claimed that changing charsmax to 31 is retarded , since it makes no sense to do so
EpicMonkey is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 05-05-2012 , 10:41   Re: help
Reply With Quote #7

Anyone else?
__________________
Artifact is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 05-05-2012 , 10:51   Re: help
Reply With Quote #8

Code:
new pass[32] get_cvar_string("sv_password", pass, charsmax(pass)) if(!pass[0])        return PLUGIN_HANDLED
__________________
The functional way is the right way
GordonFreeman (RU) is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 05-05-2012 , 11:49   Re: help
Reply With Quote #9

Work, thanks ;)
__________________
Artifact is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-05-2012 , 12:01   Re: help
Reply With Quote #10

You should also trim the password string, because the password can be " pass", but the code will check only the first character which is empty and it will return wrong result.
__________________

Last edited by <VeCo>; 05-05-2012 at 12:01.
<VeCo> 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 00:26.


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