20.10.2010, 11:08
In this page https://sampwiki.blast.hk/wiki/Fread
there is error -
public OnGameModeInit()
{
new string[64]; // Create the string to store the read text in
new File:example = fopen("Startup.txt", io_read); // Open the file
while(fread(example, string)) //reads the file line-by-line
{
if(strcmp(string, "Ban", true) == 0) //if any of the lines in the file say "Ban" the system will ban the player
{
Ban(playerid); //bans the player
}
}
fclose(example);
return 1;
}
must be
public OnPlayerConnect(playerid)
{
new string[64]; // Create the string to store the read text in
new File:example = fopen("Startup.txt", io_read); // Open the file
while(fread(example, string)) //reads the file line-by-line
{
if(strcmp(string, "Ban", true) == 0) //if any of the lines in the file say "Ban" the system will ban the player
{
Ban(playerid); //bans the player
}
}
fclose(example);
return 1;
}
there is error -
public OnGameModeInit()
{
new string[64]; // Create the string to store the read text in
new File:example = fopen("Startup.txt", io_read); // Open the file
while(fread(example, string)) //reads the file line-by-line
{
if(strcmp(string, "Ban", true) == 0) //if any of the lines in the file say "Ban" the system will ban the player
{
Ban(playerid); //bans the player
}
}
fclose(example);
return 1;
}
must be
public OnPlayerConnect(playerid)
{
new string[64]; // Create the string to store the read text in
new File:example = fopen("Startup.txt", io_read); // Open the file
while(fread(example, string)) //reads the file line-by-line
{
if(strcmp(string, "Ban", true) == 0) //if any of the lines in the file say "Ban" the system will ban the player
{
Ban(playerid); //bans the player
}
}
fclose(example);
return 1;
}