format(PropertyString,sizeof(PropertyString),"%s \n Owner: %s \n House ID: %d \n Rent Price: Unrentable \n Description: %s",HouseInfo[h][hMessage],HouseInfo[h][hOwner],HouseInfo[h][hWorld], HouseInfo[h][hDiscription]);
stock NameWithoutUnderscore( _name[ ] )
{
for( new i, l = strlen( _name ); i != l; i++ ) if( _name[ i ] == '_' ) _name[ i ] = ' ';
return _name;
}
NameWithoutUnderscore( HouseInfo[ h ][ hOwner ] )
pawn Код:
pawn Код:
|
stock NameWithoutUnderscore( _name[ MAX_PLAYER_NAME ] )
{
for( new i, l = strlen( _name ); i != l; i++ ) if( _name[ i ] == '_' ) _name[ i ] = ' ';
return _name;
}
Change to:
pawn Код:
|
53185) : error 047: array sizes do not match, or destination array is too small
format(PropertyString,sizeof(PropertyString),"%s \n Owner: %s \n House ID: %d \n Rent Price: Unrentable \n Description: %s",HouseInfo[h][hMessage],NameWithoutUnderscore( HouseInfo[ h ][ hOwner ] ),HouseInfo[h][hWorld], HouseInfo[h][hDiscription]);
public OnGameModeInit( )
{
printf( "The name is \"%s\"", NameWithoutUnderscore( "test_TEST" ) );
return 1;
}
stock NameWithoutUnderscore( _name[ MAX_PLAYER_NAME ] )
{
for( new i, l = strlen( _name ); i != l; i++ ) if( _name[ i ] == '_' ) _name[ i ] = ' ';
return _name;
}
[18:27:46] The name is "test TEST"
enum TEST
{
STRING[ MAX_PLAYER_NAME ]
}
new
Test[ 5 ][ TEST ]
;
public OnGameModeInit( )
{
strcat( Test[ 0 ][ STRING ], "Test1_Test2", MAX_PLAYER_NAME );
printf( "The name is \"%s\"", NameWithoutUnderscore( Test[ 0 ][ STRING ] ) );
return 1;
}
stock NameWithoutUnderscore( _name[ ] )
{
new
new_name[ MAX_PLAYER_NAME ]
;
for( new i, l = strlen( _name ); i != l; i++ ) if( _name[ i ] == '_' ) _name[ i ] = ' ';
strcpy( new_name, _name, MAX_PLAYER_NAME );
return new_name;
}
stock strcpy( dest[ ], const source[ ], maxlength=sizeof dest )
{
strcat( ( dest[ 0 ] = EOS, dest ), source, maxlength );
}