get user name
Hi, i have some bugs with this script so can tell me what is wroung?
Script to get user name, red line is the problem in logs PHP Code:
Quote:
Quote:
|
Re: get user name
Problem is that sometimes you are replacing one character with two characters, and let's say a player has a name of length 32 which is max, but 5 of the chars are ', then you need length 37 to store the replaced version.
easy fix is to change szName[33] (which should be 32 anyways) to szName[64] but this will sometimes clip the player's name if you try to set his name to the newly generated name, since it's too long for the game also, you must never return a string in AMXX you must pass the array via reference which will edit the original array PHP Code:
|
Re: get user name
best option is i remove replacing characters or i change chars to 64
|
Re: get user name
Quote:
may I ask why you're doing this filtering? |
Re: get user name
Quote:
ps: i didnt understand any thing from yours answer and why no return in AMXX? |
Re: get user name
PHP Code:
|
Re: get user name
Quote:
|
Re: get user name
Quote:
|
Re: get user name
Here's a stock for preventing mysql injection
It prevents all problems but requires a buffer size x3 the original size here's how you use it PHP Code:
I'll say it one more time; returning strings the way you're trying to is not supported in pawn I doubt a full explanation of why would do you any good(and I can't give it to you because I don't know) but the fact that you can't find a single function that returns a string in the entirety of amxmodx should be a hint. |
Re: get user name
You are right!
|
| All times are GMT -4. The time now is 22:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.