gups 1.1 contain many bugs example /c register
but this is the solution
[pawn]
if ( strcmp( cmd, "registrar", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "Escribe: /c registrar [clave]" );
else if ( IsLoggedIn( playerid ) ) SendClientMessage( playerid, RED, "Error: Ya estas registrado." );
else if (PlayerLevel(playerid) >= 1) SendClientMessage(playerid, RED,"Este Nick-name ya esta registrado");// here is the solution FOR NOT register in the same count
else
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new string[ 24 ], IP[ 24 ], szMsg[ 128 ];
GetPlayerIp( playerid, IP, 24 );
format( string, 24, "%s", IP );
dini_Create( file );
dini_Set( file, "Password", encrypt( tmp ) );
dini_Set( file, "Login", "1" );
dini_Set( file, "Bank", "0" );
dini_Set( file, "Cash", "0" );
dini_Set( file, "Level", "1" );
dini_Set( file, "Stats", "1" );
dini_Set( file, "Ip", string );
GameTextForPlayer( playerid, "Registro Completo");
SendClientMessage( playerid, COLOR_GREEN, "Te has registrado exitosamente." );
format( szMsg, sizeof( szMsg ), "Tu clave:[ %s ] Tu Nivel: [ 1 ]", tmp, IP );
SendClientMessage( playerid, RED, szMsg );
SendClientMessage( playerid, COLOR_GREEN, "Para ver los comandos usa !Comandos" );
PlayerInfo[ playerid ][ Logged ] = 1;
PlayerInfo[ playerid ][ Level ] = 1;
PlayerInfo[ playerid ][ Stats ] = 1;
}
return 1;
}[/pawn]
Sorry my languaje is spanish xD but i show the bug xD