stock LoaderLombada()
{
new ParameterName[50], ParameterValue[50], File:CFile, LineFromFile[50];
format(Don, sizeof(Don), LocaSave, Quantidade);
if (fexist(Don))
{
fread(CFile, LineFromFile);
while (strlen(LineFromFile) > 0)
{
for (new i; i < MAX_LOMBADA; i++)
{
if (strcmp(ParameterName, "LocalX", false) == 0)
LombadaInfo[i][PosX] = floatstr(ParameterValue);
if (strcmp(ParameterName, "LocalY", false) == 0)
LombadaInfo[i][PosY] = floatstr(ParameterValue);
if (strcmp(ParameterName, "LocalZ", false) == 0)
LombadaInfo[i][PosZ] = floatstr(ParameterValue);
}
}
fclose(CFile);
CreateObject(19425, LombadaInfo[Quantidade][PosX],LombadaInfo[Quantidade][PosY],LombadaInfo[Quantidade][PosZ]-3.0, 0.0, 0.0, 0.0, 300.00);
print("Todas Lombadas Carregadar Com Sucesso!");
}
}
stock LoaderLombada()
{
new ParameterName[50], ParameterValue[50], File:CFile, LineFromFile[50];
format(Don, sizeof(Don), LocaSave, Quantidade);
if (fexist(Don))
{
fread(CFile, LineFromFile);
while (strlen(LineFromFile) > 0)
{
for (new i; i < MAX_LOMBADA; i++)
{
new File:example = fopen("%i.ini", io_write);
if(example)
{
if (strcmp(ParameterName, "LocalX", false) == 0)
LombadaInfo[i][PosX] = floatstr(ParameterValue);
if (strcmp(ParameterName, "LocalY", false) == 0)
LombadaInfo[i][PosY] = floatstr(ParameterValue);
if (strcmp(ParameterName, "LocalZ", false) == 0)
LombadaInfo[i][PosZ] = floatstr(ParameterValue);
}
}
}
fclose(CFile);
CreateObject(19425, LombadaInfo[Quantidade][PosX],LombadaInfo[Quantidade][PosY],LombadaInfo[Quantidade][PosZ]-3.0, 0.0, 0.0, 0.0, 300.00);
print("Todas Lombadas Carregadar Com Sucesso!");
}
}
stock LoaderLombada()
{
new ParameterName[50], ParameterValue[50], File:CFile, LineFromFile[50];
format(Don, sizeof(Don), LocaSave, Quantidade);
if (fexist(Don))
{
fread(CFile, LineFromFile);
while (strlen(LineFromFile) > 0)
{
for (new i; i < MAX_LOMBADA; i++)
{
new File:example = fopen("%i.ini", Quantidade);
if(example)
{
if (strcmp(ParameterName, "LocalX", false) == 0)
LombadaInfo[i][PosX] = floatstr(ParameterValue);
if (strcmp(ParameterName, "LocalY", false) == 0)
LombadaInfo[i][PosY] = floatstr(ParameterValue);
if (strcmp(ParameterName, "LocalZ", false) == 0)
LombadaInfo[i][PosZ] = floatstr(ParameterValue);
}
}
}
fclose(CFile);
CreateObject(19425, LombadaInfo[Quantidade][PosX],LombadaInfo[Quantidade][PosY],LombadaInfo[Quantidade][PosZ]-3.0, 0.0, 0.0, 0.0, 300.00);
print("Todas Lombadas Carregadar Com Sucesso!");
}
}
warning 213: tag mismatch
new File:example = fopen("%i.ini", Quantidade);
fread(CFile, LineFromFile);
public OnPlayerConnect(playerid)
{
new string[64]; // Cria a string para armazenar o texto lido
new File:example = fopen("Startup.txt", io_read); // Abre o arquivo
while(fread(example, string)) //Lк o arquivo linha por linha
{
if(strcmp(string, "Ban", true) == 0) //Se alguma linha contйm "Ban" o sistema irб banir o jogador
{
Ban(playerid);
}
}
fclose(example);
return 1;
}
Vocк dб lendo sem ter aberto o arquivo.
pawn Код:
Aqui vai um exemplo da wiki pawn Код:
|