16.01.2015, 19:50
I've got no idea whats going on. for some reason the string is returning one less character than it should, I've got multiple 'stocks' that basically do the same thing for other things.
pawn Код:
stock RandomEx(min, max) // Used for getting RANDOM letters or numbers (using %c)
{
return random(max - min) + min;
}
stock RandomString()
{
new string[10];
format(string, sizeof(string), "%c%c%c%c%c%c%c%c%c%c", RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'),RandomEx('A','Z'));
return string; // returns 9 characters not 10.
}