Raised This Month: $ Target: $400
 0% 

help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-05-2012 , 12:14   Re: help
Reply With Quote #1

Quote:
Originally Posted by <VeCo> View Post
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.
#include <core>
Code:
if(strlen(pass) == 0)    return PLUGIN_HANDLED

Last edited by Liverwiz; 05-05-2012 at 12:16.
Liverwiz is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 05-05-2012 , 13:22   Re: help
Reply With Quote #2

Thanks a lot guys ;)
__________________
Artifact is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-06-2012 , 06:47   Re: help
Reply With Quote #3

Since no one has actually explained why your code didn't work in the first place ... The reason why is because functions that are used to get a string result are passed byref - which means it puts the result into the array that you've inserted into the function - it doesn't return a result like numerical getting functions do.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-06-2012 , 14:56   Re: help
Reply With Quote #4

Quote:
Originally Posted by hornet View Post
Since no one has actually explained why your code didn't work in the first place ... The reason why is because functions that are used to get a string result are passed byref - which means it puts the result into the array that you've inserted into the function - it doesn't return a result like numerical getting functions do.
Also, you cannot compare strings with ==. You would need to use equal() or equali(). The reason Gordon's solution works is that an empty string will have the value 0 in the first cell.
__________________
fysiks is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-07-2012 , 23:25   Re: help
Reply With Quote #5

holy tits.....i should go back and delete all my comments. I think i was drunk.....
Liverwiz 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 00:26.


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