Raised This Month: $ Target: $400
 0% 

[ES] Remover Signos como ' En el nombre (solucionado)


  
 
 
Thread Tools Display Modes
Author Message
TomasQueTomas?
BANNED
Join Date: Jun 2010
Old 06-04-2010 , 17:51   [ES] Remover Signos como ' En el nombre (solucionado)
#1

Como puedo remover los ' en los nombres dado que me produce un error en SQLx.

PD: Encontre esto (lo modifique)

PHP Code:
#include <amxmodx>
#include <amxmisc>

public client_connect(id)
{
    new 
name[33]
    
get_user_name(idname32)
    if (
equal(name"'"))
    {
        
emessage_beginMSG_ONESVC_DISCONNECT_id )
        
ewrite_string"Tu nombre no puede contener -> ' <-" ); 
        
emessage_end( ); 
    }
}
public 
client_infochanged(id){
    
    if(
is_user_connected(id))
    {
        new 
szNewname[33]; get_user_info(id"name"szNewname,32)
        
        if (
equal(szNewname"'"))
        {
            
replace_all(szNewname32"'""")
            
client_cmd(id"name ^"%s^""szNewname)
            
set_user_info(id"name ^"%s^""szNewname)
        }
    }

Sirve :$?

Last edited by TomasQueTomas?; 06-04-2010 at 18:16.
TomasQueTomas? is offline
xhiino
Senior Member
Join Date: Oct 2009
Location: santiasko
Old 06-04-2010 , 18:11   Re: [ES] Remover Signos como ' En el nombre
#2

:S no me acuerdo del comando pero hay un sistema en amx que no permite que en el nombre se pueda tener "X" indicios ( ej "adm , tag , etc...)

pregunta por ese sistema que te digo

PD: si lo encuentro te digo
__________________
xhiino is offline
Send a message via MSN to xhiino
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 06-04-2010 , 18:32   Re: [ES] Remover Signos como ' En el nombre
#3

Quote:
Originally Posted by TomasQueTomas? View Post
Como puedo remover los ' en los nombres dado que me produce un error en SQLx.

PD: Encontre esto (lo modifique)

PHP Code:
#include <amxmodx>
#include <amxmisc>

public client_connect(id)
{
    new 
name[33]
    
get_user_name(idname32)
    if (
equal(name"'"))
    {
        
emessage_beginMSG_ONESVC_DISCONNECT_id )
        
ewrite_string"Tu nombre no puede contener -> ' <-" ); 
        
emessage_end( ); 
    }
}
public 
client_infochanged(id){
    
    if(
is_user_connected(id))
    {
        new 
szNewname[33]; get_user_info(id"name"szNewname,32)
        
        if (
equal(szNewname"'"))
        {
            
replace_all(szNewname32"'""")
            
client_cmd(id"name ^"%s^""szNewname)
            
set_user_info(id"name ^"%s^""szNewname)
        }
    }

Sirve :$?
No se si esta bien o mal xD
pero tendria que ser contain, no equal
__________________
Oh hell no this shit is awesome !!!
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
L//
Senior Member
Join Date: Aug 2008
Location: Not found
Old 06-04-2010 , 18:49   Re: [ES] Remover Signos como ' En el nombre
#4

PHP Code:
/**
 * Back-quotes characters in a string for database querying.
 * Note: The buffer's maximum size should be 2*strlen(string) to catch
 * all scenarios.
 *
 * @param db                Database handle, for localization.
 * @param buffer            Buffer to copy to.
 * @param buflen            Maximum size of the buffer.
 * @param string            String to backquote (should not overlap buffer).
 * @return                    Length of new string, or -1 on failure.
 */
native SQL_QuoteString(Handle:dbbuffer[], buflen, const string[]);

/**
 * Back-quotes characters in a string for database querying.
 * Note: The buffer's maximum size should be 2*strlen(string) to catch
 * all scenarios.
 *
 * @param db                Database handle, for localization.
 * @param buffer            Buffer to copy to.
 * @param buflen            Maximum size of the buffer.
 * @param fmt                Format of string to backquote (should not overlap buffer).
 * @param ...                Format arguments.
 * @return                    Length of new string, or -1 on failure.
 */
native SQL_QuoteStringFmt(Handle:dbbuffer[], buflen, const fmt[], any:...); 
__________________
L// is offline
Send a message via MSN to L//
TomasQueTomas?
BANNED
Join Date: Jun 2010
Old 06-04-2010 , 19:04   Re: [ES] Remover Signos como ' En el nombre
#5

Quote:
Originally Posted by L// View Post
PHP Code:
/**
 * Back-quotes characters in a string for database querying.
 * Note: The buffer's maximum size should be 2*strlen(string) to catch
 * all scenarios.
 *
 * @param db                Database handle, for localization.
 * @param buffer            Buffer to copy to.
 * @param buflen            Maximum size of the buffer.
 * @param string            String to backquote (should not overlap buffer).
 * @return                    Length of new string, or -1 on failure.
 */
native SQL_QuoteString(Handle:dbbuffer[], buflen, const string[]);

/**
 * Back-quotes characters in a string for database querying.
 * Note: The buffer's maximum size should be 2*strlen(string) to catch
 * all scenarios.
 *
 * @param db                Database handle, for localization.
 * @param buffer            Buffer to copy to.
 * @param buflen            Maximum size of the buffer.
 * @param fmt                Format of string to backquote (should not overlap buffer).
 * @param ...                Format arguments.
 * @return                    Length of new string, or -1 on failure.
 */
native SQL_QuoteStringFmt(Handle:dbbuffer[], buflen, const fmt[], any:...); 
No utilizo eso.
TomasQueTomas? is offline
L//
Senior Member
Join Date: Aug 2008
Location: Not found
Old 06-04-2010 , 19:39   Re: [ES] Remover Signos como ' En el nombre
#6

Vas a tener que usarlo entonces
__________________
L// is offline
Send a message via MSN to L//
Kiske
Veteran Member
Join Date: May 2009
Old 06-04-2010 , 19:41   Re: [ES] Remover Signos como ' En el nombre
#7

Yo lo tengo así..
En PutinServer:

PHP Code:
get_user_nameIndexszName[Index], charsmaxszName[] ) )
replace_allszName[Index], charsmaxszName[] ), "'"""
__________________

Kiske is offline
Send a message via Skype™ to Kiske
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 06-04-2010 , 20:01   Re: [ES] Remover Signos como ' En el nombre
#8

01101101 is offline
TomasQueTomas?
BANNED
Join Date: Jun 2010
Old 06-04-2010 , 20:11   Re: [ES] Remover Signos como ' En el nombre
#9

Quote:
Originally Posted by 01101101 View Post
siempre existe esa posibilidad.
TomasQueTomas? is offline
Kiske
Veteran Member
Join Date: May 2009
Old 06-04-2010 , 20:13   Re: [ES] Remover Signos como ' En el nombre
#10

Quote:
Originally Posted by 01101101 View Post

Eso mismo dijiste hace como 2 o 3 meses =/
__________________

Kiske is offline
Send a message via Skype™ to Kiske
 



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 21:17.


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