24.09.2012, 00:40
OK, Volte ao Original
E coloca isso em seu GM
pawn Код:
new modelid, Float:X, Float:Y, Float:Z, Float:ang, Cor1, Cor2;
temp = fopen("Veнculos.rpg", io_readwrite);
while(fread(temp, tmp, sizeof(tmp), false)) {
index = 0;
modelid = strval(strtok(tmp, index));
X = Float:floatstr(strtok(tmp, index));
Y = Float:floatstr(strtok(tmp, index));
Z = Float:floatstr(strtok(tmp, index));
ang = Float:floatstr(strtok(tmp, index));
Cor1 = strval(strtok(tmp, index));
Cor2 = strval(strtok(tmp, index));
pawn Код:
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock strtokEx(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[64];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

