[Ajuda] Servidor fechando apуs o comando
#1

Boa noite, galera! Recentemente criei esta conta no fуrum e venho aprendendo a programar com umas bases de GMs que tenho, porйm, ao digitar um comando o samp.exe fecha, e as pastas estгo na scriptfiles.
o comando й "/criarcla",
Код:
if( !strcmp( cmd, "/criarcla", true ))
	{
		if( in_z[ playerid ] != -1 )
		{
		    SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк sу pode utilizar comandos de clг fora das Gangue Zones !" );
		    return 1;
		}
	    if( LiberadoGG[ playerid ] == 0 )
	    {
	        SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк precisa da permissгo de um(a) adminstrador(a) para criar um(a) Clг / Gangue !" );
	        SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк tambйm precisa ter $10000 em mгos." );
	        return 1;
		}
		if( GetPlayerCash( playerid ) < 10000 )
		{
		    SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк precisa de $10000 para poder criar um clг !" );
		    return 1;
		}
		if( strcmp( playerClan[ playerid ], "Nenhum", false ))
  		{
  		    format( gStr, 256, "[ x ] Vocк jб percente ao Clг / Gangue dos(as) %s !", playerClan[ playerid ] );
  		    SendClientMessage( playerid, COLOR_ERRO, gStr );
  		    return 1;
  		}
		new
			length = strlen( cmdtext )
		;
		while (( idx < length ) && ( cmdtext[ idx ] <= ' ' ))
		{
	     	idx++;
		}
		new offset = idx;
		new result[ 64 ];
		while (( idx < length ) && (( idx - offset ) < ( sizeof( result ) - 1 )) )
		{
			result[ idx - offset ] = cmdtext[ idx ];
	   		idx++;
		}
	 	result[ idx - offset ] = EOS;

	 	if( !strlen( result ))
		{
	      	SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /CriarCla [ Clг / Gangue NOME ]" );
	      	return 1;
	  	}
 	 	if( strlen( result ) > 24 )
		{
	      	SendClientMessage( playerid, COLOR_ERRO, "[ x ] O mбximo de caracteres permitido й 24 !" );
	      	SendClientMessage( playerid, COLOR_ERRO, "[ x ] Escolha um nome menor para seu Clг / Gangue !" );
	      	return 1;
	  	}
	  	if( !IsValidNickCla( result ))
        {
            SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк utilizou caracteres invбlido / especiais !" );
            SendClientMessage( playerid, COLOR_ERRO, "[ x ] Escolha um nome com caracteres comuns !" );
			return 1;
		}
	  	format( gFile, sizeof( gFile ), "clas/%s.ini", result );
		if( !fexist( gFile ))
		{
			dini_Create( gFile );
			dini_Set( gFile, "Dono", PlayerName( playerid ));
			dini_IntSet( gFile, "Color", -1 );
			new
			    m_id[ 24 ]
			;
			for( new m = 1; m < 31; ++m )
			{
			    format( m_id, 24, "Membro%d", m );
			    dini_Set( gFile, m_id, "Ninguem" );
			}
		}
		else
		{
		    format( gStr, 256, "[ x ] %s й um(a) Clг / Gangue jб existente !", result );
			SendClientMessage( playerid, COLOR_ERRO, gStr );
			SendClientMessage( playerid, COLOR_ERRO, "[ x ] Defina outro nome para seu Clг / Gangue." );
			return 1;
		}
		format( pFile, 256, "clas/%s.ini", PlayerName( playerid ));
  	  	if( fexist( pFile ))
	  	{
	  	    fremove( pFile );
			dini_Create( pFile );
	  	    dini_Set( pFile, "cla", result );
	  	}
	  	else
	  	{
			dini_Create( pFile );
	  	    dini_Set( pFile, "cla", result );
	  	}
	  	format( playerClan[ playerid ], MAX_PLAYER_NAME+1, result );
	  	clanColor[ playerid ] = -1;

		format( gStr, sizeof( gStr ), "[ > ] Clг / Gangue {FFFFFF}%s{FFFF00} criado(a).", result );
		SendClientMessage( playerid, COLOR_AMARELO, gStr );
		format( gStr, 256, "~r~~h~Cla / Gangue~n~~w~%s~n~~g~~h~Criado com sucesso!", result );
		GameTextForPlayer( playerid, gStr, 5000, 15 );
        sGivePlayerCash( playerid, -10000 );
		format( gstring, sizeof( gstring ), "[ > ] %s acaba de fundar o(a) Clг / Gangue {FFFF00}%s", PlayerName( playerid ), result );
		SendClientMessageToAll( COLOR_BRANCO, gstring );
	  	return 1;
	}
====
A pasta clг jб estб criada na scriptfiles.
й a mesma coisa com um outro comando que serve para salvar as corridas.
Se alguйm puder me ajudar, vou ficar muito grato!
Bom dia, tarde e noite! Grato.
Reply
#2

Veja se o nome da pasta й "clas" e nгo "Clг"
Reply
#3

Olб, pare tudo o que esteja fazendo e busque aperfeiзoar seu conhecimento com algum processador de comandos e DOF2 (inicialmente).

Faзa alguns debugs pra ver atй qual parte do cуdigo funciona.
Reply
#4

Consegui ajustar! Eu testei em outro computador, uma versгo antes de ajustar as strings de [128] para [256]
Apуs esta mudanзa, eu estava com uns erros, incluindo estes.
motivo da mudanзa: comeзou a nгo querer compilar por algum problema com arrays, consequentemente me gerando mais problemas.
Fico muito feliz pela ajuda, obrigado!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)